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

Unified Diff: test/mjsunit/debug-evaluate-modify-catch-block-scope.js

Issue 1500933002: [debugger] fix debug-evaluate wrt shadowed context var. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add TODO Created 5 years 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
Index: test/mjsunit/debug-evaluate-modify-catch-block-scope.js
diff --git a/test/mjsunit/regress/regress-crbug-119800.js b/test/mjsunit/debug-evaluate-modify-catch-block-scope.js
similarity index 52%
copy from test/mjsunit/regress/regress-crbug-119800.js
copy to test/mjsunit/debug-evaluate-modify-catch-block-scope.js
index 1641cac686ef8c56699ff5140b805f6e9b1abf07..63e30b7cf0e5e23d3f9047c68dcc32e361ccf2f9 100644
--- a/test/mjsunit/regress/regress-crbug-119800.js
+++ b/test/mjsunit/debug-evaluate-modify-catch-block-scope.js
@@ -4,34 +4,36 @@
// Flags: --expose-debug-as debug
-function f() {
- 1;
- 2;
- 3;
-}
+Debug = debug.Debug
-var Debug = debug.Debug;
var exception = null;
-var breaks = [];
-
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
- Debug.debuggerFlags().breakPointsActive.setValue(false);
- breaks.push(exec_state.frame().sourceLineText().trimLeft());
- exec_state.prepareStep(Debug.StepAction.StepIn, 1);
+ exec_state.frame(0).evaluate("bar()");
} catch (e) {
exception = e;
+ print(e + e.stack);
}
}
Debug.setListener(listener);
-Debug.setBreakPoint(f, 0, 0);
-f();
+(function() {
+ "use strict";
+ try {
+ throw 1;
+ } catch (e) {
+ let a = 1;
+ function bar() {
+ a = 2; // this has no effect, when called from debug-eval
+ e = 2; // this has no effect, when called from debug-eval.
+ }
+ debugger;
+ assertEquals(1, a);
+ assertEquals(1, e);
+ }
+})();
Debug.setListener(null);
-Debug.debuggerFlags().breakPointsActive.setValue(true);
-
assertNull(exception);
-assertEquals(breaks, ["1;", "2;", "3;", "}", "Debug.setListener(null);"]);

Powered by Google App Engine
This is Rietveld 408576698