2014-10-23 19:58:31 +02:00
|
|
|
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
|
|
|
|
// See LICENSE for details.
|
2014-07-17 19:49:35 +02:00
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: Promise.all([]) is resolved immediately
|
2015-02-10 22:01:39 +01:00
|
|
|
es6id: 25.4.4.1_A2.2_T1
|
2014-07-22 01:09:02 +02:00
|
|
|
author: Sam Mikes
|
2017-06-23 17:06:32 +02:00
|
|
|
includes: [promiseHelper.js]
|
2015-02-10 22:01:39 +01:00
|
|
|
description: Promise.all([]) returns immediately
|
2016-02-12 18:59:51 +01:00
|
|
|
flags: [async]
|
2014-07-22 01:09:02 +02:00
|
|
|
---*/
|
2014-07-17 19:49:35 +02:00
|
|
|
|
|
|
|
var sequence = [];
|
|
|
|
|
2018-02-15 21:11:21 +01:00
|
|
|
Promise.all([]).then(function() {
|
|
|
|
sequence.push(2);
|
2014-07-17 19:49:35 +02:00
|
|
|
}).catch($DONE);
|
|
|
|
|
|
|
|
Promise.resolve().then(function() {
|
2018-02-15 21:11:21 +01:00
|
|
|
sequence.push(3);
|
|
|
|
}).then(function() {
|
|
|
|
sequence.push(4);
|
2020-06-24 21:18:35 +02:00
|
|
|
assert.sameValue(sequence.length, 4);
|
2018-02-15 21:11:21 +01:00
|
|
|
checkSequence(sequence, "Promises resolved in unexpected sequence");
|
2014-10-23 19:58:31 +02:00
|
|
|
}).then($DONE, $DONE);
|
|
|
|
|
|
|
|
sequence.push(1);
|