reject-element-function-extensible.js (838B)
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-reject-element-functions 6 description: The [[Extensible]] slot of Promise.allSettled 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.allSettled] 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.allSettled.call(NotPromise, [thenable]); 28 29 assert(Object.isExtensible(rejectElementFunction)); 30 31 reportCompare(0, 0);