Skip to content

Commit fdd8fad

Browse files
zeyadsalloumfacebook-github-bot
authored andcommitted
Revert D15237424: [react-native][PR] Consistent reporting native module name on crash on native side
Differential Revision: D15237424 Original commit changeset: ded8db45b2a2 fbshipit-source-id: 99d176e1ee796dbbe9957eda08992a8a76ba109b
1 parent d6c33f9 commit fdd8fad

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

ReactCommon/jsi/JSCRuntime.cpp

+6-18
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,11 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
664664
static JSValueRef getProperty(
665665
JSContextRef ctx,
666666
JSObjectRef object,
667-
JSStringRef propName,
667+
JSStringRef propertyName,
668668
JSValueRef* exception) {
669669
auto proxy = static_cast<HostObjectProxy*>(JSObjectGetPrivate(object));
670670
auto& rt = proxy->runtime;
671-
jsi::PropNameID sym = rt.createPropNameID(propName);
671+
jsi::PropNameID sym = rt.createPropNameID(propertyName);
672672
jsi::Value ret;
673673
try {
674674
ret = proxy->hostObject->get(rt, sym);
@@ -681,20 +681,14 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
681681
.getPropertyAsFunction(rt, "Error")
682682
.call(
683683
rt,
684-
std::string("Exception in HostObject::get(propName:")
685-
+ JSStringToSTLString(propName)
686-
+ std::string("): ") + ex.what());
684+
std::string("Exception in HostObject::get: ") + ex.what());
687685
*exception = rt.valueRef(excValue);
688686
return JSValueMakeUndefined(ctx);
689687
} catch (...) {
690688
auto excValue =
691689
rt.global()
692690
.getPropertyAsFunction(rt, "Error")
693-
.call(
694-
rt,
695-
std::string("Exception in HostObject::get(propName:")
696-
+ JSStringToSTLString(propName)
697-
+ std::string("): <unknown>"));
691+
.call(rt, std::string("Exception in HostObject::get: ") + JSStringToSTLString(propertyName));
698692
*exception = rt.valueRef(excValue);
699693
return JSValueMakeUndefined(ctx);
700694
}
@@ -724,20 +718,14 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
724718
.getPropertyAsFunction(rt, "Error")
725719
.call(
726720
rt,
727-
std::string("Exception in HostObject::set(propName:")
728-
+ JSStringToSTLString(propName)
729-
+ std::string("): ") + ex.what());
721+
std::string("Exception in HostObject::set: ") + ex.what());
730722
*exception = rt.valueRef(excValue);
731723
return false;
732724
} catch (...) {
733725
auto excValue =
734726
rt.global()
735727
.getPropertyAsFunction(rt, "Error")
736-
.call(
737-
rt,
738-
std::string("Exception in HostObject::set(propName:")
739-
+ JSStringToSTLString(propName)
740-
+ std::string("): <unknown>"));
728+
.call(rt, "Exception in HostObject::set: <unknown>");
741729
*exception = rt.valueRef(excValue);
742730
return false;
743731
}

0 commit comments

Comments
 (0)