{"action":"opened","issue":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/623","labels_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/623/labels{/name}","comments_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/623/comments","events_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/623/events","html_url":"https://github.com/petkaantonov/bluebird/issues/623","id":77918890,"number":623,"title":"Illegal invocation when resolving a promise in nw.js (node-webkit)","user":{"login":"analog-nico","id":1407390,"avatar_url":"https://avatars.githubusercontent.com/u/1407390?v=3","gravatar_id":"","url":"https://api.github.com/users/analog-nico","html_url":"https://github.com/analog-nico","followers_url":"https://api.github.com/users/analog-nico/followers","following_url":"https://api.github.com/users/analog-nico/following{/other_user}","gists_url":"https://api.github.com/users/analog-nico/gists{/gist_id}","starred_url":"https://api.github.com/users/analog-nico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analog-nico/subscriptions","organizations_url":"https://api.github.com/users/analog-nico/orgs","repos_url":"https://api.github.com/users/analog-nico/repos","events_url":"https://api.github.com/users/analog-nico/events{/privacy}","received_events_url":"https://api.github.com/users/analog-nico/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-19T03:54:09Z","updated_at":"2015-05-19T03:54:09Z","closed_at":null,"body":"I use the following code in nw.js:\r\n``` js\r\n(new BPromise(function (resolve) {\r\n    resolve('test');\r\n}))\r\n    .then(console.log);\r\n```\r\n\r\nOr even simpler:\r\n``` js\r\nBPromise.resolve('test')\r\n    .then(console.log);\r\n```\r\n\r\nBoth snippets throw:\r\n```\r\nUnhandled rejection Error: TypeError: Illegal invocation\r\n    at Object.ensureErrorObject (.../node_modules/bluebird/js/main/util.js:228:20)\r\n    at Promise._rejectCallback (.../node_modules/bluebird/js/main/promise.js:416:22)\r\n    at Promise._settlePromiseFromHandler (.../node_modules/bluebird/js/main/promise.js:460:17)\r\n    at Promise._settlePromiseAt (.../node_modules/bluebird/js/main/promise.js:530:18)\r\n    at Promise._settlePromiseAtPostResolution (.../node_modules/bluebird/js/main/promise.js:224:10)\r\n    at Async._drainQueue (.../node_modules/bluebird/js/main/async.js:182:12)\r\n    at Async._drainQueues (.../node_modules/bluebird/js/main/async.js:187:10)\r\n    at Immediate.Async.drainQueues [as _onImmediate] (.../node_modules/bluebird/js/main/async.js:15:14)\r\n    at processImmediate [as _immediateCallback] (timers.js:321:17)\r\n```\r\n\r\nI use Bluebird v2.9.25 and nw.js v0.12.1.\r\n\r\nAny ideas?"}}