| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
on another note, might also be good show how AppRuntime Options can be enabled inside LibNativeBridge, so people can easily enable debugger. auto runtimeOptions = Babylon::AppRuntime::Options();
runtimeOptions.EnableDebugger = true;
runtime.emplace(runtimeOptions);
|
Sorry, something went wrong.
| void AppRuntime::RunEnvironmentTier(const char*) | ||
| { | ||
| auto globalContext = JSGlobalContextCreateInGroup(nullptr, nullptr); | ||
|
|
||
| if (@available(iOS 16.4, *)) { | ||
| JSGlobalContextSetInspectable(globalContext, m_options.EnableDebugger); | ||
| } | ||
|
|
||
| Napi::Env env = Napi::Attach(globalContext); | ||
|
|
||
| Run(env); | ||
|
|
||
| JSGlobalContextRelease(globalContext); | ||
|
|
||
| // Detach must come after JSGlobalContextRelease since it triggers finalizers which require env. | ||
| Napi::Detach(env); | ||
| } | ||
|
|
There was a problem hiding this comment.
Sorry for the slow response.
RunEnvironmentTier cannot be here as this function is intended to be JS environment specific. I think we need to add some platform specific macros to this code to ensure we don't call this function when it's not available. Availability.h has defines that we can check. Maybe also add a macro to disable this completedly in case someone is building against a version of JSC without this function.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
hi, in order to run JSGlobalContextSetInspectable there needs to be check around it for iOS 16.4
if (@available(iOS 16.4, *)) { JSGlobalContextSetInspectable(globalContext, m_options.EnableDebugger); }i noticed that AppRuntime_iOS.mm was calling RunEnvironmentTier in AppRuntime_JavaScriptCore.cpp
however because its inside a cpp file, @available syntax was not allowed.
ive duplicated the RunEnvironmentTier function and moved it to AppRuntime_iOS.mm where @available check can run.