Index: src/mirror-debugger.js |
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js |
index a5331a014de6f79f30404dd19a5965a5a7969769..7f1a05aed9479e8b8cb0d12cf7777bcea1eae73c 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,22 @@ 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); |
+ } 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 +1934,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 |