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

Side by Side Diff: test/mjsunit/debug-negative-break-points.js

Issue 1610073002: [debugger] negative conditional break points mute breaks and exceptions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test Created 4 years, 11 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/debug/debug-scopes.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 // Flags: --expose-debug-as debug
6
7 var Debug = debug.Debug;
8 var break_count = 0;
9 var exception_count = 0;
10
11 function assertCount(expected_breaks, expected_exceptions) {
12 assertEquals(expected_breaks, break_count);
13 assertEquals(expected_exceptions, exception_count);
14 }
15
16 function listener(event, exec_state, event_data, data) {
17 if (event == Debug.DebugEvent.Break) {
18 break_count++;
19 } else if (event == Debug.DebugEvent.Exception) {
20 exception_count++;
21 }
22 }
23
24 function f(x) {
25 debugger;
26 return x + 1;
27 }
28
29 function g(x) {
30 try {
31 throw x;
32 } catch (e) {
33 }
34 }
35
36 Debug.setListener(listener);
37
38 assertCount(0, 0);
39 f(0);
40 assertCount(1, 0);
41 g(0);
42 assertCount(1, 0);
43
44 Debug.setBreakOnException();
45 f(0);
46 assertCount(2, 0);
47 g(0);
48 assertCount(2, 1);
49
50 Debug.setBreakPoint(f, 1, 0, "x == 1");
51 f(1);
52 assertCount(3, 1);
53 f(2);
54 assertCount(3, 1);
55 f(1);
56 assertCount(4, 1);
57
58 Debug.setBreakPoint(f, 1, 0, "x > 0");
59 f(1);
60 assertCount(5, 1);
61 f(0);
62 assertCount(5, 1);
63
64 Debug.setBreakPoint(g, 2, 0, "1 == 2");
65 g(1);
66 assertCount(5, 1);
67
68 Debug.setBreakPoint(g, 2, 0, "x == 1");
69 g(1);
70 assertCount(6, 2);
71 g(2);
72 assertCount(6, 2);
73 g(1);
74 assertCount(7, 3);
75
76 Debug.setBreakPoint(g, 2, 0, "x > 0");
77 g(1);
78 assertCount(8, 4);
79 g(0);
80 assertCount(8, 4);
81
82 Debug.clearBreakOnException();
83 Debug.setListener(null);
OLDNEW
« no previous file with comments | « src/debug/debug-scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698