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

Unified Diff: test/mjsunit/regress/regress-crbug-171715.js

Issue 13093003: Only copy with, block and catch scopes in DebugEvaluate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months 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 | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-171715.js
diff --git a/test/mjsunit/regress/regress-crbug-222893.js b/test/mjsunit/regress/regress-crbug-171715.js
similarity index 55%
copy from test/mjsunit/regress/regress-crbug-222893.js
copy to test/mjsunit/regress/regress-crbug-171715.js
index d5baa7b2579b9330231dc7e3329b42aa1a579a60..040c381e399385c556c4a2aa72fa4a78d2b85cde 100644
--- a/test/mjsunit/regress/regress-crbug-222893.js
+++ b/test/mjsunit/regress/regress-crbug-171715.js
@@ -30,13 +30,38 @@
Debug = debug.Debug
var error = null;
-var array = ["a", "b", "c"];
+var test = 0;
+
+function check_v(expected, exec_state, frame_id) {
+ assertEquals(expected, exec_state.frame(frame_id).evaluate('v').value());
+}
function listener(event, exec_state, event_data, data) {
try {
- if (event == Debug.DebugEvent.Break) {
- assertArrayEquals(array,
+ if (event != Debug.DebugEvent.Break) return;
+ test++;
+ if (test == 1) {
+ check_v('inner0', exec_state, 0);
+ check_v('inner0', exec_state, 1);
+ check_v('outer', exec_state, 2);
+ assertArrayEquals(["a", "b", "c"],
+ exec_state.frame(0).evaluate('arguments').value());
+ } else if (test == 2) {
+ check_v('inner1', exec_state, 0);
+ check_v('inner1', exec_state, 1);
+ check_v('outer', exec_state, 2);
+ assertArrayEquals(["a", "b", "c"],
exec_state.frame(0).evaluate('arguments').value());
+ } else {
+ assertEquals(3, test);
+ check_v('inner2', exec_state, 0);
+ check_v('inner1', exec_state, 1);
+ check_v('inner1', exec_state, 2);
+ check_v('outer', exec_state, 3);
+ assertArrayEquals(["x", "y", "z"],
+ exec_state.frame(0).evaluate('arguments').value());
+ assertArrayEquals(["a", "b", "c"],
+ exec_state.frame(1).evaluate('arguments').value());
}
} catch (e) {
error = e;
@@ -45,20 +70,18 @@ function listener(event, exec_state, event_data, data) {
Debug.setListener(listener);
-
-function f(a, b) {
- arguments;
- debugger; // Arguments object is already materialized.
-}
-
-f.apply(this, array);
-f("a", "b", "c");
+var v = 'outer';
+(function() { // Test 1 and 2
+ var v = 'inner0';
+ eval("debugger; var v = 'inner1'; debugger;");
+ assertEquals('inner1', v); // Overwritten by local eval.
+})("a", "b", "c");
assertNull(error);
-function g(a, b) {
- debugger; // Arguments object is not yet materialized.
-}
-g.apply(this, array);
-g("a", "b", "c");
+(function() { // Test 3
+ var v = 'inner0'; // Local eval overwrites this value.
+ eval("var v = 'inner1'; " +
+ "(function() { var v = 'inner2'; debugger; })('x', 'y', 'z');");
+ assertEquals('inner1', v); // Overwritten by local eval.
+})("a", "b", "c");
assertNull(error);
-
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698