Index: test/mjsunit/debug-step-into-valueof.js |
diff --git a/test/mjsunit/debug-stepin-construct-call.js b/test/mjsunit/debug-step-into-valueof.js |
similarity index 54% |
copy from test/mjsunit/debug-stepin-construct-call.js |
copy to test/mjsunit/debug-step-into-valueof.js |
index 5e2145591fdb0bf6789fbc097ea7d5cb1ca5261e..aff499b3bebacfb4204ffac3d153b764873565cc 100644 |
--- a/test/mjsunit/debug-stepin-construct-call.js |
+++ b/test/mjsunit/debug-step-into-valueof.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 valueOfCallback() { |
+ return 2; // Break 2. |
+} // Break 3. |
+var o = {}; |
+o.valueOf = valueOfCallback; |
-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 = 1 + o; // Break 1. |
+Debug.setListener(null); // Break 4. |
-assertEquals(6, break_count); |
+assertEquals(3, result); |
assertNull(exception); |