New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise.promisify() throws a type error under phantomjs #556

Closed
noahadams opened this Issue Apr 1, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@noahadams
Contributor

noahadams commented Apr 1, 2015

When calling Promise.promisify() under phantomjs (v 1.9.8 as packaged along with mocha-phantomjs v 3.5.3), a type error is thrown while copying descriptors:

     TypeError: Property description must be an object.
      at copyDescriptors (file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/bluebird/js/browser/bluebird.js:4706)
      at file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/bluebird/js/browser/bluebird.js:3400
      at file:///Users/nba/src/bluebird-promisify-phantomjs-bug/promisify-test.js:8
      at file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:4514
      at file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:4946
      at file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:5051
      at next (file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:4871)
      at file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:4881
      at next (file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:4816)
      at file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:4848
      at timeslice (file:///Users/nba/src/bluebird-promisify-phantomjs-bug/node_modules/mocha/mocha.js:6391)

phantomjs appears to supply the function with a prototypally inherited callee property which is not filtered out: https://github.com/petkaantonov/bluebird/blob/master/src/promisify.js#L15 but then fails to be copied.

This has only been a problem in phantom so far, but we're using it pretty extensively for CI purposes.

I've got a breaking test case here:
https://github.com/noahadams/bluebird-mocha-phantomjs-bug

and a branch ready to PR here:
https://github.com/noahadams/bluebird/tree/callee-property-filtering

PR: #557

@noahadams noahadams changed the title from Promise.promisify throws a type error under phantomjs to Promise.promisify() throws a type error under phantomjs Apr 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment