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

Side by Side Diff: test/mjsunit/debug-exceptions.js

Issue 2146493002: Move catch prediction into frontend. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable test on Turbofan 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 | « src/isolate.h ('k') | test/mjsunit/mjsunit.status » ('j') | 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 // Flags: --expose-debug-as debug
6
7
8 Debug = debug.Debug
9
10 let error = false;
11 let uncaught;
12
13 function listener(event, exec_state, event_data, data) {
14 if (event != Debug.DebugEvent.Exception) return;
15 try {
16 uncaught = event_data.uncaught();
17 } catch (e) {
18 error = true;
19 }
20 }
21
22 Debug.setBreakOnException();
23 Debug.setListener(listener);
24
25
26 function assertCaught(f) {
27 try {f()} finally {
28 assertFalse(uncaught);
29 return;
30 }
31 }
32
33 function assertUncaught(f) {
34 try {f()} finally {
35 assertTrue(uncaught);
36 return;
37 }
38 }
39
40
41 assertUncaught(() => {
42 for (var a of [1, 2, 3]) {
43 throw a
44 }
45 });
46
47 assertUncaught(() => {
48 for (var a of [1, 2, 3]) {
49 try {throw a} finally {}
50 }
51 });
52
53 assertCaught(() => {
54 for (var a of [1, 2, 3]) {
55 try {
56 try {throw a} finally {}
57 } catch(_) {}
58 }
59 });
60
61 assertCaught(() => {
62 try {
63 for (var a of [1, 2, 3]) {
64 try {throw a} finally {}
65 }
66 } catch(_) {}
67 });
68
69
70 assertFalse(error);
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698