fixup! Fix bug in test

This commit is contained in:
Mike Pennisi 2015-06-23 12:03:09 -04:00
parent 6f2feb0157
commit 5e8b276bf5
1 changed files with 10 additions and 13 deletions

View File

@ -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);