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

Side by Side Diff: test/mjsunit/debug-stepin-foreach.js

Issue 739523002: Allow stepping into Object.observe handlers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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
« no previous file with comments | « src/runtime/runtime-observe.cc ('k') | test/mjsunit/es6/debug-stepin-microtasks.js » ('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 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 // Tests stepping into through Array.prototype.forEach callbacks.
7
8 Debug = debug.Debug
9 var exception = null;
10 var break_count = 0;
11 var expected_breaks = -1;
12
13 function listener(event, exec_state, event_data, data) {
14 try {
15 if (event == Debug.DebugEvent.Break) {
16 assertTrue(exec_state.frameCount() != 0, "FAIL: Empty stack trace");
17 if (!break_count) {
18 // Count number of expected breakpoints in this source file.
19 var source_text = exec_state.frame(0).func().script().source();
20 expected_breaks = source_text.match(/\/\/\s*Break\s+\d+\./g).length;
21 print("Expected breaks: " + expected_breaks);
22 }
23 var source = exec_state.frame(0).sourceLineText();
24 print("paused at: " + source);
25 assertTrue(source.indexOf("// Break " + break_count + ".") > 0,
26 "Unexpected pause at: " + source + "\n" +
27 "Expected: // Break " + break_count + ".");
28 ++break_count;
29 if (break_count !== expected_breaks) {
30 exec_state.prepareStep(Debug.StepAction.StepIn, 1);
31 }
32 }
33 } catch(e) {
34 exception = e;
35 print(e, e.stack);
36 }
37 };
38
39 Debug.setListener(listener);
40
41 debugger; // Break 0.
42 [1,2].forEach(callback); // Break 1.
43
44 function callback(x) {
45 return x; // Break 2. // Break 4.
46 } // Break 3. // Break 5.
47
48 assertNull(exception); // Break 6.
49 assertEquals(expected_breaks, break_count);
50
51 Debug.setListener(null);
OLDNEW
« no previous file with comments | « src/runtime/runtime-observe.cc ('k') | test/mjsunit/es6/debug-stepin-microtasks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698