Skip to content
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

Loading es6-shim after prfun clobbers prfun on Node #2

Closed
appsforartists opened this issue Oct 21, 2014 · 3 comments
Closed

Loading es6-shim after prfun clobbers prfun on Node #2

appsforartists opened this issue Oct 21, 2014 · 3 comments

Comments

@appsforartists
Copy link

See paulmillr/es6-shim#297

@cscott
Copy link
Owner

cscott commented Oct 21, 2014

Note that prfun automatically loads es6-shim if there are no Promises defined, so what's happening here is that the native platform has a Promise definition, but it's buggy so es6-shim replaces it.
prfun should use the same "are Promises buggy" test that es6-shim does, probably.

Note that you can workaround this as shown in the README:

var prfun = require('prfun/wrap');
require('es6-shim'); // optional
var Promise = prfun(globals.Promise);

@appsforartists
Copy link
Author

Thanks. To that end, I imagine I can also do:

var promisify = require('prfun').promisify;

Then, it won't matter if prfun gets clobbered or not.

@cscott
Copy link
Owner

cscott commented Apr 23, 2015

In version 2.0 prfun creates a Promise subclass, rather than clobbering the global Promise.

@cscott cscott closed this as completed Apr 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants