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); |