Skip to content

Commit 85bdd75

Browse files
Maddie Lordfacebook-github-bot
Maddie Lord
authored andcommitted
Add "jsEngine: hermes" to JS runtime Error prototype (#48401)
Summary: Pull Request resolved: #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
1 parent 9ceabd3 commit 85bdd75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ std::unique_ptr<JSRuntime> HermesInstance::createJSRuntime(
153153
std::unique_ptr<HermesRuntime> hermesRuntime =
154154
hermes::makeHermesRuntime(runtimeConfigBuilder.build());
155155

156+
auto errorPrototype = hermesRuntime->global()
157+
.getPropertyAsObject(*hermesRuntime, "Error")
158+
.getPropertyAsObject(*hermesRuntime, "prototype");
159+
errorPrototype.setProperty(*hermesRuntime, "jsEngine", "hermes");
160+
156161
#ifdef HERMES_ENABLE_DEBUGGER
157162
auto& inspectorFlags = jsinspector_modern::InspectorFlags::getInstance();
158163
if (!inspectorFlags.getFuseboxEnabled()) {

0 commit comments

Comments
 (0)