FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

AppRuntime iOS EnableDebugger by julapy · Pull Request #100 · BabylonJS/JsRuntimeHost · GitHub

AppRuntime iOS EnableDebugger - #100

Open
julapy wants to merge 1 commit into
BabylonJS:mainfrom
julapy:appruntime-ios-debugger-fix
Open

AppRuntime iOS EnableDebugger#100
julapy wants to merge 1 commit into
BabylonJS:mainfrom
julapy:appruntime-ios-debugger-fix

Conversation

julapy commented Jan 9, 2025
edited
Loading

Copy link
Copy Markdown

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.

julapy commented Jan 9, 2025

Copy link
Copy Markdown
Author

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);

Comment on lines +16 to +33
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);
}

bghgary Jan 21, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL