OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-proxies --harmony-reflect --allow-natives-syntax | 5 // Flags: --allow-natives-syntax |
6 | 6 |
7 // Do not read out the prototype from a cross-realm object. | 7 // Do not read out the prototype from a cross-realm object. |
8 var realm = Realm.create(); | 8 var realm = Realm.create(); |
9 | 9 |
10 __proto__ = {}; | 10 __proto__ = {}; |
11 assertEquals(null, | 11 assertEquals(null, |
12 Realm.eval(realm, "3; Reflect.getPrototypeOf(Realm.global(0))")); | 12 Realm.eval(realm, "3; Reflect.getPrototypeOf(Realm.global(0))")); |
13 assertFalse(Realm.eval(realm, "3; Realm.global(0) instanceof Object")); | 13 assertFalse(Realm.eval(realm, "3; Realm.global(0) instanceof Object")); |
14 | 14 |
15 __proto__ = new Proxy({}, { getPrototypeOf() { assertUnreachable() } }); | 15 __proto__ = new Proxy({}, { getPrototypeOf() { assertUnreachable() } }); |
(...skipping 28 matching lines...) Expand all Loading... |
44 // 2-level proxy indirection | 44 // 2-level proxy indirection |
45 __proto__ = {}; | 45 __proto__ = {}; |
46 __proto__ = new Proxy({}, | 46 __proto__ = new Proxy({}, |
47 new Proxy({}, { | 47 new Proxy({}, { |
48 get() { assertUnreachable() } | 48 get() { assertUnreachable() } |
49 }) | 49 }) |
50 ); | 50 ); |
51 assertEquals(null, | 51 assertEquals(null, |
52 Realm.eval(realm, "5; Reflect.getPrototypeOf(Realm.global(0))")); | 52 Realm.eval(realm, "5; Reflect.getPrototypeOf(Realm.global(0))")); |
53 assertFalse(Realm.eval(realm, "5; Realm.global(0) instanceof Object")); | 53 assertFalse(Realm.eval(realm, "5; Realm.global(0) instanceof Object")); |
OLD | NEW |