Skip to content

Commit

Permalink
Add "jsEngine: hermes" to JS runtime Error prototype (facebook#48401)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#48401

This change adds a flag to JS Error's prototype to specify the jsEngine.

Reviewed By: fkgozali

Differential Revision: D67665484

fbshipit-source-id: 64b7b4bd986bcbd45d58e70c1a16de6752b05ccd
  • Loading branch information
Maddie Lord authored and facebook-github-bot committed Dec 28, 2024
1 parent 9ceabd3 commit 85bdd75
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ std::unique_ptr<JSRuntime> HermesInstance::createJSRuntime(
std::unique_ptr<HermesRuntime> hermesRuntime =
hermes::makeHermesRuntime(runtimeConfigBuilder.build());

auto errorPrototype = hermesRuntime->global()
.getPropertyAsObject(*hermesRuntime, "Error")
.getPropertyAsObject(*hermesRuntime, "prototype");
errorPrototype.setProperty(*hermesRuntime, "jsEngine", "hermes");

#ifdef HERMES_ENABLE_DEBUGGER
auto& inspectorFlags = jsinspector_modern::InspectorFlags::getInstance();
if (!inspectorFlags.getFuseboxEnabled()) {
Expand Down

0 comments on commit 85bdd75

Please sign in to comment.