OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 var r = Realm.create(); |
| 6 var f = Realm.eval(r, "function f() { return this }; f()"); |
| 7 |
| 8 // Cross-origin property access throws |
| 9 assertThrows(() => f.a, TypeError); |
| 10 assertThrows(() => { 'use strict'; f.a = 1 }, TypeError); |
| 11 |
| 12 // Same-origin property access doesn't throw |
| 13 Realm.makeSameOrigin(r); |
| 14 assertEquals(undefined, f.a); |
| 15 f.a = 1; |
| 16 assertEquals(1, f.a); |
OLD | NEW |