Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: src/promise.js

Issue 214663009: ES6: Promise.prototype.then should use callable for its arguments (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/promises.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/promise.js
diff --git a/src/promise.js b/src/promise.js
index 50f91ae0ba3443f4b9113b6395e68af396bb71a8..29f641d55d6a8ff3343d38e33b348d05607f4640 100644
--- a/src/promise.js
+++ b/src/promise.js
@@ -200,10 +200,8 @@ function PromiseHandle(value, handler, deferred) {
// Multi-unwrapped chaining with thenable coercion.
function PromiseThen(onResolve, onReject) {
- onResolve =
- IS_NULL_OR_UNDEFINED(onResolve) ? PromiseIdResolveHandler : onResolve;
- onReject =
- IS_NULL_OR_UNDEFINED(onReject) ? PromiseIdRejectHandler : onReject;
+ if (typeof onResolve !== 'function') onResolve = PromiseIdResolveHandler;
arv (Not doing code reviews) 2014/03/27 21:10:46 Maybe we should add an IsCallable macro?
+ if (typeof onReject !== 'function') onReject = PromiseIdRejectHandler;
var that = this;
var constructor = this.constructor;
return %_CallFunction(
« no previous file with comments | « no previous file | test/mjsunit/es6/promises.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698