JSClosure stores its identifier and tell it to JS for bridging, but the identifiers has a trouble.
hashValue is used for the identifier, but hashValue is not guaranteed to be unique.
Hm, good point! Looking at the relevant implementations I think that should be replaced with the UInt(bitPattern:) initializer which can take an ObjectIdentifier.
JSClosure stores its identifier and tell it to JS for bridging, but the identifiers has a trouble.
hashValue
is used for the identifier, buthashValue
is not guaranteed to be unique.https://github.com/swiftwasm/JavaScriptKit/blob/1afbfaf16598119a851dca39e3b447de6cf52589/Sources/JavaScriptKit/FundamentalObjects/JSClosure.swift#L89