diff --git a/ReactCommon/jsi/JSCRuntime.cpp b/ReactCommon/jsi/JSCRuntime.cpp index 3e9543653a63ea..92b1ac385ff2b4 100644 --- a/ReactCommon/jsi/JSCRuntime.cpp +++ b/ReactCommon/jsi/JSCRuntime.cpp @@ -570,6 +570,8 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr ho) { } return rt.valueRef(ret); } + + #define JSC_UNUSED(x) (void) (x); static bool setProperty( JSContextRef ctx, @@ -577,6 +579,7 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr ho) { JSStringRef propName, JSValueRef value, JSValueRef* exception) { + JSC_UNUSED(ctx); auto proxy = static_cast(JSObjectGetPrivate(object)); auto& rt = proxy->runtime; jsi::PropNameID sym = rt.createPropNameID(propName); @@ -612,6 +615,7 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr ho) { JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames) noexcept { + JSC_UNUSED(ctx); auto proxy = static_cast(JSObjectGetPrivate(object)); auto& rt = proxy->runtime; auto names = proxy->hostObject->getPropertyNames(rt); @@ -619,6 +623,8 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr ho) { JSPropertyNameAccumulatorAddName(propertyNames, stringRef(name)); } } + + #undef JSC_UNUSED static void finalize(JSObjectRef obj) { auto hostObject = static_cast(JSObjectGetPrivate(obj)); @@ -818,7 +824,7 @@ size_t JSCRuntime::size(const jsi::Array& arr) { jsi::Value JSCRuntime::getValueAtIndex(const jsi::Array& arr, size_t i) { JSValueRef exc = nullptr; - auto res = JSObjectGetPropertyAtIndex(ctx_, objectRef(arr), i, &exc); + auto res = JSObjectGetPropertyAtIndex(ctx_, objectRef(arr), (int)i, &exc); checkException(exc); return createValue(res); } @@ -828,7 +834,7 @@ void JSCRuntime::setValueAtIndexImpl( size_t i, const jsi::Value& value) { JSValueRef exc = nullptr; - JSObjectSetPropertyAtIndex(ctx_, objectRef(arr), i, valueRef(value), &exc); + JSObjectSetPropertyAtIndex(ctx_, objectRef(arr), (int)i, valueRef(value), &exc); checkException(exc); }