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

Unified Diff: test/mjsunit/cross-realm-global-prototype.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: ppc code mess 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 side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/cross-realm-global-prototype.js
diff --git a/test/mjsunit/cross-realm-global-prototype.js b/test/mjsunit/cross-realm-global-prototype.js
new file mode 100644
index 0000000000000000000000000000000000000000..46e5a3a37fbc76472c072a3baeb8b51cc272e39e
--- /dev/null
+++ b/test/mjsunit/cross-realm-global-prototype.js
@@ -0,0 +1,22 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+// Make sure we don't accidentally leak information about other objects.
+
+var realm = Realm.create();
+var test = Realm.eval(realm,
+ "() => { return Realm.global(0) instanceof Object }");
+
+assertFalse(test());
+
+// Set the prototype of the current global object to the global object of the
+// other realm.
+__proto__ = Realm.eval(realm, "this");
+assertFalse(test());
+
+test();
+test();
+%OptimizeFunctionOnNextCall(test);
+assertEquals(false, test());

Powered by Google App Engine
This is Rietveld 408576698