Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

expo-modules-jsi@56.0.10.patch

21 lines1.2 KB

1diff --git a/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift b/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
2index a0e3e24d6070c5ec0a220af3cb56fe3373fe1968..d610cc38dd8dee363ea2f1822aea0c4a492cf825 100644
3--- a/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
4+++ b/apple/Sources/ExpoModulesJSI/Runtime/JavaScriptRuntime.swift
5@@ -215,8 +215,15 @@ open class JavaScriptRuntime: Equatable, @unchecked Sendable {
6 .toOpaque()
7 // Pass a null setter to C++ when the Swift setter is nil so that JS assignment
8 // raises a `jsi::JSError` directly, without crossing the Swift boundary.
9+ if set == nil {
10+ let callbacks = expo.HostObjectCallbacks(
11+ context, getter, nil, propertyNamesGetter, deallocate)
12+ let hostObject = expo.HostObject.makeObject(pointee, consume callbacks)
14+ return JavaScriptObject(self, hostObject)
15+ }
16 let callbacks = expo.HostObjectCallbacks(
17- context, getter, set == nil ? nil : setter, propertyNamesGetter, deallocate)
18+ context, getter, setter, propertyNamesGetter, deallocate)
19 let hostObject = expo.HostObject.makeObject(pointee, consume callbacks)
21 return JavaScriptObject(self, hostObject)