tor-browser

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

resolves-empty-array.js (937B)


      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 a Promise for an empty array
      8 info: |
      9  Runtime Semantics: PerformPromiseAllSettled ( iteratorRecord, constructor, resultCapability )
     10 
     11  4. Let remainingElementsCount be a new Record { [[Value]]: 1 }.
     12  ...
     13  6.d ...
     14    ii. Set remainingElementsCount.[[value]] to remainingElementsCount.[[value]] − 1.
     15    iii. If remainingElementsCount.[[value]] is 0, then
     16      1. Let valuesArray be CreateArrayFromList(values).
     17      2. Perform ? Call(resultCapability.[[Resolve]], undefined, « valuesArray »).
     18  ...
     19 flags: [async]
     20 includes: [promiseHelper.js]
     21 features: [Promise.allSettled]
     22 ---*/
     23 
     24 var arg = [];
     25 
     26 Promise.allSettled(arg).then(function(result) {
     27  checkSettledPromises(result, []);
     28 }).then($DONE, $DONE);