constructor.js (700B)
1 // |reftest| shell-option(--enable-shadow-realms) skip-if(!xulRuntime.shell) -- requires shell-options 2 // Copyright (C) 2021 Rick Waldron. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-shadowrealm-constructor 6 description: > 7 ShadowRealm is a constructor and has [[Construct]] internal method. 8 includes: [isConstructor.js] 9 features: [ShadowRealm, Reflect.construct] 10 ---*/ 11 assert.sameValue( 12 typeof ShadowRealm, 13 'function', 14 'This test must fail if ShadowRealm is not a function' 15 ); 16 17 assert(isConstructor(ShadowRealm)); 18 assert.sameValue(Object.getPrototypeOf(ShadowRealm), Function.prototype); 19 new ShadowRealm(); 20 21 reportCompare(0, 0);