newtarget-proto.js (1574B)
1 // |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) -- explicit-resource-management is not enabled unconditionally, requires shell-options 2 // Copyright (C) 2023 Ron Buckton. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-suppressederror-constructor 7 description: > 8 Default prototype is the %SuppressedError.prototype%" 9 info: | 10 SuppressedError ( error, suppressed, message ) 11 12 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget. 13 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%SuppressedError.prototype%", « [[ErrorData]], [[AggregateErrors]] »). 14 ... 15 6. Return O. 16 17 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] ) 18 19 ... 20 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto). 21 3. Return ObjectCreate(proto, internalSlotsList). 22 23 GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto ) 24 25 ... 26 3. Let proto be ? Get(constructor, "prototype"). 27 4. If Type(proto) is not Object, then 28 a. Let realm be ? GetFunctionRealm(constructor). 29 b. Set proto to realm's intrinsic object named intrinsicDefaultProto. 30 Return proto. 31 features: [explicit-resource-management] 32 ---*/ 33 34 var obj = new SuppressedError(); 35 36 assert.sameValue(Object.getPrototypeOf(obj), SuppressedError.prototype); 37 38 reportCompare(0, 0);