From e30131f30be2b09afe7d2d70c0a7863759fd5d99 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Tue, 12 Dec 2017 09:41:58 +0530 Subject: [PATCH] Initialize isolate holder in standalone node mode --- atom/app/node_main.cc | 2 ++ atom/browser/api/atom_api_debugger.cc | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/atom/app/node_main.cc b/atom/app/node_main.cc index 94a727f5aa90..3111e9be39a3 100644 --- a/atom/app/node_main.cc +++ b/atom/app/node_main.cc @@ -45,6 +45,8 @@ int NodeMain(int argc, char *argv[]) { // V8 requires a task scheduler apparently base::TaskScheduler::CreateAndStartWithDefaultParams("Electron"); + // Initialize gin::IsolateHolder. + JavascriptEnvironment::Initialize(); JavascriptEnvironment gin_env; int exec_argc; diff --git a/atom/browser/api/atom_api_debugger.cc b/atom/browser/api/atom_api_debugger.cc index 92193c480ba7..da8b212be024 100644 --- a/atom/browser/api/atom_api_debugger.cc +++ b/atom/browser/api/atom_api_debugger.cc @@ -49,11 +49,11 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host, v8::Locker locker(isolate()); v8::HandleScope handle_scope(isolate()); - std::unique_ptr result = base::JSONReader::Read(message); - if (!result || !result->is_dict()) + std::unique_ptr parsed_message = base::JSONReader::Read(message); + if (!parsed_message || !parsed_message->is_dict()) return; base::DictionaryValue* dict = - static_cast(result.get()); + static_cast(parsed_message.get()); int id; if (!dict->GetInteger("id", &id)) { std::string method;