Chromium Code Reviews| Index: src/mirror-debugger.js |
| diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js |
| index a5331a014de6f79f30404dd19a5965a5a7969769..a4fe425fa19994d81d8509257313f720219321b6 100644 |
| --- a/src/mirror-debugger.js |
| +++ b/src/mirror-debugger.js |
| @@ -1844,10 +1844,14 @@ function ScopeDetails(frame, fun, index) { |
| frame.details_.frameId(), |
| frame.details_.inlinedFrameIndex(), |
| index); |
| + this.frame_id_ = frame.details_.frameId(); |
| + this.inlined_frame_id_ = frame.details_.inlinedFrameIndex(); |
| } else { |
| this.details_ = %GetFunctionScopeDetails(fun.value(), index); |
| + this.fun_value_ = fun.value(); |
| this.break_id_ = undefined; |
| } |
| + this.index_ = index; |
| } |
| @@ -1867,6 +1871,20 @@ ScopeDetails.prototype.object = function() { |
| }; |
| +ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) { |
| + var raw_res; |
| + if (!IS_UNDEFINED(this.break_id_)) { |
| + %CheckExecutionState(this.break_id_); |
| + raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_, this.inlined_frame_id_, this.index_, name, new_value); |
|
Yang
2012/11/19 17:00:55
80 char limit
Peter Rybin
2012/11/20 22:27:21
Done.
|
| + } else { |
| + raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_, name, new_value); |
| + } |
| + if (!raw_res) { |
| + throw new Error("Failed to set variable value"); |
| + } |
| +}; |
| + |
| + |
| /** |
| * Mirror object for scope of frame or function. Either frame or function must |
| * be specified. |
| @@ -1914,6 +1932,11 @@ ScopeMirror.prototype.scopeObject = function() { |
| }; |
| +ScopeMirror.prototype.setVariableValue = function(name, new_value) { |
| + this.details_.setVariableValueImpl(name, new_value); |
| +}; |
| + |
| + |
| /** |
| * Mirror object for script source. |
| * @param {Script} script The script object |