Chromium Code Reviews| Index: src/promise.js |
| diff --git a/src/promise.js b/src/promise.js |
| index db1f36095d11c95fd5921e953a214d39c5f9aa30..1a21dd1cf9a8d6c61c927423196b4447caa9b004 100644 |
| --- a/src/promise.js |
| +++ b/src/promise.js |
| @@ -29,7 +29,7 @@ var lastMicrotaskId = 0; |
| var GlobalPromise = function Promise(resolver) { |
| if (resolver === promiseRawSymbol) return; |
| if (!%_IsConstructCall()) throw MakeTypeError(kNotAPromise, this); |
| - if (!IS_SPEC_FUNCTION(resolver)) |
| + if (!IS_CALLABLE(resolver)) |
| throw MakeTypeError(kResolverNotAFunction, resolver); |
| var promise = PromiseInit(this); |
| try { |
| @@ -84,7 +84,7 @@ function PromiseCoerce(constructor, x) { |
| } catch(r) { |
| return %_CallFunction(constructor, r, PromiseRejected); |
| } |
| - if (IS_SPEC_FUNCTION(then)) { |
| + if (IS_CALLABLE(then)) { |
| var deferred = %_CallFunction(constructor, PromiseDeferred); |
| try { |
| %_CallFunction(x, deferred.resolve, deferred.reject, then); |
| @@ -258,10 +258,10 @@ function PromiseCatch(onReject) { |
| // Multi-unwrapped chaining with thenable coercion. |
| function PromiseThen(onResolve, onReject) { |
| - onResolve = IS_SPEC_FUNCTION(onResolve) ? onResolve |
| - : PromiseIdResolveHandler; |
| - onReject = IS_SPEC_FUNCTION(onReject) ? onReject |
| - : PromiseIdRejectHandler; |
| + onResolve = IS_CALLABLE(onResolve) ? onResolve |
| + : PromiseIdResolveHandler; |
|
rossberg
2015/08/26 12:55:48
Nit: should fit one line now (same below)
Benedikt Meurer
2015/08/27 05:18:23
Done.
|
| + onReject = IS_CALLABLE(onReject) ? onReject |
| + : PromiseIdRejectHandler; |
| var that = this; |
| var constructor = this.constructor; |
| return %_CallFunction( |