resolve-element-function-length.js (1085B)
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 `length` property of Promise.allSettled Resolve Element functions 7 info: | 8 The length property of a Promise.allSettled 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 features: [Promise.allSettled] 16 ---*/ 17 18 var resolveElementFunction; 19 var thenable = { 20 then(fulfill) { 21 resolveElementFunction = fulfill; 22 } 23 }; 24 25 function NotPromise(executor) { 26 executor(function() {}, function() {}); 27 } 28 NotPromise.resolve = function(v) { 29 return v; 30 }; 31 Promise.allSettled.call(NotPromise, [thenable]); 32 33 verifyProperty(resolveElementFunction, 'length', { 34 value: 1, 35 enumerable: false, 36 writable: false, 37 configurable: true, 38 }); 39 40 reportCompare(0, 0);