From fdd8fadea84f475714a16b6f0ec433f898d09558 Mon Sep 17 00:00:00 2001 From: Zeyad Salloum Date: Tue, 7 May 2019 02:44:46 -0700 Subject: [PATCH] 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 --- ReactCommon/jsi/JSCRuntime.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/ReactCommon/jsi/JSCRuntime.cpp b/ReactCommon/jsi/JSCRuntime.cpp index 2b5341c3f9a..eea02793439 100644 --- a/ReactCommon/jsi/JSCRuntime.cpp +++ b/ReactCommon/jsi/JSCRuntime.cpp @@ -664,11 +664,11 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr ho) { static JSValueRef getProperty( JSContextRef ctx, JSObjectRef object, - JSStringRef propName, + JSStringRef propertyName, JSValueRef* exception) { auto proxy = static_cast(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); @@ -681,20 +681,14 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr 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("): ")); + .call(rt, std::string("Exception in HostObject::get: ") + JSStringToSTLString(propertyName)); *exception = rt.valueRef(excValue); return JSValueMakeUndefined(ctx); } @@ -724,20 +718,14 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr 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("): ")); + .call(rt, "Exception in HostObject::set: "); *exception = rt.valueRef(excValue); return false; }