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

Fix bug in test

This test's description concerns the behavior of `Promise.all` when the
IteratorStep abstract operation fails due to an abrupt completion
returned by the iterator's `next` method. The test body did not actually
assert that functionality.

Update the test body to correctly define the requisite iterator and
assert that the specific error created is the one thrown from the
invocation of `Promise.all`
parent 12cc0148
No related branches found
No related tags found
No related merge requests found
......@@ -11,20 +11,17 @@ description: iterator.next throws, causing Promise.all to reject
---*/
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.all(iterThrows).then(function () {
$ERROR('Promise unexpectedly resolved: Promise.all(iterThrows) should throw TypeError');
},function (err) {
if (!(err instanceof TypeError)) {
$ERROR('Expected TypeError, got ' + err);
}
},function (reason) {
assert.sameValue(reason, error);
}).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