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

Update to reflect ES6 Promise API #22

Merged
merged 1 commit into from
Jul 7, 2014
Merged

Conversation

Rich-Harris
Copy link
Contributor

I ran into some very hard-to-debug issues earlier today, which it turns out are due to a discrepancy between the native Promise API and the one that operative expects to deal with.

Essentially, the old prollyfill (the one in vendor/Promise.js) did this...

var promise = new Promise( function ( resolver ) {
  // some code happens...
  resolver.resolve(value);
});

...whereas native ES6 promises (and more up-to-date polyfills such as this one) do this:

var promise = new Promise( function ( fulfil, reject ) {
  // some code happens...
  fulfil(value);
});

The code below accommodates both scenarios - the tests all pass with both old and new polyfills.

@padolsey padolsey merged commit dca5847 into padolsey:master Jul 7, 2014
@Rich-Harris Rich-Harris deleted the promises branch July 7, 2014 21:31
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

Successfully merging this pull request may close these issues.

2 participants