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/es6/regress/regress-468661.js

Issue 2487673002: [debugger] Basic scope functionality and exception events in wrapper (Closed)
Patch Set: Formatting Created 4 years, 1 month 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
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: --expose-debug-as debug 5 // Flags: --expose-debug-as debug
6 6
7 Debug = debug.Debug 7 Debug = debug.Debug
8 var exception = null; 8 var exception = null;
9 var break_count = 0; 9 var break_count = 0;
10 const expected_breaks = 9;
10 11
11 var expected_values = 12 var expected_values =
12 [ReferenceError, undefined, 0, 0, 0, 0, 1, 13 [ReferenceError, undefined, 0, 0, 0, 0, 1,
13 ReferenceError, ReferenceError]; 14 ReferenceError, ReferenceError];
14 15
15 function listener(event, exec_state, event_data, data) { 16 function listener(event, exec_state, event_data, data) {
16 try { 17 try {
17 if (event == Debug.DebugEvent.Break) { 18 if (event == Debug.DebugEvent.Break) {
18 assertTrue(exec_state.frameCount() != 0, "FAIL: Empty stack trace"); 19 assertTrue(exec_state.frameCount() != 0, "FAIL: Empty stack trace");
19 // Count number of expected breakpoints in this source file.
20 if (!break_count) {
21 var source_text = exec_state.frame(0).func().script().source();
22 expected_breaks = source_text.match(/\/\/\s*Break\s+\d+\./g).length;
23 print("Expected breaks: " + expected_breaks);
24 }
25 var frameMirror = exec_state.frame(0); 20 var frameMirror = exec_state.frame(0);
26 21
27 var v = null;; 22 var v = null;;
28 try { 23 try {
29 v = frameMirror.evaluate('i').value(); 24 v = frameMirror.evaluate('i').value();
30 } catch(e) { 25 } catch(e) {
31 v = e; 26 v = e;
32 } 27 }
33 frameMirror.allScopes(); 28 frameMirror.allScopes();
34 var source = frameMirror.sourceLineText(); 29 var source = frameMirror.sourceLineText();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 i++) { // Break 5. 62 i++) { // Break 5.
68 let key = i; // Break 3. 63 let key = i; // Break 3.
69 sum += key; // Break 4. 64 sum += key; // Break 4.
70 } 65 }
71 }()); // Break 7. 66 }()); // Break 7.
72 67
73 assertNull(exception); // Break 8. 68 assertNull(exception); // Break 8.
74 assertEquals(expected_breaks, break_count); 69 assertEquals(expected_breaks, break_count);
75 70
76 Debug.setListener(null); 71 Debug.setListener(null);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/regress/regress-3280.js ('k') | test/mjsunit/harmony/async-debug-caught-exception.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698