Debian Codegraph @

js/src/tests/test262/built-ins/NativeErrors/AggregateError/newtarget-proto.js

raw
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-aggregate-error
6 description: >
7 Default prototype is the %AggregateError.prototype%"
8 info: |
9 AggregateError ( errors, message )
10
11 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
12 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%AggregateError.prototype%", « [[ErrorData]], [[AggregateErrors]] »).
13 ...
14 6. Return O.
15
16 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] )
17
18 ...
19 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto).
20 3. Return ObjectCreate(proto, internalSlotsList).
21
22 GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )
23
24 ...
25 3. Let proto be ? Get(constructor, "prototype").
26 4. If Type(proto) is not Object, then
27 a. Let realm be ? GetFunctionRealm(constructor).
28 b. Set proto to realm's intrinsic object named intrinsicDefaultProto.
29 Return proto.
30 features: [AggregateError]
31 ---*/
32
33 var obj = new AggregateError([]);
34
35 assert.sameValue(Object.getPrototypeOf(obj), AggregateError.prototype);
36
37 reportCompare(0, 0);