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

Side by Side 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: Patch for landing 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Add the debug event listener. 60 // Add the debug event listener.
61 Debug.setListener(listener); 61 Debug.setListener(listener);
62 result = -1; 62 result = -1;
63 f(); 63 f();
64 assertEquals(1, result); 64 assertEquals(1, result);
65 65
66 // Clear breakpoint. 66 // Clear breakpoint.
67 Debug.clearBreakPoint(bp); 67 Debug.clearBreakPoint(bp);
68 // Get rid of the debug event listener. 68 // Get rid of the debug event listener.
69 Debug.setListener(null); 69 Debug.setListener(null);
70
71
72 function f1() {
73 {
74 let i = 1;
75 debugger;
76 assertEquals(2, i);
77 }
78 }
79
80 function f2() {
81 {
82 let i = 1;
83 debugger;
84 assertEquals(2, i);
85 return function() { return i++; }
86 }
87 }
88
89 var exception;
90 Debug.setListener(function (event, exec_state, event_data, data) {
91 try {
92 if (event == Debug.DebugEvent.Break) {
93 var frame = exec_state.frame();
94 assertEquals(1, frame.evaluate("i").value());
95 var allScopes = frame.allScopes();
96 assertEquals(1, allScopes[0].scopeObject().value().i);
97 allScopes[0].setVariableValue("i", 2);
98 }
99 } catch (e) {
100 exception = e;
101 }
102 });
103
104 exception = null;
105 f1();
106 assertEquals(null, exception, exception);
107 exception = null;
108 f2();
109 assertEquals(null, exception, exception);
OLDNEW
« 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