mirror of https://github.com/tc39/test262.git
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 = {};
|
||||
Object.defineProperty(iterThrows, Symbol.iterator, {
|
||||
get: function () {
|
||||
return {
|
||||
next: function () {
|
||||
throw new Error("abrupt completion");
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
var error = new Test262Error();
|
||||
iterThrows[Symbol.iterator] = function () {
|
||||
return {
|
||||
next: function () {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Promise.race(iterThrows).then(function () {
|
||||
$ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError');
|
||||
},function (err) {
|
||||
if (!(err instanceof TypeError)) {
|
||||
$ERROR('Expected TypeError, got ' + err);
|
||||
}
|
||||
}, function (reason) {
|
||||
assert.sameValue(reason, error);
|
||||
}).then($DONE,$DONE);
|
||||
|
||||
|
|
Loading…
Reference in New Issue