tor-browser

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

resolve-element-function-name.js (1298B)


      1 // Copyright (C) 2019 Leo Balter. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-promise.allsettled-resolve-element-functions
      6 description: The `name` property of Promise.allSettled Resolve Element functions
      7 info: |
      8  A promise resolve function is an anonymous built-in function.
      9 
     10  17 ECMAScript Standard Built-in Objects:
     11    Every built-in function object, including constructors, has a `name`
     12    property whose value is a String. Functions that are identified as
     13    anonymous functions use the empty string as the value of the `name`
     14    property.
     15    Unless otherwise specified, the `name` property of a built-in function
     16    object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*,
     17    [[Configurable]]: *true* }.
     18 includes: [propertyHelper.js]
     19 features: [Promise.allSettled]
     20 ---*/
     21 
     22 var resolveElementFunction;
     23 var thenable = {
     24  then(fulfill) {
     25    resolveElementFunction = fulfill;
     26  }
     27 };
     28 
     29 function NotPromise(executor) {
     30  executor(function() {}, function() {});
     31 }
     32 NotPromise.resolve = function(v) {
     33  return v;
     34 };
     35 Promise.allSettled.call(NotPromise, [thenable]);
     36 
     37 verifyProperty(resolveElementFunction, "name", {
     38  value: "", writable: false, enumerable: false, configurable: true
     39 });
     40 
     41 reportCompare(0, 0);