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

Side by Side Diff: test/mjsunit/realm-property-access.js

Issue 1973363004: Expose a way to make a "same-origin" realm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add a test Created 4 years, 7 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
« src/d8.h ('K') | « src/d8.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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);
OLDNEW
« src/d8.h ('K') | « src/d8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698