tor-browser

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

reject-element-function-extensible.js (829B)


      1 // Copyright (C) 2019 Leo Balter, 2020 Rick Waldron. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-promise.any-reject-element-functions
      6 description: The [[Extensible]] slot of Promise.any Reject Element functions
      7 info: |
      8  17 ECMAScript Standard Built-in Objects:
      9    Unless specified otherwise, the [[Extensible]] internal slot
     10    of a built-in object initially has the value true.
     11 features: [Promise.any]
     12 ---*/
     13 
     14 var rejectElementFunction;
     15 var thenable = {
     16  then(_, reject) {
     17    rejectElementFunction = reject;
     18  }
     19 };
     20 
     21 function NotPromise(executor) {
     22  executor(function() {}, function() {});
     23 }
     24 NotPromise.resolve = function(v) {
     25  return v;
     26 };
     27 Promise.any.call(NotPromise, [thenable]);
     28 
     29 assert(Object.isExtensible(rejectElementFunction));
     30 
     31 reportCompare(0, 0);