Reviewers: rossberg,
Message:
This is needed to pass the Promise/A+ Compliance Test Suite.
Description:
PromiseCoerce should ignore primitive values.
PromiseCource(x) should return "not a thenable" if typeof(x) !== 'object'
even if x.then exists.
BUG=347095
Please review this at https://codereview.chromium.org/194403002/
SVN Base: git://github.com/v8/v8.git@master
Affected files (+1, -1 lines):
M src/promise.js
Index: src/promise.js
diff --git a/src/promise.js b/src/promise.js
index
82aa99027a1305ac8bf6b95672cccd89504173cd..a89358cc670b3b3cf3a7d765313ac63246c7c2b2
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) && typeof x === 'object' && !IS_NULL(x)) {
var then = x.then;
if (typeof then === 'function') {
if (PromiseCoerce.table.has(x)) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.