mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 23:44:27 +02:00
fixup! Fix bug in test
This commit is contained in:
parent
6f2feb0157
commit
5e8b276bf5
@ -8,21 +8,18 @@ description: Promise.race rejects if IteratorStep throws
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var iterThrows = {};
|
var iterThrows = {};
|
||||||
Object.defineProperty(iterThrows, Symbol.iterator, {
|
var error = new Test262Error();
|
||||||
get: function () {
|
iterThrows[Symbol.iterator] = function () {
|
||||||
return {
|
return {
|
||||||
next: function () {
|
next: function () {
|
||||||
throw new Error("abrupt completion");
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
});
|
|
||||||
|
|
||||||
Promise.race(iterThrows).then(function () {
|
Promise.race(iterThrows).then(function () {
|
||||||
$ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError');
|
$ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError');
|
||||||
},function (err) {
|
}, function (reason) {
|
||||||
if (!(err instanceof TypeError)) {
|
assert.sameValue(reason, error);
|
||||||
$ERROR('Expected TypeError, got ' + err);
|
|
||||||
}
|
|
||||||
}).then($DONE,$DONE);
|
}).then($DONE,$DONE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user