mirror of https://github.com/tc39/test262.git
Extend tests to fully cover invocation concerns
Update test metadata to accurately describe the more complete set of assertions.
This commit is contained in:
parent
5f2ba2522f
commit
eded6b269b
|
@ -3,10 +3,12 @@
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
info: >
|
||||||
Promise reaction jobs have predictable environment
|
[...]
|
||||||
|
6. Else, let handlerResult be Call(handler, undefined, «argument»).
|
||||||
es6id: S25.4.2.1_A3.1_T1
|
es6id: S25.4.2.1_A3.1_T1
|
||||||
author: Sam Mikes
|
author: Sam Mikes
|
||||||
description: Promise.onFulfilled gets undefined as 'this'
|
description: >
|
||||||
|
"fulfilled" handler invoked correctly outside of strict mode
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [fnGlobalObject.js]
|
includes: [fnGlobalObject.js]
|
||||||
---*/
|
---*/
|
||||||
|
@ -25,6 +27,11 @@ var p = Promise.resolve(obj).then(function(arg) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arguments.length !== 1) {
|
||||||
|
$DONE('Expected handler function to be called with exactly 1 argument.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$DONE();
|
$DONE();
|
||||||
}, function() {
|
}, function() {
|
||||||
$DONE('The promise should not be rejected.');
|
$DONE('The promise should not be rejected.');
|
||||||
|
|
|
@ -3,10 +3,12 @@
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
info: >
|
||||||
Promise reaction jobs have predictable environment
|
[...]
|
||||||
|
6. Else, let handlerResult be Call(handler, undefined, «argument»).
|
||||||
es6id: S25.4.2.1_A3.1_T2
|
es6id: S25.4.2.1_A3.1_T2
|
||||||
author: Sam Mikes
|
author: Sam Mikes
|
||||||
description: Promise.onFulfilled gets undefined as 'this'
|
description: >
|
||||||
|
"fulfilled" handler invoked correctly in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -24,6 +26,11 @@ var p = Promise.resolve(obj).then(function(arg) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arguments.length !== 1) {
|
||||||
|
$DONE('Expected handler function to be called with exactly 1 argument.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$DONE();
|
$DONE();
|
||||||
}, function() {
|
}, function() {
|
||||||
$DONE('The promise should not be rejected.');
|
$DONE('The promise should not be rejected.');
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
info: >
|
||||||
Promise reaction jobs have predictable environment
|
[...]
|
||||||
'this' is global object in sloppy mode,
|
6. Else, let handlerResult be Call(handler, undefined, «argument»).
|
||||||
undefined in strict mode
|
|
||||||
es6id: S25.4.2.1_A3.2_T1
|
es6id: S25.4.2.1_A3.2_T1
|
||||||
author: Sam Mikes
|
author: Sam Mikes
|
||||||
description: onRejected gets default 'this'
|
description: >
|
||||||
|
"rejected" handler invoked correctly outside of strict mode
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [fnGlobalObject.js]
|
includes: [fnGlobalObject.js]
|
||||||
---*/
|
---*/
|
||||||
|
@ -29,5 +29,10 @@ var p = Promise.reject(obj).then(function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arguments.length !== 1) {
|
||||||
|
$DONE('Expected handler function to be called with exactly 1 argument.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$DONE();
|
$DONE();
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
info: >
|
||||||
Promise reaction jobs have predictable environment
|
[...]
|
||||||
'this' is global object in sloppy mode,
|
6. Else, let handlerResult be Call(handler, undefined, «argument»).
|
||||||
undefined in strict mode
|
|
||||||
es6id: S25.4.2.1_A3.2_T2
|
es6id: S25.4.2.1_A3.2_T2
|
||||||
author: Sam Mikes
|
author: Sam Mikes
|
||||||
description: onRejected gets default 'this'
|
description: >
|
||||||
|
"rejected" handler invoked correctly in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -28,5 +28,10 @@ var p = Promise.reject(obj).then(function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arguments.length !== 1) {
|
||||||
|
$DONE('Expected handler function to be called with exactly 1 argument.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$DONE();
|
$DONE();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue