fixup! Fix bug in test

This commit is contained in:
Mike Pennisi 2015-06-23 12:03:09 -04:00
parent 6f2feb0157
commit 5e8b276bf5

View File

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