Skip to content

Commit

Permalink
Revert D15237424: [react-native][PR] Consistent reporting native modu…
Browse files Browse the repository at this point in the history
…le name on crash on native side

Differential Revision:
D15237424

Original commit changeset: ded8db45b2a2

fbshipit-source-id: 99d176e1ee796dbbe9957eda08992a8a76ba109b
  • Loading branch information
zeyadsalloum authored and facebook-github-bot committed May 7, 2019
1 parent d6c33f9 commit fdd8fad
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions ReactCommon/jsi/JSCRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,11 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
static JSValueRef getProperty(
JSContextRef ctx,
JSObjectRef object,
JSStringRef propName,
JSStringRef propertyName,
JSValueRef* exception) {
auto proxy = static_cast<HostObjectProxy*>(JSObjectGetPrivate(object));
auto& rt = proxy->runtime;
jsi::PropNameID sym = rt.createPropNameID(propName);
jsi::PropNameID sym = rt.createPropNameID(propertyName);
jsi::Value ret;
try {
ret = proxy->hostObject->get(rt, sym);
Expand All @@ -681,20 +681,14 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
.getPropertyAsFunction(rt, "Error")
.call(
rt,
std::string("Exception in HostObject::get(propName:")
+ JSStringToSTLString(propName)
+ std::string("): ") + ex.what());
std::string("Exception in HostObject::get: ") + ex.what());
*exception = rt.valueRef(excValue);
return JSValueMakeUndefined(ctx);
} catch (...) {
auto excValue =
rt.global()
.getPropertyAsFunction(rt, "Error")
.call(
rt,
std::string("Exception in HostObject::get(propName:")
+ JSStringToSTLString(propName)
+ std::string("): <unknown>"));
.call(rt, std::string("Exception in HostObject::get: ") + JSStringToSTLString(propertyName));
*exception = rt.valueRef(excValue);
return JSValueMakeUndefined(ctx);
}
Expand Down Expand Up @@ -724,20 +718,14 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
.getPropertyAsFunction(rt, "Error")
.call(
rt,
std::string("Exception in HostObject::set(propName:")
+ JSStringToSTLString(propName)
+ std::string("): ") + ex.what());
std::string("Exception in HostObject::set: ") + ex.what());
*exception = rt.valueRef(excValue);
return false;
} catch (...) {
auto excValue =
rt.global()
.getPropertyAsFunction(rt, "Error")
.call(
rt,
std::string("Exception in HostObject::set(propName:")
+ JSStringToSTLString(propName)
+ std::string("): <unknown>"));
.call(rt, "Exception in HostObject::set: <unknown>");
*exception = rt.valueRef(excValue);
return false;
}
Expand Down

0 comments on commit fdd8fad

Please sign in to comment.