diff --git a/test/built-ins/Promise/create-resolving-functions-reject.js b/test/built-ins/Promise/create-resolving-functions-reject.js index 9fbd744291..16acef7e24 100644 --- a/test/built-ins/Promise/create-resolving-functions-reject.js +++ b/test/built-ins/Promise/create-resolving-functions-reject.js @@ -15,13 +15,14 @@ flags: [async] ---*/ Promise.resolve(1).then(function() { - return Promise.resolve(2); -}); + return Promise.resolve(); +}).then($DONE, $DONE); -Promise.prototype.then = function(_resolve, reject) { +var then = Promise.prototype.then; +Promise.prototype.then = function(resolve, reject) { assert(!isConstructor(reject)); assert.sameValue(reject.length, 1); assert.sameValue(reject.name, ''); - $DONE(); + return then.call(this, resolve, reject); }; diff --git a/test/built-ins/Promise/create-resolving-functions-resolve.js b/test/built-ins/Promise/create-resolving-functions-resolve.js index 545517a54f..938893df7b 100644 --- a/test/built-ins/Promise/create-resolving-functions-resolve.js +++ b/test/built-ins/Promise/create-resolving-functions-resolve.js @@ -15,13 +15,14 @@ flags: [async] ---*/ Promise.resolve(1).then(function() { - return Promise.resolve(2); -}); + return Promise.resolve(); +}).then($DONE, $DONE); -Promise.prototype.then = function(resolve) { +var then = Promise.prototype.then; +Promise.prototype.then = function(resolve, reject) { assert(!isConstructor(resolve)); assert.sameValue(resolve.length, 1); assert.sameValue(resolve.name, ''); - $DONE(); + return then.call(this, resolve, reject); }; diff --git a/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js b/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js index f3986be98e..852a9f02b4 100644 --- a/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js +++ b/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js @@ -17,12 +17,16 @@ includes: [isConstructor.js] flags: [async] ---*/ -Promise.reject(new Test262Error()).finally(function() {}); +Promise.reject(new Test262Error()) + .finally(function() {}) + .then($DONE, $DONE); + +var then = Promise.prototype.then; Promise.prototype.then = function(thrower) { assert(!isConstructor(thrower)); assert.sameValue(thrower.length, 1); assert.sameValue(thrower.name, ''); assert.throws(Test262Error, thrower); - $DONE(); + return then.call(this, thrower); }; diff --git a/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js b/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js index 64ee539c4a..37648643f9 100644 --- a/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js +++ b/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js @@ -19,12 +19,16 @@ flags: [async] var value = {}; -Promise.resolve(value).finally(function() {}); +Promise.resolve(value) + .finally(function() {}) + .then($DONE, $DONE); + +var then = Promise.prototype.then; Promise.prototype.then = function(valueThunk) { assert(!isConstructor(valueThunk)); assert.sameValue(valueThunk.length, 1); assert.sameValue(valueThunk.name, ''); assert.sameValue(valueThunk(), value); - $DONE(); + return then.call(this, valueThunk); };