Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: test/mjsunit/harmony/proxies-cross-realm-exception.js

Issue 1521953002: [proxies] fix access issue when having proxies on the prototype-chain of global objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: better comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --harmony-proxies --harmony-reflect --allow-natives-syntax
6
7 // Do not read out the prototype from a cross-realm object.
8 var realm = Realm.create();
9
10 __proto__ = new Proxy({}, { getPrototypeOf() { assertUnreachable() } });
11 assertEquals(null,
12 Realm.eval(realm, "1; Reflect.getPrototypeOf(Realm.global(0))"));
13
14 assertFalse(Realm.eval(realm, "1; Realm.global(0) instanceof Object"));
15 var test = Realm.eval(realm, "()=>{1.1; return Realm.global(0) instanceof Object ; }");
16 test();
17 test();
18 test();
19 %OptimizeFunctionOnNextCall(test);
20 test();
21
22 __proto__ = new Proxy({}, { get(t, p, r) { print(p); assertUnreachable() } });
23 assertEquals(null,
24 Realm.eval(realm, "2; Reflect.getPrototypeOf(Realm.global(0))"));
25 assertFalse(Realm.eval(realm, "2; Realm.global(0) instanceof Object"));
26
27 __proto__ = {};
28 assertEquals(null,
29 Realm.eval(realm, "3; Reflect.getPrototypeOf(Realm.global(0))"));
30 assertFalse(Realm.eval(realm, "3; Realm.global(0) instanceof Object"));
31
32 __proto__.__proto__ = new Proxy({}, {
33 getPrototypeOf() { assertUnreachable() }
34 });
35 assertEquals(null,
36 Realm.eval(realm, "4; Reflect.getPrototypeOf(Realm.global(0))"));
37 assertFalse(Realm.eval(realm, "4; Realm.global(0) instanceof Object"));
38
39 // 2-level proxy indirection
40 __proto__ = new Proxy({},
41 new Proxy({}, {
42 get() { assertUnreachable() }
43 })
44 );
45 assertEquals(null,
46 Realm.eval(realm, "5; Reflect.getPrototypeOf(Realm.global(0))"));
47 assertFalse(Realm.eval(realm, "5; Realm.global(0) instanceof Object"));
OLDNEW
« src/crankshaft/ia32/lithium-codegen-ia32.cc ('K') | « src/x87/code-stubs-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698