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

Side by Side Diff: test/mjsunit/cross-realm-global-prototype.js

Issue 2034083002: Don't compile functions in a context the caller doesn't have access to (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 6 months 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
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: --allow-natives-syntax 5 // Flags: --allow-natives-syntax --restricted-realms
6 // Make sure we don't accidentally leak information about other objects. 6 // Make sure we don't accidentally leak information about other objects.
7 7
8 var realm = Realm.create(); 8 var realm = Realm.create();
9 var test = Realm.eval(realm, 9 var test = Realm.eval(realm,
10 "() => { return Realm.global(0) instanceof Object }"); 10 "() => { return Realm.global(0) instanceof Object }");
11 11
12 assertFalse(test()); 12 assertFalse(test());
13 13
14 // Set the prototype of the current global object to the global object of the 14 // Set the prototype of the current global object to the global object of the
15 // other realm. 15 // other realm.
16 __proto__ = Realm.eval(realm, "this"); 16 __proto__ = Realm.eval(realm, "this");
17 assertFalse(test()); 17 assertFalse(test());
18 18
19 test(); 19 test();
20 test(); 20 test();
21 %OptimizeFunctionOnNextCall(test); 21 %OptimizeFunctionOnNextCall(test);
22 assertEquals(false, test()); 22 assertEquals(false, test());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698