Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/all/S25.4.4.1_A6.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 with 0-element array
7 should accept an empty array
8 es6id: S25.4.4.1_A6.1_T2
9 author: Sam Mikes
10 description: Promise.all([]) returns a promise for an empty array
11 flags: [async]
12 ---*/
13
14 var p = Promise.all([]);
15
16 p.then(function(result) {
17 if (!(result instanceof Array)) {
18 $ERROR("Expected Promise.all([]) to be Array, actually " + result);
19 }
20 if (result.length !== 0) {
21 $ERROR("Expected Promise.all([]) to be empty Array, actually " + result);
22 }
23 }).then($DONE, $DONE);