tor-browser

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

resolve-element-function-length.js (1009B)


      1 // Copyright (C) 2015 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 es6id: 25.4.4.1.2
      6 description: The `length` property of Promise.all Resolve Element functions
      7 info: |
      8  The length property of a Promise.all resolve element function is 1.
      9 
     10  17 ECMAScript Standard Built-in Objects:
     11    Unless otherwise specified, the length property of a built-in Function
     12    object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
     13    [[Configurable]]: true }.
     14 includes: [propertyHelper.js]
     15 ---*/
     16 
     17 var resolveElementFunction;
     18 var thenable = {
     19  then: function(fulfill) {
     20    resolveElementFunction = fulfill;
     21  }
     22 };
     23 
     24 function NotPromise(executor) {
     25  executor(function() {}, function() {});
     26 }
     27 NotPromise.resolve = function(v) {
     28  return v;
     29 };
     30 Promise.all.call(NotPromise, [thenable]);
     31 
     32 verifyProperty(resolveElementFunction, "length", {
     33  value: 1,
     34  writable: false,
     35  enumerable: false,
     36  configurable: true
     37 });
     38 
     39 reportCompare(0, 0);