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

Side by Side Diff: test/mjsunit/regress/regress-3960.js

Issue 1136733002: Don't create debug context if debug listener is not set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed review comment Created 5 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
« no previous file with comments | « test/cctest/test-debug.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
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 // Test that setting break point is works correctly when the debugger is 7 // Test that setting break point works correctly when the debugger is
8 // activated late, which leads to duplicate shared function infos. 8 // activated late, which leads to duplicate shared function infos.
9 9
10 (function() { 10 (function() {
11 var Debug = %GetDebugContext().Debug; 11 var Debug = %GetDebugContext().Debug;
12 12
13 function listener(event, exec_state, event_data, data) { 13 function listener(event, exec_state, event_data, data) {
14 if (event != Debug.DebugEvent.Break) return; 14 if (event != Debug.DebugEvent.Break) return;
15 try { 15 try {
16 assertTrue(/foo/.test(exec_state.frame(0).sourceLineText())); 16 assertTrue(/foo/.test(exec_state.frame(0).sourceLineText()));
17 break_count++; 17 break_count++;
18 } catch (e) { 18 } catch (e) {
19 exception = e; 19 exception = e;
20 } 20 }
21 } 21 }
22 22
23 for (var i = 0; i < 3; i++) { 23 for (var i = 0; i < 3; i++) {
24 var foo = function() { a = 1; } 24 var foo = function() { a = 1; }
25 var exception = null; 25 var exception = null;
26 var break_count = 0; 26 var break_count = 0;
27 Debug.setListener(listener); 27 Debug.setListener(listener);
28 if (i < 2) Debug.setBreakPoint(foo, 0, 0); 28 if (i < 2) Debug.setBreakPoint(foo, 0, 0);
29 assertTrue(/\[B\d\]a = 1/.test(Debug.showBreakPoints(foo))); 29 assertTrue(/\[B\d\]a = 1/.test(Debug.showBreakPoints(foo)));
30 foo(); 30 foo();
31 assertEquals(1, break_count); 31 assertEquals(1, break_count);
32 assertNull(exception); 32 assertNull(exception);
33 } 33 }
34 34
35 Debug.setListener(null); 35 Debug.setListener(null);
36 })(); 36 })();
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698