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

Unified Diff: src/promise.js

Issue 194403002: PromiseCoerce should ignore primitive values. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Replacing (typeof x === 'object') with IS_SPEC_OBJECT(x). 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 | no next file » | 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 82aa99027a1305ac8bf6b95672cccd89504173cd..c5649ef71cfd050bda873f96bb3042ba573db1ff 100644
--- a/src/promise.js
+++ b/src/promise.js
@@ -217,7 +217,7 @@ function PromiseThen(onResolve, onReject) {
PromiseCoerce.table = new $WeakMap;
function PromiseCoerce(constructor, x) {
- if (!(IsPromise(x) || IS_NULL_OR_UNDEFINED(x))) {
+ if (!IsPromise(x) && IS_SPEC_OBJECT(x)) {
var then = x.then;
if (typeof then === 'function') {
if (PromiseCoerce.table.has(x)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698