not-a-constructor.js (698B)
1 // Copyright (C) 2022 Igalia, S.L. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-array.fromasync 6 description: Array.fromAsync is not a constructor 7 info: | 8 Built-in function objects that are not identified as constructors do not 9 implement the [[Construct]] internal method unless otherwise specified in the 10 description of a particular function. 11 includes: [isConstructor.js] 12 features: [Array.fromAsync, Reflect.construct] 13 ---*/ 14 15 assert(!isConstructor(Array.fromAsync), "Array.fromAsync is not a constructor"); 16 17 assert.throws(TypeError, () => new Array.fromAsync(), "Array.fromAsync throws when constructed"); 18 19 reportCompare(0, 0);