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

Unified Diff: test/mjsunit/harmony/debug-evaluate-blockscopes.js

Issue 732543002: Implement 'setVariableValue' for debugger block scopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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/runtime-debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/debug-evaluate-blockscopes.js
diff --git a/test/mjsunit/harmony/debug-evaluate-blockscopes.js b/test/mjsunit/harmony/debug-evaluate-blockscopes.js
index 16885d009e8ef0f0c8ffaf84b01345fef5b324af..7fedf74308a4b9026b9540892ee172700b17dba3 100644
--- a/test/mjsunit/harmony/debug-evaluate-blockscopes.js
+++ b/test/mjsunit/harmony/debug-evaluate-blockscopes.js
@@ -67,3 +67,31 @@ assertEquals(1, result);
Debug.clearBreakPoint(bp);
// Get rid of the debug event listener.
Debug.setListener(null);
+
+
+function f1() {
+ {
+ let i = 1;
rossberg 2014/11/14 12:35:24 Considering stack allocated block variables being
Dmitry Lomov (no reviews) 2014/11/14 13:38:26 Done.
+ debugger;
+ assertEquals(2, i);
+ }
+}
+
+var exception;
+Debug.setListener(function (event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ var frame = exec_state.frame();
+ assertEquals(1, frame.evaluate("i").value());
+ var allScopes = frame.allScopes();
+ assertEquals(1, allScopes[0].scopeObject().value().i);
+ allScopes[0].setVariableValue('i', 2);
aandrey 2014/11/14 12:39:58 nit: ' or " (see 3 lines above)
Dmitry Lomov (no reviews) 2014/11/14 13:38:27 Done.
+ }
+ } catch (e) {
+ exception = e;
+ }
+});
+
+exception = null;
+f1();
+assertEquals(null, exception, exception);
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698