Skip to content

Conversation

@adrian-niculescu
Copy link
Contributor

@adrian-niculescu adrian-niculescu commented Nov 21, 2025

Added Context::Scope to Runtime::RunMainScript, Runtime::RunModule, and Runtime::RunScript to ensure the runtime's context is explicitly entered before delegating to ModuleInternal.

Rationale

While the context is already entered once in Runtime::Init() and remains current for the runtime's lifetime, this change adds a defensive context scope at each entry point for:

  • Consistency: All Runtime entry points now follow the same pattern
  • Future-proofing: Protection against potential context manipulation before these methods are called
  • Explicitness: Makes the context requirement clear at the API boundary

No functional behavior change is expected for existing apps.

Added Context::Scope to Runtime::RunMainScript, Runtime::RunModule, and Runtime::RunScript to ensure the runtime's context is explicitly entered before delegating to ModuleInternal.

While the context is already entered once in Runtime::Init and remains current for the runtime's lifetime, this change adds a defensive context scope at each entry point for consistency and future-proofing.
@adrian-niculescu adrian-niculescu force-pushed the fix/runtime-runmain-context-scope branch from 71c0601 to 6156b29 Compare November 21, 2025 18:03
@adrian-niculescu adrian-niculescu changed the title fix(runtime): enter context in RunMainScript fix(runtime): entered context in Runtime entry points Nov 21, 2025
@adrian-niculescu adrian-niculescu deleted the fix/runtime-runmain-context-scope branch November 21, 2025 23:09
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.

1 participant