Add "jsEngine: hermes" to JS runtime Error prototype (#48401)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Maddie Lord authored and Facebook GitHub Bot committed 2024-12-27 16:59:49 -08:00
1 parent 9ceabd341d
commit 85bdd75828
1 file changed
+5
@@ -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()) {