Fix wrapObject typeFooDerivedFromBar then unwrapObject typeBar will cause error on iOS, e.g. image.getWidth() will be -1, or Error: react_native_pytorch_core.MediaToBlob.MediaToBlobError.unknownUnwrappedObject
Summary
the type in JSContext.wrapObject of photoOutput in CameraView.swift is Image
the type in JSContextUtils.unwrapObject of getWidth in ImageModule.swift is IImage
Changelog
Change IImage to Image around JSContext.wrapObject and JSContextUtils.unwrapObject
Test Plan
tested in RN0.64.3 with Xcode14.0.1(14A400) on macOS Monterey 12.6.5 (21G531), iOS 14.4.2 on iPhone7
Fix wrapObject typeFooDerivedFromBar then unwrapObject typeBar will cause error on iOS, e.g.
image.getWidth()
will be -1, orError: react_native_pytorch_core.MediaToBlob.MediaToBlobError.unknownUnwrappedObject
Summary
the type in
JSContext.wrapObject
ofphotoOutput
inCameraView.swift
isImage
the type inJSContextUtils.unwrapObject
ofgetWidth
inImageModule.swift
isIImage
Changelog
IImage
toImage
aroundJSContext.wrapObject
andJSContextUtils.unwrapObject
Test Plan
tested in
RN0.64.3
withXcode14.0.1(14A400)
onmacOS Monterey 12.6.5 (21G531)
,iOS 14.4.2
on iPhone7