Skip to content

Commit 7f61a8b

Browse files
committed
fix: Read identityMode from first skeleton that defines it
When multiple targets share one createInstantiator (e.g. test package), use compactMap to find the first non-nil identityMode across all skeletons instead of reading from the first skeleton which may not have it set.
1 parent 5bf23cd commit 7f61a8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ public struct BridgeJSLink {
983983

984984
try printer.indent {
985985
printer.write(lines: generateVariableDeclarations())
986-
let configIdentityMode = skeletons.compactMap(\.exported).first?.identityMode ?? "none"
986+
let configIdentityMode = skeletons.compactMap(\.exported).compactMap(\.identityMode).first ?? "none"
987987
printer.write("const identityMode = options.identityMode ?? \"\(configIdentityMode)\";")
988988
printer.write(
989989
"const shouldUseIdentityMap = identityMode === \"pointer\" && typeof WeakRef !== \"undefined\" && typeof FinalizationRegistry !== \"undefined\";"

0 commit comments

Comments
 (0)