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

Side by Side Diff: test/mjsunit/cross-realm-filtering.js

Issue 2142933003: Move Error methods to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle exception in GetProperty Created 4 years, 5 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
« no previous file with comments | « test/cctest/test-thread-termination.cc ('k') | test/mjsunit/debug-function-scopes.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var realms = [Realm.current(), Realm.create()]; 5 var realms = [Realm.current(), Realm.create()];
6 6
7 // Check stack trace filtering across security contexts. 7 // Check stack trace filtering across security contexts.
8 var thrower_script = 8 var thrower_script =
9 "(function () { Realm.eval(Realm.current(), 'throw Error()') })"; 9 "(function () { Realm.eval(Realm.current(), 'throw Error()') })";
10 Realm.shared = { 10 Realm.shared = {
(...skipping 15 matching lines...) Expand all
26 } \ 26 } \
27 "; 27 ";
28 28
29 function assertNotIn(thrower, error) { 29 function assertNotIn(thrower, error) {
30 for (var i = 0; i < error.length; i++) { 30 for (var i = 0; i < error.length; i++) {
31 assertFalse(false === error[i].getFunction()); 31 assertFalse(false === error[i].getFunction());
32 } 32 }
33 } 33 }
34 34
35 Realm.eval(realms[1], script); 35 Realm.eval(realms[1], script);
36 assertSame(3, Realm.shared.error_0.length); 36 assertSame(2, Realm.shared.error_0.length);
37 assertSame(4, Realm.shared.error_1.length); 37 assertSame(3, Realm.shared.error_1.length);
38 38
39 assertTrue(Realm.shared.thrower_1 === Realm.shared.error_1[2].getFunction()); 39 assertTrue(Realm.shared.thrower_1 === Realm.shared.error_1[1].getFunction());
40 assertNotIn(Realm.shared.thrower_0, Realm.shared.error_0); 40 assertNotIn(Realm.shared.thrower_0, Realm.shared.error_0);
41 assertNotIn(Realm.shared.thrower_0, Realm.shared.error_1); 41 assertNotIn(Realm.shared.thrower_0, Realm.shared.error_1);
42 42
43 Realm.eval(realms[0], script); 43 Realm.eval(realms[0], script);
44 assertSame(5, Realm.shared.error_0.length); 44 assertSame(4, Realm.shared.error_0.length);
45 assertSame(4, Realm.shared.error_1.length); 45 assertSame(3, Realm.shared.error_1.length);
46 46
47 assertTrue(Realm.shared.thrower_0 === Realm.shared.error_0[2].getFunction()); 47 assertTrue(Realm.shared.thrower_0 === Realm.shared.error_0[1].getFunction());
48 assertNotIn(Realm.shared.thrower_1, Realm.shared.error_0); 48 assertNotIn(Realm.shared.thrower_1, Realm.shared.error_0);
49 assertNotIn(Realm.shared.thrower_1, Realm.shared.error_1); 49 assertNotIn(Realm.shared.thrower_1, Realm.shared.error_1);
50 50
51 51
52 // Check .caller filtering across security contexts. 52 // Check .caller filtering across security contexts.
53 var caller_script = "(function (f) { f(); })"; 53 var caller_script = "(function (f) { f(); })";
54 Realm.shared = { 54 Realm.shared = {
55 caller_0 : Realm.eval(realms[0], caller_script), 55 caller_0 : Realm.eval(realms[0], caller_script),
56 caller_1 : Realm.eval(realms[1], caller_script), 56 caller_1 : Realm.eval(realms[1], caller_script),
57 } 57 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 assertSame(1, Realm.shared.direct_1()); 155 assertSame(1, Realm.shared.direct_1());
156 assertSame(1, Realm.shared.indirect_1()); 156 assertSame(1, Realm.shared.indirect_1());
157 assertSame(1, Realm.shared.apply_1()); 157 assertSame(1, Realm.shared.apply_1());
158 assertSame(1, Realm.shared.bind_1()); 158 assertSame(1, Realm.shared.bind_1());
159 assertSame(1, Realm.shared.call_1()); 159 assertSame(1, Realm.shared.call_1());
160 assertSame(1, Realm.shared.proxy_1()); 160 assertSame(1, Realm.shared.proxy_1());
161 assertSame(1, Realm.shared.reflect_1()); 161 assertSame(1, Realm.shared.reflect_1());
162 assertSame(1, Realm.shared.a_1()); 162 assertSame(1, Realm.shared.a_1());
163 assertSame(1, Realm.shared.b_1()); 163 assertSame(1, Realm.shared.b_1());
164 assertSame(1, Realm.shared.c_1()); 164 assertSame(1, Realm.shared.c_1());
OLDNEW
« no previous file with comments | « test/cctest/test-thread-termination.cc ('k') | test/mjsunit/debug-function-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698