Debian Codegraph @

js/src/tests/test262/built-ins/Promise/all/S25.4.4.1_A3.1_T2.js

raw
1 // |reftest| async
2 // Copyright 2014 Cubane Canada, Inc. All rights reserved.
3 // See LICENSE for details.
4
5 /*---
6 info: |
7 Promise.all expects an iterable argument;
8 fails if recieves an abrupt completion
9 ref 7.4.1 non-Object fails CheckIterable
10 ref 7.4.2 GetIterator throws TypeError if CheckIterable fails
11 es6id: S25.4.4.1_A3.1_T2
12 author: Sam Mikes
13 description: Promise.all(new Error()) returns Promise rejected with TypeError
14 flags: [async]
15 ---*/
16
17 Promise.all(new Error("abrupt")).then(function() {
18 throw new Test262Error('Promise unexpectedly resolved: Promise.all(abruptCompletion) should throw TypeError');
19 }, function(err) {
20 assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
21 }).then($DONE, $DONE);