diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js index db9e7a11d8..c149da931a 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js @@ -3,10 +3,12 @@ /*--- info: > - Promise reaction jobs have predictable environment + [...] + 6. Else, let handlerResult be Call(handler, undefined, «argument»). es6id: S25.4.2.1_A3.1_T1 author: Sam Mikes -description: Promise.onFulfilled gets undefined as 'this' +description: > + "fulfilled" handler invoked correctly outside of strict mode flags: [noStrict] includes: [fnGlobalObject.js] ---*/ @@ -25,6 +27,11 @@ var p = Promise.resolve(obj).then(function(arg) { return; } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } + $DONE(); }, function() { $DONE('The promise should not be rejected.'); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js index f79ea81284..33068c06e4 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js @@ -3,10 +3,12 @@ /*--- info: > - Promise reaction jobs have predictable environment + [...] + 6. Else, let handlerResult be Call(handler, undefined, «argument»). es6id: S25.4.2.1_A3.1_T2 author: Sam Mikes -description: Promise.onFulfilled gets undefined as 'this' +description: > + "fulfilled" handler invoked correctly in strict mode flags: [onlyStrict] ---*/ @@ -24,6 +26,11 @@ var p = Promise.resolve(obj).then(function(arg) { return; } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } + $DONE(); }, function() { $DONE('The promise should not be rejected.'); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js index 078bbe2d5b..ee2bff3722 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js @@ -3,12 +3,12 @@ /*--- info: > - Promise reaction jobs have predictable environment - 'this' is global object in sloppy mode, - undefined in strict mode + [...] + 6. Else, let handlerResult be Call(handler, undefined, «argument»). es6id: S25.4.2.1_A3.2_T1 author: Sam Mikes -description: onRejected gets default 'this' +description: > + "rejected" handler invoked correctly outside of strict mode flags: [noStrict] includes: [fnGlobalObject.js] ---*/ @@ -29,5 +29,10 @@ var p = Promise.reject(obj).then(function () { return; } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } + $DONE(); }); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js index 2736556e3a..c782ddb9d0 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js @@ -3,12 +3,12 @@ /*--- info: > - Promise reaction jobs have predictable environment - 'this' is global object in sloppy mode, - undefined in strict mode + [...] + 6. Else, let handlerResult be Call(handler, undefined, «argument»). es6id: S25.4.2.1_A3.2_T2 author: Sam Mikes -description: onRejected gets default 'this' +description: > + "rejected" handler invoked correctly in strict mode flags: [onlyStrict] ---*/ @@ -28,5 +28,10 @@ var p = Promise.reject(obj).then(function () { return; } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } + $DONE(); });