throw-from-constructor.js (742B)
1 // |reftest| skip module -- source-phase-imports is not supported 2 // Copyright (C) 2024 Chengzhong Wu. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-%abstractmodulesource%25-constructor 6 description: The %AbstractModuleSource% constructor will throw an error when invoked 7 info: | 8 28.1.1.1 %AbstractModuleSource% ( ) 9 This function performs the following steps when called: 10 11 1. Throw a TypeError exception. 12 features: [source-phase-imports] 13 flags: [module] 14 ---*/ 15 16 assert.sameValue(typeof $262.AbstractModuleSource, 'function'); 17 assert.throws(TypeError, function() { 18 new $262.AbstractModuleSource(); 19 }, '%AbstractModuleSource%() should throw TypeError'); 20 21 reportCompare(0, 0);