Skip to content

Commit

Permalink
[Fix] IE 8: Promise.resolve(2) was throwing. More named function ex…
Browse files Browse the repository at this point in the history
…pression madness.
  • Loading branch information
ljharb committed Oct 23, 2015
1 parent 741caf7 commit 5ccc742
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -1976,8 +1976,8 @@
};

var Promise = (function () {
return function Promise(resolver) {
if (!(this instanceof Promise)) {
var PromiseShim = function Promise(resolver) {
if (!(this instanceof PromiseShim)) {
throw new TypeError('Constructor Promise requires "new"');
}
if (this && this._promise) {
Expand All @@ -1987,7 +1987,7 @@
if (!ES.IsCallable(resolver)) {
throw new TypeError('not a valid resolver');
}
var promise = emulateES6construct(this, Promise, Promise$prototype, {
var promise = emulateES6construct(this, PromiseShim, Promise$prototype, {
_promise: {
result: void 0,
state: PROMISE_PENDING,
Expand All @@ -2004,6 +2004,7 @@
}
return promise;
};
return PromiseShim;
}());
var Promise$prototype = Promise.prototype;

Expand Down

0 comments on commit 5ccc742

Please sign in to comment.