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) {
+ var local_scope_on_stack = result_array[1];
+ var local_scope_modifed = result_array[2];
+ for (var n in local_scope_modifed) {
+ var value_on_stack = local_scope_on_stack[n];
+ var value_modifed = local_scope_modifed[n];
+ if (value_on_stack !== value_modifed) {
%SetScopeVariableValue(this.break_id_,
this.details_.frameId(),
this.details_.inlinedFrameIndex(),
0,
n,
- value_after);
+ value_modifed);
}
}
}
// stack frame is currently stopped when we compile and run the (direct) eval.
// Returns array of
// #0: evaluate result
-// #1: local variables scope materizalized as object before evaluation
-// #2: local variables scope materizalized as object after evaluation
+// #1: local variables materizalized again as object after evaluation, contain
+// original variable values as they remained on stack
+// #2: local variables materizalized as object before evaluation (and possibly
+// modified by expression having been executed)
// Since user expression only reaches (and modifies) copies of local variables,
// those copies are returned to the caller to allow tracking the changes and
// manually updating the actual variables.
}
Handle<Object> evaluate_result(evaluate_result_object, isolate);
- Handle<JSObject> local_scope_after = MaterializeLocalScopeWithFrameInspector(
- isolate, frame, &frame_inspector);
+ Handle<JSObject> local_scope_control_copy =
+ MaterializeLocalScopeWithFrameInspector(isolate, frame,
+ &frame_inspector);
- Handle<FixedArray> resultArray =
- isolate->factory()->NewFixedArray(3);
+ Handle<FixedArray> resultArray = isolate->factory()->NewFixedArray(3);
resultArray->set(0, *evaluate_result);
+ resultArray->set(1, *local_scope_control_copy);
resultArray->set(2, *local_scope);
- resultArray->set(1, *local_scope_after);
return *(isolate->factory()->NewJSArrayWithElements(resultArray));
}