Index: test/mjsunit/regress/regress-325676.js |
diff --git a/test/mjsunit/regress/regress-crbug-222893.js b/test/mjsunit/regress/regress-325676.js |
similarity index 71% |
copy from test/mjsunit/regress/regress-crbug-222893.js |
copy to test/mjsunit/regress/regress-325676.js |
index 39363bc91251d9b7c06eae0ab41bf674b9151ca4..427bbc38dcb3d909b3bfb1dc3a6008cec63cf9ab 100644 |
--- a/test/mjsunit/regress/regress-crbug-222893.js |
+++ b/test/mjsunit/regress/regress-325676.js |
@@ -27,37 +27,43 @@ |
// Flags: --expose-debug-as debug |
-Debug = debug.Debug |
+// If a function parameter is forced to be context allocated, |
+// debug evaluate need to resolve it to a context slot instead of |
+// parameter slot on the stack. |
-var error = null; |
-var array = ["a", "b", "c"]; |
+var Debug = debug.Debug; |
+ |
+var expected; |
+var exception = null; |
function listener(event, exec_state, event_data, data) { |
+ if (event != Debug.DebugEvent.Break) return; |
try { |
- if (event == Debug.DebugEvent.Break) { |
- assertArrayEquals(array, |
- exec_state.frame(0).evaluate('arguments').value()); |
- } |
+ assertEquals(expected, exec_state.frame(0).evaluate('arg').value()); |
+ exec_state.frame(0).evaluate('arg = "evaluated";'); |
} catch (e) { |
- error = e; |
+ exception = e; |
} |
-}; |
+} |
Debug.setListener(listener); |
+function f(arg) { |
+ expected = arg; |
+ debugger; |
+ assertEquals("evaluated", arg); |
-function f(a, b) { |
- arguments; |
- debugger; // Arguments object is already materialized. |
+ arg = "value"; |
+ expected = arg; |
+ debugger; |
+ assertEquals("evaluated", arg); |
+ |
+ // Forces arg to be context allocated even though a parameter. |
+ function g() { arg; } |
} |
-f.apply(this, array); |
-f("a", "b", "c"); |
-assertNull(error); |
+f(); |
+f(1); |
+f(1, 2); |
-function g(a, b) { |
- debugger; // Arguments object is not yet materialized. |
-} |
-g.apply(this, array); |
-g("a", "b", "c"); |
-assertNull(error); |
+assertNull(exception); |