diff --git a/ReactCommon/jsi/JSCRuntime.cpp b/ReactCommon/jsi/JSCRuntime.cpp index 2b5341c3f9a02b..eea02793439dca 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; }