Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/construct/trap-is-undefined-proto-from-ctor-realm.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget
5 es6id: 9.5.14
6 description: >
7 If trap is undefined, propagate the construct to the target object,
8 honoring the Realm of the newTarget value
9 info: |
10 [[Construct]] ( argumentsList, newTarget)
11
12 7. If trap is undefined, then
13 b. Return Construct(target, argumentsList, newTarget).
14
15 9.1.14 GetPrototypeFromConstructor
16
17 [...]
18 3. Let proto be ? Get(constructor, "prototype").
19 4. If Type(proto) is not Object, then
20 a. Let realm be ? GetFunctionRealm(constructor).
21 b. Let proto be realm's intrinsic object named intrinsicDefaultProto.
22 [...]
23 features: [cross-realm, Reflect.construct]
24 ---*/
25
26 var other = $262.createRealm().global;
27 var C = new other.Function();
28
29 var P = new Proxy(function() {}, {});
30
31 var p = Reflect.construct(P, [], C);
32
33 assert.sameValue(Object.getPrototypeOf(Object.getPrototypeOf(p)), other.Object.prototype);