Skip to content

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