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

Unified Diff: src/mirror-debugger.js

Issue 17636007: Allow debugger evaluate expressions to mute local variables (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: follow code review Created 7 years, 6 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 | « no previous file | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index e1fd872f3b980f0224bb3b1741989ea3dcea2718..6e2281d6511c61662479b8bf6aded60a5be9d769 100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -1671,13 +1671,30 @@ FrameMirror.prototype.scope = function(index) {
FrameMirror.prototype.evaluate = function(source, disable_break,
opt_context_object) {
- var result = %DebugEvaluate(this.break_id_,
- this.details_.frameId(),
- this.details_.inlinedFrameIndex(),
- source,
- Boolean(disable_break),
- opt_context_object);
- return MakeMirror(result);
+ var result_array = %DebugEvaluate(this.break_id_,
+ this.details_.frameId(),
+ this.details_.inlinedFrameIndex(),
+ source,
+ Boolean(disable_break),
+ opt_context_object);
+ // Silently ignore local variables changes if the frame is optimized.
+ if (!this.isOptimizedFrame()) {
+ var local_scope_before = result_array[1];
+ var local_scope_after = result_array[2];
+ for (var n in local_scope_after) {
+ var value_before = local_scope_before[n];
+ var value_after = local_scope_after[n];
+ if (value_before !== value_after) {
+ %SetScopeVariableValue(this.break_id_,
+ this.details_.frameId(),
+ this.details_.inlinedFrameIndex(),
+ 0,
+ n,
+ value_after);
+ }
+ }
+ }
+ return MakeMirror(result_array[0]);
};
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698