Chromium Code Reviews| Index: src/debug-debugger.js |
| diff --git a/src/debug-debugger.js b/src/debug-debugger.js |
| index d091991a1199eff1ebacd84894563657dd7e97db..d7e40da800728d9ee99f4b74e925cecac292dd59 100644 |
| --- a/src/debug-debugger.js |
| +++ b/src/debug-debugger.js |
| @@ -876,9 +876,9 @@ ExecutionState.prototype.prepareStep = function(opt_action, opt_count) { |
| return %PrepareStep(this.break_id, action, count); |
| } |
| -ExecutionState.prototype.evaluateGlobal = function(source, disable_break) { |
| +ExecutionState.prototype.evaluateGlobal = function(source, disable_break, opt_additional_context) { |
|
Søren Thygesen Gjesse
2010/12/13 08:37:14
Long line - more below.
Peter Rybin
2010/12/14 00:02:52
Done.
|
| return MakeMirror( |
| - %DebugEvaluateGlobal(this.break_id, source, Boolean(disable_break))); |
| + %DebugEvaluateGlobal(this.break_id, source, Boolean(disable_break), opt_additional_context)); |
| }; |
| ExecutionState.prototype.frameCount = function() { |
| @@ -1837,6 +1837,7 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) { |
| var frame = request.arguments.frame; |
| var global = request.arguments.global; |
| var disable_break = request.arguments.disable_break; |
| + var additional_context = request.arguments.additional_context; |
| // The expression argument could be an integer so we convert it to a |
| // string. |
| @@ -1850,12 +1851,27 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) { |
| if (!IS_UNDEFINED(frame) && global) { |
| return response.failed('Arguments "frame" and "global" are exclusive'); |
| } |
| + |
| + var additional_context_object; |
| + if (additional_context) { |
| + additional_context_object = {}; |
| + for (var key in additional_context) { |
| + var context_value_handle = additional_context[key]; |
| + var context_value_mirror = LookupMirror(context_value_handle); |
| + if (!context_value_mirror) { |
| + return response.failed( |
| + "Context object '" + key + "' #" + context_value_handle + "# not found"); |
| + } |
| + additional_context_object[key] = context_value_mirror.value(); |
| + } |
| + } |
| // Global evaluate. |
| if (global) { |
| // Evaluate in the global context. |
| response.body = |
| - this.exec_state_.evaluateGlobal(expression, Boolean(disable_break)); |
| + this.exec_state_.evaluateGlobal(expression, Boolean(disable_break), |
| + additional_context_object); |
| return; |
| } |
| @@ -1877,12 +1893,12 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) { |
| } |
| // Evaluate in the specified frame. |
| response.body = this.exec_state_.frame(frame_number).evaluate( |
| - expression, Boolean(disable_break)); |
| + expression, Boolean(disable_break), additional_context_object); |
| return; |
| } else { |
| // Evaluate in the selected frame. |
| response.body = this.exec_state_.frame().evaluate( |
| - expression, Boolean(disable_break)); |
| + expression, Boolean(disable_break), additional_context_object); |
| return; |
| } |
| }; |