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

Unified Diff: src/d8-debug.cc

Issue 27202: Change the D8 JavaScript debugger to fully use the JSON protocol.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 10 months 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 | « src/d8.js ('k') | src/debug-delay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8-debug.cc
===================================================================
--- src/d8-debug.cc (revision 1373)
+++ src/d8-debug.cc (working copy)
@@ -46,8 +46,19 @@
TryCatch try_catch;
+ // Get the toJSONProtocol function on the event and get the JSON format.
+ Local<String> to_json_fun_name = String::New("toJSONProtocol");
+ Local<Function> to_json_fun =
+ Function::Cast(*event_data->Get(to_json_fun_name));
+ Local<Value> event_json = to_json_fun->Call(event_data, 0, NULL);
+ if (try_catch.HasCaught()) {
+ Shell::ReportException(&try_catch);
+ return;
+ }
+
// Print the event details.
- Handle<String> details = Shell::DebugEventToText(event_data);
+ Handle<String> details =
+ Shell::DebugEventToText(Handle<String>::Cast(event_json));
if (details->Length() == 0) {
// Empty string is used to signal not to process this event.
return;
« no previous file with comments | « src/d8.js ('k') | src/debug-delay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698