|
22 | 22 | #include "include/zipconf.h" |
23 | 23 | #include <sstream> |
24 | 24 | #include <dlfcn.h> |
| 25 | +#include <console/Console.h> |
25 | 26 | #include "NetworkDomainCallbackHandlers.h" |
26 | 27 | #include "sys/system_properties.h" |
27 | 28 | #include "JsV8InspectorClient.h" |
@@ -500,7 +501,6 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, const string& native |
500 | 501 |
|
501 | 502 | globalTemplate->Set(ArgConverter::ConvertToV8String(isolate, "__log"), FunctionTemplate::New(isolate, CallbackHandlers::LogMethodCallback)); |
502 | 503 | globalTemplate->Set(ArgConverter::ConvertToV8String(isolate, "__dumpReferenceTables"), FunctionTemplate::New(isolate, CallbackHandlers::DumpReferenceTablesMethodCallback)); |
503 | | - globalTemplate->Set(ArgConverter::ConvertToV8String(isolate, "__consoleMessage"), FunctionTemplate::New(isolate, JsV8InspectorClient::sendToFrontEndCallback)); |
504 | 504 | globalTemplate->Set(ArgConverter::ConvertToV8String(isolate, "__enableVerboseLogging"), FunctionTemplate::New(isolate, CallbackHandlers::EnableVerboseLoggingMethodCallback)); |
505 | 505 | globalTemplate->Set(ArgConverter::ConvertToV8String(isolate, "__disableVerboseLogging"), FunctionTemplate::New(isolate, CallbackHandlers::DisableVerboseLoggingMethodCallback)); |
506 | 506 | globalTemplate->Set(ArgConverter::ConvertToV8String(isolate, "__exit"), FunctionTemplate::New(isolate, CallbackHandlers::ExitMethodCallback)); |
@@ -572,6 +572,12 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, const string& native |
572 | 572 | global->ForceSet(ArgConverter::ConvertToV8String(isolate, "self"), global, readOnlyFlags); |
573 | 573 | } |
574 | 574 |
|
| 575 | + /* |
| 576 | + * Attach 'console' object to the global object |
| 577 | + */ |
| 578 | + v8::Local<v8::Object> console = Console::createConsole(context, filesPath); |
| 579 | + global->ForceSet(context, ArgConverter::ConvertToV8String(isolate, "console"), console, readOnlyFlags); |
| 580 | + |
575 | 581 | ArgConverter::Init(isolate); |
576 | 582 |
|
577 | 583 | CallbackHandlers::Init(isolate); |
|
0 commit comments