Co-authored-by: codex <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
22 lines
1.2 KiB
Diff
22 lines
1.2 KiB
Diff
diff --git a/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift b/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
|
|
index a0e3e24d6070c5ec0a220af3cb56fe3373fe1968..d610cc38dd8dee363ea2f1822aea0c4a492cf825 100644
|
|
--- a/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
|
|
+++ b/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
|
|
@@ -215,8 +215,15 @@ open class JavaScriptRuntime: Equatable, @unchecked Sendable {
|
|
.toOpaque()
|
|
// Pass a null setter to C++ when the Swift setter is nil so that JS assignment
|
|
// raises a `jsi::JSError` directly, without crossing the Swift boundary.
|
|
+ if set == nil {
|
|
+ let callbacks = expo.HostObjectCallbacks(
|
|
+ context, getter, nil, propertyNamesGetter, deallocate)
|
|
+ let hostObject = expo.HostObject.makeObject(pointee, consume callbacks)
|
|
+
|
|
+ return JavaScriptObject(self, hostObject)
|
|
+ }
|
|
let callbacks = expo.HostObjectCallbacks(
|
|
- context, getter, set == nil ? nil : setter, propertyNamesGetter, deallocate)
|
|
+ context, getter, setter, propertyNamesGetter, deallocate)
|
|
let hostObject = expo.HostObject.makeObject(pointee, consume callbacks)
|
|
|
|
return JavaScriptObject(self, hostObject)
|