tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

resolved-immed.js (666B)


      1 // |reftest| async
      2 // Copyright (C) 2019 Leo Balter. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-promise.allsettled
      7 description: Promise.allSettled([]) returns immediately
      8 includes: [promiseHelper.js]
      9 flags: [async]
     10 features: [Promise.allSettled]
     11 ---*/
     12 
     13 var sequence = [];
     14 
     15 Promise.allSettled([]).then(function() {
     16  sequence.push(2);
     17 }).catch($DONE);
     18 
     19 Promise.resolve().then(function() {
     20  sequence.push(3);
     21 }).then(function() {
     22  sequence.push(4);
     23  assert.sameValue(sequence.length, 4);
     24 checkSequence(sequence, 'Promises resolved in unexpected sequence');
     25 }).then($DONE, $DONE);
     26 
     27 sequence.push(1);