mirror of
https://github.com/tc39/test262.git
synced 2025-07-02 03:34:37 +02:00
Fix Promise/prototype/finally/rejected-observable-then-calls-argument
This commit is contained in:
parent
47f8c1c976
commit
900855b07b
@ -19,7 +19,7 @@ flags: [async]
|
|||||||
|
|
||||||
Promise.reject(new Test262Error())
|
Promise.reject(new Test262Error())
|
||||||
.finally(function() {})
|
.finally(function() {})
|
||||||
.then(() => $DONE(), $DONE);
|
.then($DONE, () => $DONE());
|
||||||
|
|
||||||
var calls = 0;
|
var calls = 0;
|
||||||
var expected = [
|
var expected = [
|
||||||
@ -28,7 +28,7 @@ var expected = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
var then = Promise.prototype.then;
|
var then = Promise.prototype.then;
|
||||||
Promise.prototype.then = function(resolve) {
|
Promise.prototype.then = function(resolve, reject) {
|
||||||
assert(!isConstructor(resolve));
|
assert(!isConstructor(resolve));
|
||||||
assert.sameValue(resolve.length, expected[calls].length);
|
assert.sameValue(resolve.length, expected[calls].length);
|
||||||
assert.sameValue(resolve.name, expected[calls].name);
|
assert.sameValue(resolve.name, expected[calls].name);
|
||||||
@ -38,5 +38,5 @@ Promise.prototype.then = function(resolve) {
|
|||||||
|
|
||||||
calls += 1;
|
calls += 1;
|
||||||
|
|
||||||
return then.call(this, resolve);
|
return then.call(this, resolve, reject);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user