blob: 46e5a3a37fbc76472c072a3baeb8b51cc272e39e [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// 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: --allow-natives-syntax
6// Make sure we don't accidentally leak information about other objects.
7
8var realm = Realm.create();
9var test = Realm.eval(realm,
10 "() => { return Realm.global(0) instanceof Object }");
11
12assertFalse(test());
13
14// Set the prototype of the current global object to the global object of the
15// other realm.
16__proto__ = Realm.eval(realm, "this");
17assertFalse(test());
18
19test();
20test();
21%OptimizeFunctionOnNextCall(test);
22assertEquals(false, test());