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

Side by Side Diff: test/mjsunit/regress/regress-crbug-432493.js

Issue 751833003: Version 3.30.33.4 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@3.30
Patch Set: Created 6 years 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/version.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 2014 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 function f() {
8 var a = 1;
9 var b = 2;
10 return a + b;
11 }
12
13 var exception = null;
14 var break_count = 0;
15 var throw_count = 0;
16
17 function listener(event, exec_state, event_data, data) {
18 try {
19 if (event == Debug.DebugEvent.Break) {
20 break_count++;
21 // Disable all breakpoints from within the debug event callback.
22 Debug.debuggerFlags().breakPointsActive.setValue(false);
23 } else if (event = Debug.DebugEvent.Exception) {
24 throw_count++;
25 // Enable all breakpoints from within the debug event callback.
26 Debug.debuggerFlags().breakPointsActive.setValue(true);
27 }
28 } catch (e) {
29 exception = e;
30 }
31 }
32
33 Debug = debug.Debug;
34
35 Debug.setListener(listener);
36 Debug.setBreakOnException();
37 Debug.setBreakPoint(f, 2);
38
39 f();
40 f();
41
42 assertEquals(1, break_count);
43 assertEquals(0, throw_count);
44
45 // Trigger exception event.
46 try { throw 1; } catch (e) {}
47
48 f();
49 f();
50
51 Debug.setListener(null);
52 Debug.clearBreakOnException();
53 Debug.debuggerFlags().breakPointsActive.setValue(true);
54
55 assertEquals(2, break_count);
56 assertEquals(1, throw_count);
57 assertNull(exception);
OLDNEW
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698