Skip to content
Snippets Groups Projects
Commit 5e8b276b authored by Mike Pennisi's avatar Mike Pennisi
Browse files

fixup! Fix bug in test

parent 6f2feb01
No related branches found
No related tags found
No related merge requests found
...@@ -8,21 +8,18 @@ description: Promise.race rejects if IteratorStep throws ...@@ -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);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment