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

Unified Diff: test/mjsunit/debug-step-into-json.js

Issue 1463803002: [debugger] flood function for stepping before calling it. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/mjsunit/debug-step-into-valueof.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-step-into-json.js
diff --git a/test/mjsunit/debug-stepin-construct-call.js b/test/mjsunit/debug-step-into-json.js
similarity index 52%
copy from test/mjsunit/debug-stepin-construct-call.js
copy to test/mjsunit/debug-step-into-json.js
index 5e2145591fdb0bf6789fbc097ea7d5cb1ca5261e..b19850b6dbea5482011a181fbbd51454b203a3ae 100644
--- a/test/mjsunit/debug-stepin-construct-call.js
+++ b/test/mjsunit/debug-step-into-json.js
@@ -4,39 +4,32 @@
// Flags: --expose-debug-as debug
-var break_count = 0;
+Debug = debug.Debug
+
var exception = null;
+var break_count = 0;
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
- var source_line = exec_state.frame(0).sourceLineText();
- print(source_line);
+ print(event_data.sourceLineText());
+ assertTrue(event_data.sourceLineText().indexOf(`Break ${break_count++}.`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn, 1);
- break_count++;
} catch (e) {
exception = e;
}
-}
-
-var Debug = debug.Debug;
-Debug.setListener(listener);
+};
+function toJsonCallback() {
+ return "x"; // Break 2.
+} // Break 3.
+var o = {};
+o.toJSON = toJsonCallback;
-function f() {
- this.x = 1;
-}
-
-function g() {
- new f();
-}
-
-Debug.setBreakPoint(g, 6, Debug.BreakPositionAlignment.BreakPosition);
-print(Debug.showBreakPoints(g, undefined,
- Debug.BreakPositionAlignment.BreakPosition));
-
-g();
-Debug.setListener(null);
+Debug.setListener(listener);
+debugger; // Break 0.
+var result = JSON.stringify(o); // Break 1.
+Debug.setListener(null); // Break 4.
-assertEquals(6, break_count);
+assertEquals('"x"', result);
assertNull(exception);
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/mjsunit/debug-step-into-valueof.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698