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

Unified Diff: src/debug-debugger.js

Issue 5866002: Fix evaluate with context debug protocol (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: small fix Created 10 years 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 | test/mjsunit/debug-evaluate-with-context.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-debugger.js
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index bf80735ef8cd6ad11920a46abcebcc85b82e0dc3..090c661dd370abd4495f503aa4fded894b258512 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -1858,15 +1858,18 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
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);
+ for (var i = 0; i < additional_context.length; i++) {
+ var mapping = additional_context[i];
+ if (!IS_STRING(mapping.name) || !IS_NUMBER(mapping.handle)) {
+ return response.failed("Context element #" + i +
+ " must contain name:string and handle:number");
+ }
+ var context_value_mirror = LookupMirror(mapping.handle);
if (!context_value_mirror) {
- return response.failed(
- "Context object '" + key + "' #" + context_value_handle +
- "# not found");
+ return response.failed("Context object '" + mapping.name +
+ "' #" + mapping.handle + "# not found");
}
- additional_context_object[key] = context_value_mirror.value();
+ additional_context_object[mapping.name] = context_value_mirror.value();
}
}
« no previous file with comments | « no previous file | test/mjsunit/debug-evaluate-with-context.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698