Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/all/S25.4.4.1_A3.1_T2.js

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