Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 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: --allow-natives-syntax |
| 6 | // Make sure we don't accidentally leak information about other objects. |
| 7 | |
| 8 | var realm = Realm.create(); |
| 9 | var test = Realm.eval(realm, |
| 10 | "() => { return Realm.global(0) instanceof Object }"); |
| 11 | |
| 12 | assertFalse(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"); |
| 17 | assertFalse(test()); |
| 18 | |
| 19 | test(); |
| 20 | test(); |
| 21 | %OptimizeFunctionOnNextCall(test); |
| 22 | assertEquals(false, test()); |