tor-browser

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

resolve-non-thenable.js (686B)


      1 // |reftest| async
      2 // Copyright (C) 2020 Rick Waldron. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 /*---
      5 description: Resolving with a non-thenable object value
      6 esid: sec-promise.any
      7 info: |
      8  PerformPromiseAny
      9 
     10  Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.
     11  Perform ? Invoke(nextPromise, "then", « resultCapability.[[Resolve]], rejectElement »).
     12 
     13 flags: [async]
     14 features: [Promise.any]
     15 ---*/
     16 
     17 const a = {};
     18 const b = {};
     19 const c = {};
     20 
     21 Promise.any([a, b, c])
     22  .then((value) => {
     23    assert.sameValue(value, a);
     24  }, () => {
     25    $DONE('The promise should not be rejected.');
     26  }).then($DONE, $DONE);