Skip to content

Commit 67935ba

Browse files
authored
Merge pull request #1041 from NativeScript/darind/inspector-elements-fix
Move the inspector initialization before other init methods
2 parents 6d84b99 + 7ce50af commit 67935ba

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test-app/runtime/src/main/cpp/Runtime.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,15 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, const string& native
552552
globalTemplate->Set(ArgConverter::ConvertToV8String(isolate, "close"), closeFuncTemplate);
553553
}
554554

555+
#ifdef APPLICATION_IN_DEBUG
556+
/*
557+
* Attach __inspector object with function callbacks that report to the Chrome DevTools frontend
558+
*/
559+
if (isDebuggable) {
560+
JsV8InspectorClient::attachInspectorCallbacks(isolate, globalTemplate);
561+
}
562+
#endif
563+
555564
m_weakRef.Init(isolate, globalTemplate, m_objectManager);
556565

557566
SimpleProfiler::Init(isolate, globalTemplate);
@@ -581,13 +590,6 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, const string& native
581590
}
582591

583592
#ifdef APPLICATION_IN_DEBUG
584-
/*
585-
* Attach __inspector object with function callbacks that report to the Chrome DevTools frontend
586-
*/
587-
if (isDebuggable) {
588-
JsV8InspectorClient::attachInspectorCallbacks(isolate, globalTemplate);
589-
}
590-
591593
v8::Local<v8::Object> console = Console::createConsole(context, JsV8InspectorClient::consoleLogCallback);
592594
#else
593595
v8::Local<v8::Object> console = Console::createConsole(context, nullptr);

0 commit comments

Comments
 (0)