Skip to content

Commit

Permalink
Promise spec compliance: check that PromiseCapability used @@create.
Browse files Browse the repository at this point in the history
  • Loading branch information
cscott committed Mar 3, 2014
1 parent 6d65613 commit f922b1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,10 @@
capability.reject = reject;
};
capability.promise = ES.Construct(C, [resolver]);
// see https://bugs.ecmascript.org/show_bug.cgi?id=2478
if (!capability.promise._es6construct) {
throw new TypeError('bad promise constructor');
}
if (!(ES.IsCallable(capability.resolve) &&
ES.IsCallable(capability.reject))) {
throw new TypeError('bad promise constructor');
Expand Down

0 comments on commit f922b1f

Please sign in to comment.