Skip to content

Allow HermesJSRuntime/HermesRuntimeTargetDelegate to take both jsi::Runtime and HermesRuntime arguments in ctor#55732

Open
lavenzg wants to merge 1 commit intofacebook:mainfrom
lavenzg:export-D94258352
Open

Allow HermesJSRuntime/HermesRuntimeTargetDelegate to take both jsi::Runtime and HermesRuntime arguments in ctor#55732
lavenzg wants to merge 1 commit intofacebook:mainfrom
lavenzg:export-D94258352

Conversation

@lavenzg
Copy link
Contributor

@lavenzg lavenzg commented Feb 24, 2026

Summary:
Ideally we only need to pass jsi::Runtime, from which we can cast to
IHermes for Hermes specific interface methods. But in some scenarios
like instrumenting the runtime or tracing JSI calls, the passed runtime
would be a decorator of the actual HermesRuntime, we can't do casting
on the decoration type since it doesn't implement IHermes. So this diff
changes it to pass both a shared_ptr of jsi::Runtime and HermesRuntime
reference. It has no behavioral change.

Changelog: [Internal]

Differential Revision: D94258352

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 24, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 24, 2026

@lavenzg has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94258352.

…untime and HermesRuntime arguments in ctor (facebook#55732)

Summary:

Ideally we only need to pass jsi::Runtime, from which we can cast to
IHermes for Hermes specific interface methods. But in some scenarios
like instrumenting the runtime or tracing JSI calls, the passed runtime
would be a decorator of the actual HermesRuntime, we can't do casting
on the decoration type since it doesn't implement IHermes. So this diff
changes it to pass both a shared_ptr of jsi::Runtime and HermesRuntime
reference. It has no behavioral change.

Changelog: [Internal]

Differential Revision: D94258352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants