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

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: test case 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/debug-evaluate-modify-catch-block-scope.js b/test/mjsunit/debug-evaluate-modify-catch-block-scope.js
new file mode 100644
index 0000000000000000000000000000000000000000..ac92bd96b77f3e47e9f24d7413aabfeb7d25c382
--- /dev/null
+++ b/test/mjsunit/debug-evaluate-modify-catch-block-scope.js
@@ -0,0 +1,38 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --expose-debug-as debug
+
+Debug = debug.Debug
+
+var exception = null;
+function listener(event, exec_state, event_data, data) {
+ if (event != Debug.DebugEvent.Break) return;
+ try {
+ exec_state.frame(0).evaluate("bar()");
+ } catch (e) {
+ exception = e;
+ print(e + e.stack);
+ }
+}
+
+Debug.setListener(listener);
+
+(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);

Powered by Google App Engine
This is Rietveld 408576698