diff --git a/Benchmarks/Sources/Generated/BridgeJS.ExportSwift.swift b/Benchmarks/Sources/Generated/BridgeJS.ExportSwift.swift index fcec5e67..2c9d9b6b 100644 --- a/Benchmarks/Sources/Generated/BridgeJS.ExportSwift.swift +++ b/Benchmarks/Sources/Generated/BridgeJS.ExportSwift.swift @@ -369,7 +369,7 @@ public func _bjs_EnumRoundtrip_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_EnumRoundtrip_take") @_cdecl("bjs_EnumRoundtrip_take") -public func _bjs_EnumRoundtrip_take(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_EnumRoundtrip_take(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) EnumRoundtrip.bridgeJSLiftParameter(_self).take(_: APIResult.bridgeJSLiftParameter(value)) #else @@ -379,7 +379,7 @@ public func _bjs_EnumRoundtrip_take(_self: UnsafeMutableRawPointer, value: Int32 @_expose(wasm, "bjs_EnumRoundtrip_makeSuccess") @_cdecl("bjs_EnumRoundtrip_makeSuccess") -public func _bjs_EnumRoundtrip_makeSuccess(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_EnumRoundtrip_makeSuccess(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = EnumRoundtrip.bridgeJSLiftParameter(_self).makeSuccess() return ret.bridgeJSLowerReturn() @@ -390,7 +390,7 @@ public func _bjs_EnumRoundtrip_makeSuccess(_self: UnsafeMutableRawPointer) -> Vo @_expose(wasm, "bjs_EnumRoundtrip_makeFailure") @_cdecl("bjs_EnumRoundtrip_makeFailure") -public func _bjs_EnumRoundtrip_makeFailure(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_EnumRoundtrip_makeFailure(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = EnumRoundtrip.bridgeJSLiftParameter(_self).makeFailure() return ret.bridgeJSLowerReturn() @@ -401,7 +401,7 @@ public func _bjs_EnumRoundtrip_makeFailure(_self: UnsafeMutableRawPointer) -> Vo @_expose(wasm, "bjs_EnumRoundtrip_makeFlag") @_cdecl("bjs_EnumRoundtrip_makeFlag") -public func _bjs_EnumRoundtrip_makeFlag(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_EnumRoundtrip_makeFlag(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = EnumRoundtrip.bridgeJSLiftParameter(_self).makeFlag() return ret.bridgeJSLowerReturn() @@ -412,7 +412,7 @@ public func _bjs_EnumRoundtrip_makeFlag(_self: UnsafeMutableRawPointer) -> Void @_expose(wasm, "bjs_EnumRoundtrip_makeRate") @_cdecl("bjs_EnumRoundtrip_makeRate") -public func _bjs_EnumRoundtrip_makeRate(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_EnumRoundtrip_makeRate(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = EnumRoundtrip.bridgeJSLiftParameter(_self).makeRate() return ret.bridgeJSLowerReturn() @@ -423,7 +423,7 @@ public func _bjs_EnumRoundtrip_makeRate(_self: UnsafeMutableRawPointer) -> Void @_expose(wasm, "bjs_EnumRoundtrip_makePrecise") @_cdecl("bjs_EnumRoundtrip_makePrecise") -public func _bjs_EnumRoundtrip_makePrecise(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_EnumRoundtrip_makePrecise(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = EnumRoundtrip.bridgeJSLiftParameter(_self).makePrecise() return ret.bridgeJSLowerReturn() @@ -434,7 +434,7 @@ public func _bjs_EnumRoundtrip_makePrecise(_self: UnsafeMutableRawPointer) -> Vo @_expose(wasm, "bjs_EnumRoundtrip_makeInfo") @_cdecl("bjs_EnumRoundtrip_makeInfo") -public func _bjs_EnumRoundtrip_makeInfo(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_EnumRoundtrip_makeInfo(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = EnumRoundtrip.bridgeJSLiftParameter(_self).makeInfo() return ret.bridgeJSLowerReturn() @@ -445,7 +445,7 @@ public func _bjs_EnumRoundtrip_makeInfo(_self: UnsafeMutableRawPointer) -> Void @_expose(wasm, "bjs_EnumRoundtrip_roundtrip") @_cdecl("bjs_EnumRoundtrip_roundtrip") -public func _bjs_EnumRoundtrip_roundtrip(_self: UnsafeMutableRawPointer, result: Int32) -> Void { +public func _bjs_EnumRoundtrip_roundtrip(_ _self: UnsafeMutableRawPointer, _ result: Int32) -> Void { #if arch(wasm32) let ret = EnumRoundtrip.bridgeJSLiftParameter(_self).roundtrip(_: APIResult.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -456,8 +456,12 @@ public func _bjs_EnumRoundtrip_roundtrip(_self: UnsafeMutableRawPointer, result: @_expose(wasm, "bjs_EnumRoundtrip_deinit") @_cdecl("bjs_EnumRoundtrip_deinit") -public func _bjs_EnumRoundtrip_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_EnumRoundtrip_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension EnumRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -468,9 +472,9 @@ extension EnumRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "Benchmarks", name: "bjs_EnumRoundtrip_wrap") -fileprivate func _bjs_EnumRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_EnumRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_EnumRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_EnumRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -488,7 +492,7 @@ public func _bjs_ComplexResultRoundtrip_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_ComplexResultRoundtrip_take") @_cdecl("bjs_ComplexResultRoundtrip_take") -public func _bjs_ComplexResultRoundtrip_take(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_ComplexResultRoundtrip_take(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) ComplexResultRoundtrip.bridgeJSLiftParameter(_self).take(_: ComplexResult.bridgeJSLiftParameter(value)) #else @@ -498,7 +502,7 @@ public func _bjs_ComplexResultRoundtrip_take(_self: UnsafeMutableRawPointer, val @_expose(wasm, "bjs_ComplexResultRoundtrip_makeSuccess") @_cdecl("bjs_ComplexResultRoundtrip_makeSuccess") -public func _bjs_ComplexResultRoundtrip_makeSuccess(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ComplexResultRoundtrip_makeSuccess(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).makeSuccess() return ret.bridgeJSLowerReturn() @@ -509,7 +513,7 @@ public func _bjs_ComplexResultRoundtrip_makeSuccess(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_ComplexResultRoundtrip_makeError") @_cdecl("bjs_ComplexResultRoundtrip_makeError") -public func _bjs_ComplexResultRoundtrip_makeError(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ComplexResultRoundtrip_makeError(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).makeError() return ret.bridgeJSLowerReturn() @@ -520,7 +524,7 @@ public func _bjs_ComplexResultRoundtrip_makeError(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_ComplexResultRoundtrip_makeLocation") @_cdecl("bjs_ComplexResultRoundtrip_makeLocation") -public func _bjs_ComplexResultRoundtrip_makeLocation(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ComplexResultRoundtrip_makeLocation(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).makeLocation() return ret.bridgeJSLowerReturn() @@ -531,7 +535,7 @@ public func _bjs_ComplexResultRoundtrip_makeLocation(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_ComplexResultRoundtrip_makeStatus") @_cdecl("bjs_ComplexResultRoundtrip_makeStatus") -public func _bjs_ComplexResultRoundtrip_makeStatus(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ComplexResultRoundtrip_makeStatus(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).makeStatus() return ret.bridgeJSLowerReturn() @@ -542,7 +546,7 @@ public func _bjs_ComplexResultRoundtrip_makeStatus(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_ComplexResultRoundtrip_makeCoordinates") @_cdecl("bjs_ComplexResultRoundtrip_makeCoordinates") -public func _bjs_ComplexResultRoundtrip_makeCoordinates(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ComplexResultRoundtrip_makeCoordinates(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).makeCoordinates() return ret.bridgeJSLowerReturn() @@ -553,7 +557,7 @@ public func _bjs_ComplexResultRoundtrip_makeCoordinates(_self: UnsafeMutableRawP @_expose(wasm, "bjs_ComplexResultRoundtrip_makeComprehensive") @_cdecl("bjs_ComplexResultRoundtrip_makeComprehensive") -public func _bjs_ComplexResultRoundtrip_makeComprehensive(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ComplexResultRoundtrip_makeComprehensive(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).makeComprehensive() return ret.bridgeJSLowerReturn() @@ -564,7 +568,7 @@ public func _bjs_ComplexResultRoundtrip_makeComprehensive(_self: UnsafeMutableRa @_expose(wasm, "bjs_ComplexResultRoundtrip_makeInfo") @_cdecl("bjs_ComplexResultRoundtrip_makeInfo") -public func _bjs_ComplexResultRoundtrip_makeInfo(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ComplexResultRoundtrip_makeInfo(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).makeInfo() return ret.bridgeJSLowerReturn() @@ -575,7 +579,7 @@ public func _bjs_ComplexResultRoundtrip_makeInfo(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_ComplexResultRoundtrip_roundtrip") @_cdecl("bjs_ComplexResultRoundtrip_roundtrip") -public func _bjs_ComplexResultRoundtrip_roundtrip(_self: UnsafeMutableRawPointer, result: Int32) -> Void { +public func _bjs_ComplexResultRoundtrip_roundtrip(_ _self: UnsafeMutableRawPointer, _ result: Int32) -> Void { #if arch(wasm32) let ret = ComplexResultRoundtrip.bridgeJSLiftParameter(_self).roundtrip(_: ComplexResult.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -586,8 +590,12 @@ public func _bjs_ComplexResultRoundtrip_roundtrip(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_ComplexResultRoundtrip_deinit") @_cdecl("bjs_ComplexResultRoundtrip_deinit") -public func _bjs_ComplexResultRoundtrip_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ComplexResultRoundtrip_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ComplexResultRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -598,9 +606,9 @@ extension ComplexResultRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject #if arch(wasm32) @_extern(wasm, module: "Benchmarks", name: "bjs_ComplexResultRoundtrip_wrap") -fileprivate func _bjs_ComplexResultRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ComplexResultRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ComplexResultRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ComplexResultRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -618,7 +626,7 @@ public func _bjs_StringRoundtrip_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_StringRoundtrip_take") @_cdecl("bjs_StringRoundtrip_take") -public func _bjs_StringRoundtrip_take(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StringRoundtrip_take(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) StringRoundtrip.bridgeJSLiftParameter(_self).take(_: String.bridgeJSLiftParameter(valueBytes, valueLength)) #else @@ -628,7 +636,7 @@ public func _bjs_StringRoundtrip_take(_self: UnsafeMutableRawPointer, valueBytes @_expose(wasm, "bjs_StringRoundtrip_make") @_cdecl("bjs_StringRoundtrip_make") -public func _bjs_StringRoundtrip_make(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StringRoundtrip_make(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StringRoundtrip.bridgeJSLiftParameter(_self).make() return ret.bridgeJSLowerReturn() @@ -639,8 +647,12 @@ public func _bjs_StringRoundtrip_make(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_StringRoundtrip_deinit") @_cdecl("bjs_StringRoundtrip_deinit") -public func _bjs_StringRoundtrip_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_StringRoundtrip_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension StringRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -651,9 +663,9 @@ extension StringRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "Benchmarks", name: "bjs_StringRoundtrip_wrap") -fileprivate func _bjs_StringRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_StringRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_StringRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_StringRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -671,7 +683,7 @@ public func _bjs_StructRoundtrip_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_StructRoundtrip_takeSimple") @_cdecl("bjs_StructRoundtrip_takeSimple") -public func _bjs_StructRoundtrip_takeSimple(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_takeSimple(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) StructRoundtrip.bridgeJSLiftParameter(_self).takeSimple(_: SimpleStruct.bridgeJSLiftParameter()) #else @@ -681,7 +693,7 @@ public func _bjs_StructRoundtrip_takeSimple(_self: UnsafeMutableRawPointer) -> V @_expose(wasm, "bjs_StructRoundtrip_makeSimple") @_cdecl("bjs_StructRoundtrip_makeSimple") -public func _bjs_StructRoundtrip_makeSimple(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_makeSimple(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).makeSimple() return ret.bridgeJSLowerReturn() @@ -692,7 +704,7 @@ public func _bjs_StructRoundtrip_makeSimple(_self: UnsafeMutableRawPointer) -> V @_expose(wasm, "bjs_StructRoundtrip_roundtripSimple") @_cdecl("bjs_StructRoundtrip_roundtripSimple") -public func _bjs_StructRoundtrip_roundtripSimple(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_roundtripSimple(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).roundtripSimple(_: SimpleStruct.bridgeJSLiftParameter()) return ret.bridgeJSLowerReturn() @@ -703,7 +715,7 @@ public func _bjs_StructRoundtrip_roundtripSimple(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_StructRoundtrip_takeAddress") @_cdecl("bjs_StructRoundtrip_takeAddress") -public func _bjs_StructRoundtrip_takeAddress(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_takeAddress(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) StructRoundtrip.bridgeJSLiftParameter(_self).takeAddress(_: Address.bridgeJSLiftParameter()) #else @@ -713,7 +725,7 @@ public func _bjs_StructRoundtrip_takeAddress(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_StructRoundtrip_makeAddress") @_cdecl("bjs_StructRoundtrip_makeAddress") -public func _bjs_StructRoundtrip_makeAddress(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_makeAddress(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).makeAddress() return ret.bridgeJSLowerReturn() @@ -724,7 +736,7 @@ public func _bjs_StructRoundtrip_makeAddress(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_StructRoundtrip_roundtripAddress") @_cdecl("bjs_StructRoundtrip_roundtripAddress") -public func _bjs_StructRoundtrip_roundtripAddress(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_roundtripAddress(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).roundtripAddress(_: Address.bridgeJSLiftParameter()) return ret.bridgeJSLowerReturn() @@ -735,7 +747,7 @@ public func _bjs_StructRoundtrip_roundtripAddress(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_StructRoundtrip_takePerson") @_cdecl("bjs_StructRoundtrip_takePerson") -public func _bjs_StructRoundtrip_takePerson(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_takePerson(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) StructRoundtrip.bridgeJSLiftParameter(_self).takePerson(_: Person.bridgeJSLiftParameter()) #else @@ -745,7 +757,7 @@ public func _bjs_StructRoundtrip_takePerson(_self: UnsafeMutableRawPointer) -> V @_expose(wasm, "bjs_StructRoundtrip_makePerson") @_cdecl("bjs_StructRoundtrip_makePerson") -public func _bjs_StructRoundtrip_makePerson(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_makePerson(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).makePerson() return ret.bridgeJSLowerReturn() @@ -756,7 +768,7 @@ public func _bjs_StructRoundtrip_makePerson(_self: UnsafeMutableRawPointer) -> V @_expose(wasm, "bjs_StructRoundtrip_roundtripPerson") @_cdecl("bjs_StructRoundtrip_roundtripPerson") -public func _bjs_StructRoundtrip_roundtripPerson(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_roundtripPerson(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).roundtripPerson(_: Person.bridgeJSLiftParameter()) return ret.bridgeJSLowerReturn() @@ -767,7 +779,7 @@ public func _bjs_StructRoundtrip_roundtripPerson(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_StructRoundtrip_takeComplex") @_cdecl("bjs_StructRoundtrip_takeComplex") -public func _bjs_StructRoundtrip_takeComplex(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_takeComplex(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) StructRoundtrip.bridgeJSLiftParameter(_self).takeComplex(_: ComplexStruct.bridgeJSLiftParameter()) #else @@ -777,7 +789,7 @@ public func _bjs_StructRoundtrip_takeComplex(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_StructRoundtrip_makeComplex") @_cdecl("bjs_StructRoundtrip_makeComplex") -public func _bjs_StructRoundtrip_makeComplex(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_makeComplex(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).makeComplex() return ret.bridgeJSLowerReturn() @@ -788,7 +800,7 @@ public func _bjs_StructRoundtrip_makeComplex(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_StructRoundtrip_roundtripComplex") @_cdecl("bjs_StructRoundtrip_roundtripComplex") -public func _bjs_StructRoundtrip_roundtripComplex(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_StructRoundtrip_roundtripComplex(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = StructRoundtrip.bridgeJSLiftParameter(_self).roundtripComplex(_: ComplexStruct.bridgeJSLiftParameter()) return ret.bridgeJSLowerReturn() @@ -799,8 +811,12 @@ public func _bjs_StructRoundtrip_roundtripComplex(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_StructRoundtrip_deinit") @_cdecl("bjs_StructRoundtrip_deinit") -public func _bjs_StructRoundtrip_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_StructRoundtrip_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension StructRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -811,16 +827,16 @@ extension StructRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "Benchmarks", name: "bjs_StructRoundtrip_wrap") -fileprivate func _bjs_StructRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_StructRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_StructRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_StructRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_SimpleClass_init") @_cdecl("bjs_SimpleClass_init") -public func _bjs_SimpleClass_init(nameBytes: Int32, nameLength: Int32, count: Int32, flag: Int32, rate: Float32, precise: Float64) -> UnsafeMutableRawPointer { +public func _bjs_SimpleClass_init(_ nameBytes: Int32, _ nameLength: Int32, _ count: Int32, _ flag: Int32, _ rate: Float32, _ precise: Float64) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = SimpleClass(name: String.bridgeJSLiftParameter(nameBytes, nameLength), count: Int.bridgeJSLiftParameter(count), flag: Bool.bridgeJSLiftParameter(flag), rate: Float.bridgeJSLiftParameter(rate), precise: Double.bridgeJSLiftParameter(precise)) return ret.bridgeJSLowerReturn() @@ -831,7 +847,7 @@ public func _bjs_SimpleClass_init(nameBytes: Int32, nameLength: Int32, count: In @_expose(wasm, "bjs_SimpleClass_name_get") @_cdecl("bjs_SimpleClass_name_get") -public func _bjs_SimpleClass_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SimpleClass_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SimpleClass.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -842,7 +858,7 @@ public func _bjs_SimpleClass_name_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_SimpleClass_name_set") @_cdecl("bjs_SimpleClass_name_set") -public func _bjs_SimpleClass_name_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_SimpleClass_name_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) SimpleClass.bridgeJSLiftParameter(_self).name = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -852,7 +868,7 @@ public func _bjs_SimpleClass_name_set(_self: UnsafeMutableRawPointer, valueBytes @_expose(wasm, "bjs_SimpleClass_count_get") @_cdecl("bjs_SimpleClass_count_get") -public func _bjs_SimpleClass_count_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_SimpleClass_count_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = SimpleClass.bridgeJSLiftParameter(_self).count return ret.bridgeJSLowerReturn() @@ -863,7 +879,7 @@ public func _bjs_SimpleClass_count_get(_self: UnsafeMutableRawPointer) -> Int32 @_expose(wasm, "bjs_SimpleClass_count_set") @_cdecl("bjs_SimpleClass_count_set") -public func _bjs_SimpleClass_count_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_SimpleClass_count_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) SimpleClass.bridgeJSLiftParameter(_self).count = Int.bridgeJSLiftParameter(value) #else @@ -873,7 +889,7 @@ public func _bjs_SimpleClass_count_set(_self: UnsafeMutableRawPointer, value: In @_expose(wasm, "bjs_SimpleClass_flag_get") @_cdecl("bjs_SimpleClass_flag_get") -public func _bjs_SimpleClass_flag_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_SimpleClass_flag_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = SimpleClass.bridgeJSLiftParameter(_self).flag return ret.bridgeJSLowerReturn() @@ -884,7 +900,7 @@ public func _bjs_SimpleClass_flag_get(_self: UnsafeMutableRawPointer) -> Int32 { @_expose(wasm, "bjs_SimpleClass_flag_set") @_cdecl("bjs_SimpleClass_flag_set") -public func _bjs_SimpleClass_flag_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_SimpleClass_flag_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) SimpleClass.bridgeJSLiftParameter(_self).flag = Bool.bridgeJSLiftParameter(value) #else @@ -894,7 +910,7 @@ public func _bjs_SimpleClass_flag_set(_self: UnsafeMutableRawPointer, value: Int @_expose(wasm, "bjs_SimpleClass_rate_get") @_cdecl("bjs_SimpleClass_rate_get") -public func _bjs_SimpleClass_rate_get(_self: UnsafeMutableRawPointer) -> Float32 { +public func _bjs_SimpleClass_rate_get(_ _self: UnsafeMutableRawPointer) -> Float32 { #if arch(wasm32) let ret = SimpleClass.bridgeJSLiftParameter(_self).rate return ret.bridgeJSLowerReturn() @@ -905,7 +921,7 @@ public func _bjs_SimpleClass_rate_get(_self: UnsafeMutableRawPointer) -> Float32 @_expose(wasm, "bjs_SimpleClass_rate_set") @_cdecl("bjs_SimpleClass_rate_set") -public func _bjs_SimpleClass_rate_set(_self: UnsafeMutableRawPointer, value: Float32) -> Void { +public func _bjs_SimpleClass_rate_set(_ _self: UnsafeMutableRawPointer, _ value: Float32) -> Void { #if arch(wasm32) SimpleClass.bridgeJSLiftParameter(_self).rate = Float.bridgeJSLiftParameter(value) #else @@ -915,7 +931,7 @@ public func _bjs_SimpleClass_rate_set(_self: UnsafeMutableRawPointer, value: Flo @_expose(wasm, "bjs_SimpleClass_precise_get") @_cdecl("bjs_SimpleClass_precise_get") -public func _bjs_SimpleClass_precise_get(_self: UnsafeMutableRawPointer) -> Float64 { +public func _bjs_SimpleClass_precise_get(_ _self: UnsafeMutableRawPointer) -> Float64 { #if arch(wasm32) let ret = SimpleClass.bridgeJSLiftParameter(_self).precise return ret.bridgeJSLowerReturn() @@ -926,7 +942,7 @@ public func _bjs_SimpleClass_precise_get(_self: UnsafeMutableRawPointer) -> Floa @_expose(wasm, "bjs_SimpleClass_precise_set") @_cdecl("bjs_SimpleClass_precise_set") -public func _bjs_SimpleClass_precise_set(_self: UnsafeMutableRawPointer, value: Float64) -> Void { +public func _bjs_SimpleClass_precise_set(_ _self: UnsafeMutableRawPointer, _ value: Float64) -> Void { #if arch(wasm32) SimpleClass.bridgeJSLiftParameter(_self).precise = Double.bridgeJSLiftParameter(value) #else @@ -936,8 +952,12 @@ public func _bjs_SimpleClass_precise_set(_self: UnsafeMutableRawPointer, value: @_expose(wasm, "bjs_SimpleClass_deinit") @_cdecl("bjs_SimpleClass_deinit") -public func _bjs_SimpleClass_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_SimpleClass_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension SimpleClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -948,16 +968,16 @@ extension SimpleClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "Benchmarks", name: "bjs_SimpleClass_wrap") -fileprivate func _bjs_SimpleClass_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_SimpleClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_SimpleClass_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_SimpleClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_AddressClass_init") @_cdecl("bjs_AddressClass_init") -public func _bjs_AddressClass_init(streetBytes: Int32, streetLength: Int32, cityBytes: Int32, cityLength: Int32, zipCode: Int32) -> UnsafeMutableRawPointer { +public func _bjs_AddressClass_init(_ streetBytes: Int32, _ streetLength: Int32, _ cityBytes: Int32, _ cityLength: Int32, _ zipCode: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = AddressClass(street: String.bridgeJSLiftParameter(streetBytes, streetLength), city: String.bridgeJSLiftParameter(cityBytes, cityLength), zipCode: Int.bridgeJSLiftParameter(zipCode)) return ret.bridgeJSLowerReturn() @@ -968,7 +988,7 @@ public func _bjs_AddressClass_init(streetBytes: Int32, streetLength: Int32, city @_expose(wasm, "bjs_AddressClass_street_get") @_cdecl("bjs_AddressClass_street_get") -public func _bjs_AddressClass_street_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_AddressClass_street_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = AddressClass.bridgeJSLiftParameter(_self).street return ret.bridgeJSLowerReturn() @@ -979,7 +999,7 @@ public func _bjs_AddressClass_street_get(_self: UnsafeMutableRawPointer) -> Void @_expose(wasm, "bjs_AddressClass_street_set") @_cdecl("bjs_AddressClass_street_set") -public func _bjs_AddressClass_street_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_AddressClass_street_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) AddressClass.bridgeJSLiftParameter(_self).street = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -989,7 +1009,7 @@ public func _bjs_AddressClass_street_set(_self: UnsafeMutableRawPointer, valueBy @_expose(wasm, "bjs_AddressClass_city_get") @_cdecl("bjs_AddressClass_city_get") -public func _bjs_AddressClass_city_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_AddressClass_city_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = AddressClass.bridgeJSLiftParameter(_self).city return ret.bridgeJSLowerReturn() @@ -1000,7 +1020,7 @@ public func _bjs_AddressClass_city_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_AddressClass_city_set") @_cdecl("bjs_AddressClass_city_set") -public func _bjs_AddressClass_city_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_AddressClass_city_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) AddressClass.bridgeJSLiftParameter(_self).city = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -1010,7 +1030,7 @@ public func _bjs_AddressClass_city_set(_self: UnsafeMutableRawPointer, valueByte @_expose(wasm, "bjs_AddressClass_zipCode_get") @_cdecl("bjs_AddressClass_zipCode_get") -public func _bjs_AddressClass_zipCode_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_AddressClass_zipCode_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = AddressClass.bridgeJSLiftParameter(_self).zipCode return ret.bridgeJSLowerReturn() @@ -1021,7 +1041,7 @@ public func _bjs_AddressClass_zipCode_get(_self: UnsafeMutableRawPointer) -> Int @_expose(wasm, "bjs_AddressClass_zipCode_set") @_cdecl("bjs_AddressClass_zipCode_set") -public func _bjs_AddressClass_zipCode_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_AddressClass_zipCode_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) AddressClass.bridgeJSLiftParameter(_self).zipCode = Int.bridgeJSLiftParameter(value) #else @@ -1031,8 +1051,12 @@ public func _bjs_AddressClass_zipCode_set(_self: UnsafeMutableRawPointer, value: @_expose(wasm, "bjs_AddressClass_deinit") @_cdecl("bjs_AddressClass_deinit") -public func _bjs_AddressClass_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_AddressClass_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension AddressClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -1043,9 +1067,9 @@ extension AddressClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "Benchmarks", name: "bjs_AddressClass_wrap") -fileprivate func _bjs_AddressClass_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_AddressClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_AddressClass_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_AddressClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -1063,7 +1087,7 @@ public func _bjs_ClassRoundtrip_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_ClassRoundtrip_takeSimpleClass") @_cdecl("bjs_ClassRoundtrip_takeSimpleClass") -public func _bjs_ClassRoundtrip_takeSimpleClass(_self: UnsafeMutableRawPointer, value: UnsafeMutableRawPointer) -> Void { +public func _bjs_ClassRoundtrip_takeSimpleClass(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ClassRoundtrip.bridgeJSLiftParameter(_self).takeSimpleClass(_: SimpleClass.bridgeJSLiftParameter(value)) #else @@ -1073,7 +1097,7 @@ public func _bjs_ClassRoundtrip_takeSimpleClass(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_ClassRoundtrip_makeSimpleClass") @_cdecl("bjs_ClassRoundtrip_makeSimpleClass") -public func _bjs_ClassRoundtrip_makeSimpleClass(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_ClassRoundtrip_makeSimpleClass(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = ClassRoundtrip.bridgeJSLiftParameter(_self).makeSimpleClass() return ret.bridgeJSLowerReturn() @@ -1084,7 +1108,7 @@ public func _bjs_ClassRoundtrip_makeSimpleClass(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_ClassRoundtrip_roundtripSimpleClass") @_cdecl("bjs_ClassRoundtrip_roundtripSimpleClass") -public func _bjs_ClassRoundtrip_roundtripSimpleClass(_self: UnsafeMutableRawPointer, value: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_ClassRoundtrip_roundtripSimpleClass(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = ClassRoundtrip.bridgeJSLiftParameter(_self).roundtripSimpleClass(_: SimpleClass.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -1095,7 +1119,7 @@ public func _bjs_ClassRoundtrip_roundtripSimpleClass(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_ClassRoundtrip_takeAddressClass") @_cdecl("bjs_ClassRoundtrip_takeAddressClass") -public func _bjs_ClassRoundtrip_takeAddressClass(_self: UnsafeMutableRawPointer, value: UnsafeMutableRawPointer) -> Void { +public func _bjs_ClassRoundtrip_takeAddressClass(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ClassRoundtrip.bridgeJSLiftParameter(_self).takeAddressClass(_: AddressClass.bridgeJSLiftParameter(value)) #else @@ -1105,7 +1129,7 @@ public func _bjs_ClassRoundtrip_takeAddressClass(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_ClassRoundtrip_makeAddressClass") @_cdecl("bjs_ClassRoundtrip_makeAddressClass") -public func _bjs_ClassRoundtrip_makeAddressClass(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_ClassRoundtrip_makeAddressClass(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = ClassRoundtrip.bridgeJSLiftParameter(_self).makeAddressClass() return ret.bridgeJSLowerReturn() @@ -1116,7 +1140,7 @@ public func _bjs_ClassRoundtrip_makeAddressClass(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_ClassRoundtrip_roundtripAddressClass") @_cdecl("bjs_ClassRoundtrip_roundtripAddressClass") -public func _bjs_ClassRoundtrip_roundtripAddressClass(_self: UnsafeMutableRawPointer, value: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_ClassRoundtrip_roundtripAddressClass(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = ClassRoundtrip.bridgeJSLiftParameter(_self).roundtripAddressClass(_: AddressClass.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -1127,8 +1151,12 @@ public func _bjs_ClassRoundtrip_roundtripAddressClass(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_ClassRoundtrip_deinit") @_cdecl("bjs_ClassRoundtrip_deinit") -public func _bjs_ClassRoundtrip_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ClassRoundtrip_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ClassRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -1139,9 +1167,9 @@ extension ClassRoundtrip: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "Benchmarks", name: "bjs_ClassRoundtrip_wrap") -fileprivate func _bjs_ClassRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ClassRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ClassRoundtrip_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ClassRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Benchmarks/Sources/Generated/BridgeJS.ImportTS.swift b/Benchmarks/Sources/Generated/BridgeJS.ImportTS.swift index e885569d..e6bb84c1 100644 --- a/Benchmarks/Sources/Generated/BridgeJS.ImportTS.swift +++ b/Benchmarks/Sources/Generated/BridgeJS.ImportTS.swift @@ -32,7 +32,8 @@ fileprivate func bjs_benchmarkHelperNoopWithNumber(_ n: Float64) -> Void { #endif func benchmarkHelperNoopWithNumber(_ n: Double) throws(JSException) -> Void { - bjs_benchmarkHelperNoopWithNumber(n.bridgeJSLowerParameter()) + let nValue = n.bridgeJSLowerParameter() + bjs_benchmarkHelperNoopWithNumber(nValue) if let error = _swift_js_take_exception() { throw error } @@ -48,7 +49,9 @@ fileprivate func bjs_benchmarkRunner(_ name: Int32, _ body: Int32) -> Void { #endif func benchmarkRunner(_ name: String, _ body: JSObject) throws(JSException) -> Void { - bjs_benchmarkRunner(name.bridgeJSLowerParameter(), body.bridgeJSLowerParameter()) + let nameValue = name.bridgeJSLowerParameter() + let bodyValue = body.bridgeJSLowerParameter() + bjs_benchmarkRunner(nameValue, bodyValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ExportSwift.swift b/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ExportSwift.swift index be683415..3391b2fd 100644 --- a/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ExportSwift.swift +++ b/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ExportSwift.swift @@ -19,7 +19,7 @@ public func _bjs_PlayBridgeJS_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_PlayBridgeJS_update") @_cdecl("bjs_PlayBridgeJS_update") -public func _bjs_PlayBridgeJS_update(_self: UnsafeMutableRawPointer, swiftSourceBytes: Int32, swiftSourceLength: Int32, dtsSourceBytes: Int32, dtsSourceLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_PlayBridgeJS_update(_ _self: UnsafeMutableRawPointer, _ swiftSourceBytes: Int32, _ swiftSourceLength: Int32, _ dtsSourceBytes: Int32, _ dtsSourceLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) do { let ret = try PlayBridgeJS.bridgeJSLiftParameter(_self).update(swiftSource: String.bridgeJSLiftParameter(swiftSourceBytes, swiftSourceLength), dtsSource: String.bridgeJSLiftParameter(dtsSourceBytes, dtsSourceLength)) @@ -44,8 +44,12 @@ public func _bjs_PlayBridgeJS_update(_self: UnsafeMutableRawPointer, swiftSource @_expose(wasm, "bjs_PlayBridgeJS_deinit") @_cdecl("bjs_PlayBridgeJS_deinit") -public func _bjs_PlayBridgeJS_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PlayBridgeJS_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PlayBridgeJS: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -56,16 +60,16 @@ extension PlayBridgeJS: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "PlayBridgeJS", name: "bjs_PlayBridgeJS_wrap") -fileprivate func _bjs_PlayBridgeJS_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PlayBridgeJS_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PlayBridgeJS_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PlayBridgeJS_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_PlayBridgeJSOutput_outputJs") @_cdecl("bjs_PlayBridgeJSOutput_outputJs") -public func _bjs_PlayBridgeJSOutput_outputJs(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PlayBridgeJSOutput_outputJs(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PlayBridgeJSOutput.bridgeJSLiftParameter(_self).outputJs() return ret.bridgeJSLowerReturn() @@ -76,7 +80,7 @@ public func _bjs_PlayBridgeJSOutput_outputJs(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PlayBridgeJSOutput_outputDts") @_cdecl("bjs_PlayBridgeJSOutput_outputDts") -public func _bjs_PlayBridgeJSOutput_outputDts(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PlayBridgeJSOutput_outputDts(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PlayBridgeJSOutput.bridgeJSLiftParameter(_self).outputDts() return ret.bridgeJSLowerReturn() @@ -87,7 +91,7 @@ public func _bjs_PlayBridgeJSOutput_outputDts(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PlayBridgeJSOutput_importSwiftGlue") @_cdecl("bjs_PlayBridgeJSOutput_importSwiftGlue") -public func _bjs_PlayBridgeJSOutput_importSwiftGlue(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PlayBridgeJSOutput_importSwiftGlue(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PlayBridgeJSOutput.bridgeJSLiftParameter(_self).importSwiftGlue() return ret.bridgeJSLowerReturn() @@ -98,7 +102,7 @@ public func _bjs_PlayBridgeJSOutput_importSwiftGlue(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_PlayBridgeJSOutput_exportSwiftGlue") @_cdecl("bjs_PlayBridgeJSOutput_exportSwiftGlue") -public func _bjs_PlayBridgeJSOutput_exportSwiftGlue(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PlayBridgeJSOutput_exportSwiftGlue(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PlayBridgeJSOutput.bridgeJSLiftParameter(_self).exportSwiftGlue() return ret.bridgeJSLowerReturn() @@ -109,8 +113,12 @@ public func _bjs_PlayBridgeJSOutput_exportSwiftGlue(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_PlayBridgeJSOutput_deinit") @_cdecl("bjs_PlayBridgeJSOutput_deinit") -public func _bjs_PlayBridgeJSOutput_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PlayBridgeJSOutput_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PlayBridgeJSOutput: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -121,9 +129,9 @@ extension PlayBridgeJSOutput: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "PlayBridgeJS", name: "bjs_PlayBridgeJSOutput_wrap") -fileprivate func _bjs_PlayBridgeJSOutput_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PlayBridgeJSOutput_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PlayBridgeJSOutput_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PlayBridgeJSOutput_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ImportTS.swift b/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ImportTS.swift index fca5dcb2..cd1ef981 100644 --- a/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ImportTS.swift +++ b/Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.ImportTS.swift @@ -40,7 +40,9 @@ struct TS2Skeleton: _JSBridgedClass { } func convert(_ ts: String) throws(JSException) -> String { - let ret = bjs_TS2Skeleton_convert(self.bridgeJSLowerParameter(), ts.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let tsValue = ts.bridgeJSLowerParameter() + let ret = bjs_TS2Skeleton_convert(selfValue, tsValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift index e5344a45..e20bb6ab 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift @@ -1986,10 +1986,10 @@ public class ExportSwift { let body: CodeBlockItemListSyntax if effects.isAsync { body = """ - let ret = JSPromise.async { - \(CodeBlockItemListSyntax(self.body)) - }.jsObject - return ret.bridgeJSLowerReturn() + let ret = JSPromise.async { + \(CodeBlockItemListSyntax(self.body)) + }.jsObject + return ret.bridgeJSLowerReturn() """ } else if effects.isThrows { body = """ @@ -2012,17 +2012,20 @@ public class ExportSwift { } else { body = CodeBlockItemListSyntax(self.body) } - return """ - @_expose(wasm, "\(raw: abiName)") - @_cdecl("\(raw: abiName)") - public func _\(raw: abiName)(\(raw: parameterSignature())) -> \(raw: returnSignature()) { - #if arch(wasm32) - \(body) - #else - fatalError("Only available on WebAssembly") - #endif - } - """ + // Build function signature using SwiftSignatureBuilder + let signature = SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: abiParameterSignatures, + returnType: abiReturnType + ) + + // Build function declaration using helper function + let funcDecl = SwiftCodePattern.buildExposedFunctionDecl( + abiName: abiName, + signature: signature, + body: body + ) + + return DeclSyntax(funcDecl) } private func returnPlaceholderStmt() -> String { @@ -2035,19 +2038,6 @@ public class ExportSwift { case .none: return "return" } } - - func parameterSignature() -> String { - var nameAndType: [(name: String, abiType: String)] = [] - for (name, type) in abiParameterSignatures { - nameAndType.append((name, type.swiftType)) - } - return nameAndType.map { "\($0.name): \($0.abiType)" }.joined(separator: ", ") - } - - func returnSignature() -> String { - return abiReturnType?.swiftType ?? "Void" - } - } /// Context for property rendering that determines call behavior and ABI generation @@ -2330,15 +2320,17 @@ public class ExportSwift { } do { - decls.append( - """ - @_expose(wasm, "bjs_\(raw: klass.name)_deinit") - @_cdecl("bjs_\(raw: klass.name)_deinit") - public func _bjs_\(raw: klass.name)_deinit(pointer: UnsafeMutableRawPointer) { - Unmanaged<\(raw: klass.swiftCallName)>.fromOpaque(pointer).release() + let funcDecl = SwiftCodePattern.buildExposedFunctionDecl( + abiName: "bjs_\(klass.name)_deinit", + signature: SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: [("pointer", .pointer)], + returnType: nil + ), + body: CodeBlockItemListSyntax { + "Unmanaged<\(raw: klass.swiftCallName)>.fromOpaque(pointer).release()" } - """ ) + decls.append(DeclSyntax(funcDecl)) } // Generate ConvertibleToJSValue extension @@ -2375,16 +2367,40 @@ public class ExportSwift { } } """ - let externDecl: DeclSyntax = """ - #if arch(wasm32) - @_extern(wasm, module: "\(raw: moduleName)", name: "\(raw: externFunctionName)") - fileprivate func \(raw: wrapFunctionName)(_: UnsafeMutableRawPointer) -> Int32 - #else - fileprivate func \(raw: wrapFunctionName)(_: UnsafeMutableRawPointer) -> Int32 { - fatalError("Only available on WebAssembly") - } - #endif - """ + // Build common function signature + let funcSignature = SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: [("pointer", .pointer)], + returnType: .i32 + ) + + // Build extern function declaration (no body) + let externFuncDecl = SwiftCodePattern.buildExternFunctionDecl( + moduleName: moduleName, + abiName: externFunctionName, + functionName: wrapFunctionName, + signature: funcSignature + ) + + // Build stub function declaration (with fatalError body) + let stubFuncDecl = FunctionDeclSyntax( + modifiers: DeclModifierListSyntax { + DeclModifierSyntax(name: .keyword(.fileprivate)) + }, + funcKeyword: .keyword(.func), + name: .identifier(wrapFunctionName), + signature: funcSignature, + body: CodeBlockSyntax { + "fatalError(\"Only available on WebAssembly\")" + } + ) + + // Use helper function for conditional compilation + let externDecl = DeclSyntax( + SwiftCodePattern.buildWasmConditionalCompilationDecls( + wasmDecl: DeclSyntax(externFuncDecl), + elseDecl: DeclSyntax(stubFuncDecl) + ) + ) return [extensionDecl, externDecl] } } @@ -2413,28 +2429,6 @@ struct ClosureCodegen { } } - private func generateOptionalParameterLowering(_ signature: ClosureSignature) throws -> String { - var lines: [String] = [] - - for (index, paramType) in signature.parameters.enumerated() { - guard case .optional(let wrappedType) = paramType else { - continue - } - let paramName = "param\(index)" - if case .swiftHeapObject = wrappedType { - lines.append( - "let (\(paramName)IsSome, \(paramName)Value) = \(paramName).bridgeJSLowerParameterWithRetain()" - ) - } else { - lines.append( - "let (\(paramName)IsSome, \(paramName)Value) = \(paramName).bridgeJSLowerParameterWithPresence()" - ) - } - } - - return lines.isEmpty ? "" : lines.joined(separator: "\n") + "\n" - } - func renderClosureHelpers(_ signature: ClosureSignature) throws -> [DeclSyntax] { let mangledName = signature.mangleName let helperName = "_BJS_Closure_\(mangledName)" @@ -2448,111 +2442,139 @@ struct ClosureCodegen { let swiftReturnType = signature.returnType.swiftType let closureType = "(\(closureParams))\(swiftEffects) -> \(swiftReturnType)" - var invokeParams: [(name: String, type: String)] = [("_", "Int32")] - var invokeCallArgs: [String] = ["callback.bridgeJSLowerParameter()"] - - for (index, paramType) in signature.parameters.enumerated() { - let paramName = "param\(index)" - - if case .optional(let wrappedType) = paramType { - invokeParams.append(("_", "Int32")) + let externName = "invoke_js_callback_\(signature.moduleName)_\(mangledName)" - switch wrappedType { - case .swiftHeapObject: - invokeParams.append(("_", "UnsafeMutableRawPointer")) - case .string, .rawValueEnum(_, .string): - invokeParams.append(("_", "Int32")) - default: - let lowerInfo = try wrappedType.loweringReturnInfo() - if let wasmType = lowerInfo.returnType { - invokeParams.append(("_", wasmType.swiftType)) - } else { - invokeParams.append(("_", "Int32")) - } - } + // Use CallJSEmission to generate the callback invocation + let builder = ImportTS.CallJSEmission( + moduleName: "bjs", + abiName: externName, + context: .exportSwift + ) - invokeCallArgs.append("\(paramName)IsSome") - invokeCallArgs.append("\(paramName)Value") - } else { - let lowerInfo = try paramType.loweringReturnInfo() - if let wasmType = lowerInfo.returnType { - invokeParams.append(("_", wasmType.swiftType)) - invokeCallArgs.append("\(paramName).bridgeJSLowerParameter()") - } else { - invokeParams.append(("_", "Int32")) - invokeCallArgs.append("\(paramName).bridgeJSLowerParameter()") - } - } - } + // Lower the callback parameter + try builder.lowerParameter(param: Parameter(label: nil, name: "callback", type: .jsObject(nil))) - let invokeSignature = invokeParams.map { "\($0.name): \($0.type)" }.joined(separator: ", ") - let invokeReturnType: String - if case .optional = signature.returnType { - invokeReturnType = "Void" - } else if let wasmType = try signature.returnType.liftingReturnInfo(context: .exportSwift).valueToLift { - invokeReturnType = wasmType.swiftType - } else { - invokeReturnType = "Void" + // Lower each closure parameter + for (index, paramType) in signature.parameters.enumerated() { + try builder.lowerParameter(param: Parameter(label: nil, name: "param\(index)", type: paramType)) } - let externName = "invoke_js_callback_\(signature.moduleName)_\(mangledName)" - - let returnLifting: String - if signature.returnType == .void { - returnLifting = "\(externName)(\(invokeCallArgs.joined(separator: ", ")))" - } else if case .optional = signature.returnType { - returnLifting = """ - \(externName)(\(invokeCallArgs.joined(separator: ", "))) - return \(signature.returnType.swiftType).bridgeJSLiftReturnFromSideChannel() - """ - } else { - returnLifting = """ - let resultId = \(externName)(\(invokeCallArgs.joined(separator: ", "))) - return \(signature.returnType.swiftType).bridgeJSLiftReturn(resultId) - """ - } + // Generate the call and return value lifting + try builder.call(returnType: signature.returnType) + try builder.liftReturnValue(returnType: signature.returnType) - let optionalLoweringCode = try generateOptionalParameterLowering(signature) + // Get the body code + let bodyCode = builder.getBody() - let externDecl: DeclSyntax = """ - @_extern(wasm, module: "bjs", name: "\(raw: externName)") - fileprivate func \(raw: externName)(\(raw: invokeSignature)) -> \(raw: invokeReturnType) - """ + // Generate extern declaration using CallJSEmission + let externDecl = builder.renderImportDecl() - let boxDecl: DeclSyntax = """ + let boxClassDecl: DeclSyntax = """ private final class \(raw: boxClassName): _BridgedSwiftClosureBox { let closure: \(raw: closureType) init(_ closure: @escaping \(raw: closureType)) { self.closure = closure } } + """ - private enum \(raw: helperName) { - static func bridgeJSLower(_ closure: @escaping \(raw: closureType)) -> UnsafeMutableRawPointer { - let box = \(raw: boxClassName)(closure) - return Unmanaged.passRetained(box).toOpaque() - } + let helperEnumDecl = EnumDeclSyntax( + modifiers: DeclModifierListSyntax { + DeclModifierSyntax(name: .keyword(.private)) + }, + name: .identifier(helperName), + memberBlockBuilder: { + DeclSyntax( + FunctionDeclSyntax( + modifiers: DeclModifierListSyntax { + DeclModifierSyntax(name: .keyword(.static)) + }, + name: .identifier("bridgeJSLower"), + signature: FunctionSignatureSyntax( + parameterClause: FunctionParameterClauseSyntax { + FunctionParameterSyntax( + firstName: .wildcardToken(), + secondName: .identifier("closure"), + colon: .colonToken(), + type: TypeSyntax("@escaping \(raw: closureType)") + ) + }, + returnClause: ReturnClauseSyntax( + arrow: .arrowToken(), + type: IdentifierTypeSyntax(name: .identifier("UnsafeMutableRawPointer")) + ) + ), + body: CodeBlockSyntax { + "let box = \(raw: boxClassName)(closure)" + "return Unmanaged.passRetained(box).toOpaque()" + } + ) + ) - static func bridgeJSLift(_ callbackId: Int32) -> \(raw: closureType) { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] \(raw: signature.parameters.indices.map { "param\($0)" }.joined(separator: ", ")) in - #if arch(wasm32) - \(raw: optionalLoweringCode)\(raw: returnLifting) - #else - fatalError("Only available on WebAssembly") - #endif + DeclSyntax( + FunctionDeclSyntax( + modifiers: DeclModifierListSyntax { + DeclModifierSyntax(name: .keyword(.static)) + }, + name: .identifier("bridgeJSLift"), + signature: FunctionSignatureSyntax( + parameterClause: FunctionParameterClauseSyntax { + FunctionParameterSyntax( + firstName: .wildcardToken(), + secondName: .identifier("callbackId"), + colon: .colonToken(), + type: IdentifierTypeSyntax(name: .identifier("Int32")) + ) + }, + returnClause: ReturnClauseSyntax( + arrow: .arrowToken(), + type: IdentifierTypeSyntax(name: .identifier(closureType)) + ) + ), + body: CodeBlockSyntax { + "let callback = JSObject.bridgeJSLiftParameter(callbackId)" + ReturnStmtSyntax( + expression: ClosureExprSyntax( + leftBrace: .leftBraceToken(), + signature: ClosureSignatureSyntax( + capture: ClosureCaptureClauseSyntax( + leftSquare: .leftSquareToken(), + items: ClosureCaptureListSyntax { + ClosureCaptureSyntax( + expression: ExprSyntax("callback") + ) + }, + rightSquare: .rightSquareToken() + ), + parameterClause: .simpleInput( + ClosureShorthandParameterListSyntax { + for (index, _) in signature.parameters.enumerated() { + ClosureShorthandParameterSyntax(name: .identifier("param\(index)")) + } + } + ), + inKeyword: .keyword(.in) + ), + statements: CodeBlockItemListSyntax { + SwiftCodePattern.buildWasmConditionalCompilation(wasmBody: bodyCode.statements) + }, + rightBrace: .rightBraceToken() + ) + ) } - } + ) + ) } - """ - return [externDecl, boxDecl] + ) + return [externDecl, boxClassDecl, DeclSyntax(helperEnumDecl)] } func renderClosureInvokeHandler(_ signature: ClosureSignature) throws -> DeclSyntax { let boxClassName = "_BJS_ClosureBox_\(signature.mangleName)" let abiName = "invoke_swift_closure_\(signature.moduleName)_\(signature.mangleName)" - var abiParams: [(name: String, type: String)] = [("boxPtr", "UnsafeMutableRawPointer")] + // Build ABI parameters directly with WasmCoreType (no string conversion needed) + var abiParams: [(name: String, type: WasmCoreType)] = [("boxPtr", .pointer)] var liftedParams: [String] = [] for (index, paramType) in signature.parameters.enumerated() { @@ -2562,7 +2584,7 @@ struct ClosureCodegen { for (argName, wasmType) in liftInfo.parameters { let fullName = liftInfo.parameters.count > 1 ? "\(paramName)\(argName.capitalizedFirstLetter)" : paramName - abiParams.append((fullName, wasmType.swiftType)) + abiParams.append((fullName, wasmType)) } let argNames = liftInfo.parameters.map { (argName, _) in @@ -2571,40 +2593,43 @@ struct ClosureCodegen { liftedParams.append("\(paramType.swiftType).bridgeJSLiftParameter(\(argNames.joined(separator: ", ")))") } - let paramSignature = abiParams.map { "\($0.name): \($0.type)" }.joined(separator: ", ") - let closureCall = "box.closure(\(liftedParams.joined(separator: ", ")))" - - let returnCode: String - if signature.returnType == .void { - returnCode = closureCall - } else { - returnCode = """ - let result = \(closureCall) - return result.bridgeJSLowerReturn() - """ - } + let closureCallExpr = ExprSyntax("box.closure(\(raw: liftedParams.joined(separator: ", ")))") - let abiReturnType: String + // Determine return type + let abiReturnWasmType: WasmCoreType? if signature.returnType == .void { - abiReturnType = "Void" + abiReturnWasmType = nil } else if let wasmType = try signature.returnType.loweringReturnInfo().returnType { - abiReturnType = wasmType.swiftType + abiReturnWasmType = wasmType } else { - abiReturnType = "Void" + abiReturnWasmType = nil } - return """ - @_expose(wasm, "\(raw: abiName)") - @_cdecl("\(raw: abiName)") - public func _\(raw: abiName)(\(raw: paramSignature)) -> \(raw: abiReturnType) { - #if arch(wasm32) - let box = Unmanaged<\(raw: boxClassName)>.fromOpaque(boxPtr).takeUnretainedValue() - \(raw: returnCode) - #else - fatalError("Only available on WebAssembly") - #endif + // Build signature using SwiftSignatureBuilder + let funcSignature = SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: abiParams, + returnType: abiReturnWasmType + ) + + // Build body + let body = CodeBlockItemListSyntax { + "let box = Unmanaged<\(raw: boxClassName)>.fromOpaque(boxPtr).takeUnretainedValue()" + if signature.returnType == .void { + closureCallExpr + } else { + "let result = \(closureCallExpr)" + "return result.bridgeJSLowerReturn()" } - """ + } + + // Build function declaration using helper + let funcDecl = SwiftCodePattern.buildExposedFunctionDecl( + abiName: abiName, + signature: funcSignature, + body: body + ) + + return DeclSyntax(funcDecl) } } @@ -3072,104 +3097,45 @@ struct ProtocolCodegen { var externDecls: [DeclSyntax] = [] for method in proto.methods { - var swiftParams: [String] = [] - for param in method.parameters { - let label = param.label ?? param.name - if label == param.name { - swiftParams.append("\(param.name): \(param.type.swiftType)") - } else { - swiftParams.append("\(label) \(param.name): \(param.type.swiftType)") - } - } - - var externParams: [String] = ["this: Int32"] - for param in method.parameters { - let loweringInfo = try param.type.loweringParameterInfo(context: .exportSwift) - for (paramName, wasmType) in loweringInfo.loweredParameters { - let fullParamName = - loweringInfo.loweredParameters.count > 1 - ? "\(param.name)\(paramName.capitalizedFirstLetter)" : param.name - externParams.append("\(fullParamName): \(wasmType.swiftType)") - } - } - - var preCallStatements: [String] = [] - var callArgs: [String] = ["this: Int32(bitPattern: jsObject.id)"] + let builder = ImportTS.CallJSEmission( + moduleName: moduleName, + abiName: "_extern_\(method.name)", + context: .exportSwift + ) + try builder.lowerParameter(param: Parameter(label: nil, name: "jsObject", type: .jsObject(nil))) for param in method.parameters { - let loweringInfo = try param.type.loweringParameterInfo(context: .exportSwift) - if case .optional = param.type, loweringInfo.loweredParameters.count > 1 { - let isSomeName = "\(param.name)\(loweringInfo.loweredParameters[0].name.capitalizedFirstLetter)" - let wrappedName = "\(param.name)\(loweringInfo.loweredParameters[1].name.capitalizedFirstLetter)" - preCallStatements.append( - "let (\(isSomeName), \(wrappedName)) = \(param.name).bridgeJSLowerParameterWithPresence()" - ) - callArgs.append("\(isSomeName): \(isSomeName)") - callArgs.append("\(wrappedName): \(wrappedName)") - } else { - callArgs.append("\(param.name): \(param.name).bridgeJSLowerParameter()") - } + try builder.lowerParameter(param: param) } + try builder.call(returnType: method.returnType) + try builder.liftReturnValue(returnType: method.returnType) - let returnTypeStr: String - let externReturnType: String - let callCode: DeclSyntax - - let preCallCode = preCallStatements.isEmpty ? "" : preCallStatements.joined(separator: "\n") + "\n" + // Build function signature using SwiftSignatureBuilder + let signature = SwiftSignatureBuilder.buildFunctionSignature( + parameters: method.parameters, + returnType: method.returnType, + effects: nil + ) - if method.returnType == .void { - returnTypeStr = "" - externReturnType = "" - callCode = """ - \(raw: preCallCode)_extern_\(raw: method.name)(\(raw: callArgs.joined(separator: ", "))) - """ - } else { - returnTypeStr = " -> \(method.returnType.swiftType)" - let liftingInfo = try method.returnType.liftingReturnInfo( - context: .exportSwift + // Build extern declaration using helper function + let externSignature = SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: builder.abiParameterSignatures, + returnType: builder.abiReturnType + ) + let externFuncDecl = SwiftCodePattern.buildExternFunctionDecl( + moduleName: moduleName, + abiName: method.abiName, + functionName: "_extern_\(method.name)", + signature: externSignature + ) + externDecls.append(DeclSyntax(externFuncDecl)) + let methodImplementation = DeclSyntax( + FunctionDeclSyntax( + name: .identifier(method.name), + signature: signature, + body: builder.getBody() ) - - if case .optional = method.returnType { - if let abiType = liftingInfo.valueToLift { - externReturnType = " -> \(abiType.swiftType)" - callCode = """ - \(raw: preCallCode)let ret = _extern_\(raw: method.name)(\(raw: callArgs.joined(separator: ", "))) - return \(raw: method.returnType.swiftType).bridgeJSLiftReturn(ret) - """ - } else { - externReturnType = "" - callCode = """ - \(raw: preCallCode)_extern_\(raw: method.name)(\(raw: callArgs.joined(separator: ", "))) - return \(raw: method.returnType.swiftType).bridgeJSLiftReturn() - """ - } - } else if let abiType = liftingInfo.valueToLift { - externReturnType = " -> \(abiType.swiftType)" - callCode = """ - \(raw: preCallCode)let ret = _extern_\(raw: method.name)(\(raw: callArgs.joined(separator: ", "))) - return \(raw: method.returnType.swiftType).bridgeJSLiftReturn(ret) - """ - } else { - externReturnType = "" - callCode = """ - \(raw: preCallCode)_extern_\(raw: method.name)(\(raw: callArgs.joined(separator: ", "))) - return \(raw: method.returnType.swiftType).bridgeJSLiftReturn() - """ - } - } - - externDecls.append( - """ - @_extern(wasm, module: "\(raw: moduleName)", name: "\(raw: method.abiName)") - fileprivate func _extern_\(raw: method.name)(\(raw: externParams.joined(separator: ", ")))\(raw: externReturnType) - """ ) - let methodImplementation: DeclSyntax = """ - func \(raw: method.name)(\(raw: swiftParams.joined(separator: ", ")))\(raw: returnTypeStr) { - \(raw: callCode) - } - """ - methodDecls.append(methodImplementation) } @@ -3185,20 +3151,35 @@ struct ProtocolCodegen { externDecls.append(contentsOf: propertyExternDecls) } - let allDecls = (methodDecls + propertyDecls).map { $0.description }.joined(separator: "\n\n") - - let structDecl: DeclSyntax = """ - struct \(raw: wrapperName): \(raw: protocolName), _BridgedSwiftProtocolWrapper { - let jsObject: JSObject - - \(raw: allDecls) + let structDecl = StructDeclSyntax( + name: .identifier(wrapperName), + inheritanceClause: InheritanceClauseSyntax( + inheritedTypesBuilder: { + InheritedTypeSyntax(type: IdentifierTypeSyntax(name: .identifier(protocolName))) + InheritedTypeSyntax(type: IdentifierTypeSyntax(name: .identifier("_BridgedSwiftProtocolWrapper"))) + } + ), + memberBlockBuilder: { + DeclSyntax( + """ + let jsObject: JSObject + """ + ).with(\.trailingTrivia, .newlines(2)) - static func bridgeJSLiftParameter(_ value: Int32) -> Self { - return \(raw: wrapperName)(jsObject: JSObject(id: UInt32(bitPattern: value))) + for decl in methodDecls + propertyDecls { + decl.with(\.trailingTrivia, .newlines(2)) } + + DeclSyntax( + """ + static func bridgeJSLiftParameter(_ value: Int32) -> Self { + return \(raw: wrapperName)(jsObject: JSObject(id: UInt32(bitPattern: value))) + } + """ + ) } - """ - return [structDecl] + externDecls + ) + return [DeclSyntax(structDecl)] + externDecls } private func renderProtocolProperty( @@ -3217,87 +3198,98 @@ struct ProtocolCodegen { className: protocolName ) - let usesSideChannel = property.type.usesSideChannelForOptionalReturn() - let liftingInfo = try property.type.liftingReturnInfo(context: .exportSwift) - let getterReturnType: String - let getterBody: String - - if usesSideChannel { - getterReturnType = "" - getterBody = """ - \(getterAbiName)(this: Int32(bitPattern: jsObject.id)) - return \(property.type.swiftType).bridgeJSLiftReturnFromSideChannel() - """ - } else if let abiType = liftingInfo.valueToLift { - getterReturnType = " -> \(abiType.swiftType)" - getterBody = """ - let ret = \(getterAbiName)(this: Int32(bitPattern: jsObject.id)) - return \(property.type.swiftType).bridgeJSLiftReturn(ret) - """ - } else { - getterReturnType = "" - getterBody = """ - \(getterAbiName)(this: Int32(bitPattern: jsObject.id)) - return \(property.type.swiftType).bridgeJSLiftReturn() - """ - } - - let getterExternDecl: DeclSyntax = """ - @_extern(wasm, module: "\(raw: moduleName)", name: "\(raw: getterAbiName)") - fileprivate func \(raw: getterAbiName)(this: Int32)\(raw: getterReturnType) - """ + let getterBuilder = ImportTS.CallJSEmission( + moduleName: moduleName, + abiName: getterAbiName, + context: .exportSwift + ) + try getterBuilder.lowerParameter(param: Parameter(label: nil, name: "jsObject", type: .jsObject(nil))) + try getterBuilder.call(returnType: property.type) + try getterBuilder.liftReturnValue(returnType: property.type) + + // Build getter extern declaration using helper function + let getterExternSignature = SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: getterBuilder.abiParameterSignatures, + returnType: getterBuilder.abiReturnType + ) + let getterExternDecl = SwiftCodePattern.buildExternFunctionDecl( + moduleName: moduleName, + abiName: getterAbiName, + functionName: getterAbiName, + signature: getterExternSignature + ) if property.isReadonly { - return ( - """ - var \(raw: property.name): \(raw: property.type.swiftType) { - get { - \(raw: getterBody) - } + let propertyDecl = VariableDeclSyntax( + bindingSpecifier: .keyword(.var), + bindings: PatternBindingListSyntax { + PatternBindingSyntax( + pattern: IdentifierPatternSyntax(identifier: .identifier(property.name)), + typeAnnotation: TypeAnnotationSyntax( + type: IdentifierTypeSyntax(name: .identifier(property.type.swiftType)) + ), + accessorBlock: AccessorBlockSyntax( + accessors: .accessors( + AccessorDeclListSyntax { + AccessorDeclSyntax( + accessorSpecifier: .keyword(.get), + body: getterBuilder.getBody() + ) + } + ) + ) + ) } - """, - [getterExternDecl] ) + return (DeclSyntax(propertyDecl), [DeclSyntax(getterExternDecl)]) } else { - let loweringInfo = try property.type.loweringParameterInfo(context: .exportSwift) - - let setterParams = - (["this: Int32"] + loweringInfo.loweredParameters.map { "\($0.name): \($0.type.swiftType)" }).joined( - separator: ", " - ) - - let setterBody: String - if case .optional = property.type, loweringInfo.loweredParameters.count > 1 { - let isSomeParam = loweringInfo.loweredParameters[0].name - let wrappedParam = loweringInfo.loweredParameters[1].name - setterBody = """ - let (\(isSomeParam), \(wrappedParam)) = newValue.bridgeJSLowerParameterWithPresence() - \(setterAbiName)(this: Int32(bitPattern: jsObject.id), \(isSomeParam): \(isSomeParam), \(wrappedParam): \(wrappedParam)) - """ - } else { - let paramName = loweringInfo.loweredParameters[0].name - setterBody = - "\(setterAbiName)(this: Int32(bitPattern: jsObject.id), \(paramName): newValue.bridgeJSLowerParameter())" - } - - let setterExternDecl: DeclSyntax = """ - @_extern(wasm, module: "\(raw: moduleName)", name: "\(raw: setterAbiName)") - fileprivate func \(raw: setterAbiName)(\(raw: setterParams)) - """ + let setterBuilder = ImportTS.CallJSEmission( + moduleName: moduleName, + abiName: setterAbiName, + context: .exportSwift + ) + try setterBuilder.lowerParameter(param: Parameter(label: nil, name: "jsObject", type: .jsObject(nil))) + try setterBuilder.lowerParameter(param: Parameter(label: nil, name: "newValue", type: property.type)) + try setterBuilder.call(returnType: .void) + + // Build setter extern declaration using helper function + let setterExternSignature = SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: setterBuilder.abiParameterSignatures, + returnType: setterBuilder.abiReturnType + ) + let setterExternDecl = SwiftCodePattern.buildExternFunctionDecl( + moduleName: moduleName, + abiName: setterAbiName, + functionName: setterAbiName, + signature: setterExternSignature + ) - return ( - """ - var \(raw: property.name): \(raw: property.type.swiftType) { - get { - \(raw: getterBody) - } - set { - \(raw: setterBody) - } + let propertyDecl = VariableDeclSyntax( + bindingSpecifier: .keyword(.var), + bindings: PatternBindingListSyntax { + PatternBindingSyntax( + pattern: IdentifierPatternSyntax(identifier: .identifier(property.name)), + typeAnnotation: TypeAnnotationSyntax( + type: IdentifierTypeSyntax(name: .identifier(property.type.swiftType)) + ), + accessorBlock: AccessorBlockSyntax( + accessors: .accessors( + AccessorDeclListSyntax { + AccessorDeclSyntax( + accessorSpecifier: .keyword(.get), + body: getterBuilder.getBody() + ) + AccessorDeclSyntax( + accessorSpecifier: .keyword(.set), + body: setterBuilder.getBody() + ) + } + ) + ) + ) } - """, - [getterExternDecl, setterExternDecl] ) + return (DeclSyntax(propertyDecl), [DeclSyntax(getterExternDecl), DeclSyntax(setterExternDecl)]) } } } diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift index a3ae96ab..e4f6c89b 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift @@ -56,54 +56,163 @@ public struct ImportTS { return allDecls.map { $0.formatted(using: format).description }.joined(separator: "\n\n") } - class ImportedThunkBuilder { + class CallJSEmission { let abiName: String let moduleName: String + let context: BridgeContext var body: [CodeBlockItemSyntax] = [] var abiParameterForwardings: [LabeledExprSyntax] = [] var abiParameterSignatures: [(name: String, type: WasmCoreType)] = [] var abiReturnType: WasmCoreType? + // Track destructured variable names for multiple lowered parameters + var destructuredVarNames: [String] = [] - init(moduleName: String, abiName: String) { + init(moduleName: String, abiName: String, context: BridgeContext = .importTS) { self.moduleName = moduleName self.abiName = abiName + self.context = context } func lowerParameter(param: Parameter) throws { - let loweringInfo = try param.type.loweringParameterInfo() - assert( - loweringInfo.loweredParameters.count == 1, - "For now, we require a single parameter to be lowered to a single Wasm core type" - ) - let (_, type) = loweringInfo.loweredParameters[0] - abiParameterForwardings.append( - LabeledExprSyntax( - label: param.label, - expression: ExprSyntax("\(raw: param.name).bridgeJSLowerParameter()") + let loweringInfo = try param.type.loweringParameterInfo(context: context) + + // Generate destructured variable names for all lowered parameters + let destructuredNames = loweringInfo.loweredParameters.map { + "\(param.name)\($0.name.capitalizedFirstLetter)" + } + + // Always add destructuring statement to body (unified for single and multiple) + let pattern: PatternSyntax + if destructuredNames.count == 1 { + pattern = PatternSyntax(IdentifierPatternSyntax(identifier: .identifier(destructuredNames[0]))) + } else { + pattern = PatternSyntax( + TuplePatternSyntax { + for name in destructuredNames { + TuplePatternElementSyntax( + pattern: IdentifierPatternSyntax(identifier: .identifier(name)) + ) + } + } + ) + } + + body.append( + CodeBlockItemSyntax( + item: .decl( + DeclSyntax( + VariableDeclSyntax( + bindingSpecifier: .keyword(.let), + bindings: PatternBindingListSyntax { + PatternBindingSyntax( + pattern: pattern, + initializer: InitializerClauseSyntax( + value: ExprSyntax("\(raw: param.name).bridgeJSLowerParameter()") + ) + ) + } + ) + ) + ) ) ) - abiParameterSignatures.append((param.name, type)) + destructuredVarNames.append(contentsOf: destructuredNames) + + // Add to signatures and forwardings (unified for both single and multiple) + for (index, (paramName, type)) in loweringInfo.loweredParameters.enumerated() { + // For single parameter, use param.name; for multiple, use constructed name + let abiParamName: String + if loweringInfo.loweredParameters.count == 1 { + abiParamName = param.name + } else { + abiParamName = "\(param.name)\(paramName.capitalizedFirstLetter)" + } + abiParameterSignatures.append((abiParamName, type)) + + // Always use destructured variable in call without labels + // Swift allows omitting labels when they match parameter names + let callExpr = ExprSyntax("\(raw: destructuredNames[index])") + abiParameterForwardings.append( + LabeledExprSyntax(expression: callExpr) + ) + } } - func call(returnType: BridgeType) { - let call: ExprSyntax = - "\(raw: abiName)(\(raw: abiParameterForwardings.map { $0.description }.joined(separator: ", ")))" + func call(returnType: BridgeType) throws { + // Build function call expression + let callExpr = FunctionCallExprSyntax( + calledExpression: ExprSyntax("\(raw: abiName)"), + leftParen: .leftParenToken(), + arguments: LabeledExprListSyntax { + for forwarding in abiParameterForwardings { + forwarding + } + }, + rightParen: .rightParenToken() + ) + if returnType == .void { - body.append("\(raw: call)") + body.append(CodeBlockItemSyntax(item: .stmt(StmtSyntax(ExpressionStmtSyntax(expression: callExpr))))) + } else if returnType.usesSideChannelForOptionalReturn() { + // Side channel returns don't need "let ret =" + body.append(CodeBlockItemSyntax(item: .stmt(StmtSyntax(ExpressionStmtSyntax(expression: callExpr))))) } else { - body.append("let ret = \(raw: call)") + body.append("let ret = \(raw: callExpr)") + } + + // Add exception check for ImportTS context + if context == .importTS { + body.append("if let error = _swift_js_take_exception() { throw error }") } - body.append("if let error = _swift_js_take_exception() { throw error }") } func liftReturnValue(returnType: BridgeType) throws { - let liftingInfo = try returnType.liftingReturnInfo() - abiReturnType = liftingInfo.valueToLift + let liftingInfo = try returnType.liftingReturnInfo(context: context) + if returnType == .void { + abiReturnType = nil return } - body.append("return \(raw: returnType.swiftType).bridgeJSLiftReturn(ret)") + + if returnType.usesSideChannelForOptionalReturn() { + // Side channel returns: extern function returns Void, value is retrieved via side channel + abiReturnType = nil + body.append( + CodeBlockItemSyntax( + item: .stmt( + StmtSyntax( + ReturnStmtSyntax( + expression: ExprSyntax( + "\(raw: returnType.swiftType).bridgeJSLiftReturnFromSideChannel()" + ) + ) + ) + ) + ) + ) + } else { + abiReturnType = liftingInfo.valueToLift + let liftExpr: ExprSyntax + if liftingInfo.valueToLift != nil { + liftExpr = "\(raw: returnType.swiftType).bridgeJSLiftReturn(ret)" + } else { + liftExpr = "\(raw: returnType.swiftType).bridgeJSLiftReturn()" + } + body.append( + CodeBlockItemSyntax( + item: .stmt( + StmtSyntax( + ReturnStmtSyntax(expression: liftExpr) + ) + ) + ) + ) + } + } + + func getBody() -> CodeBlockSyntax { + return CodeBlockSyntax(statements: CodeBlockItemListSyntax(body)) } func assignThis(returnType: BridgeType) { @@ -115,68 +224,56 @@ public struct ImportTS { } func renderImportDecl() -> DeclSyntax { - let baseDecl = FunctionDeclSyntax( - modifiers: DeclModifierListSyntax(itemsBuilder: { + let signature = SwiftSignatureBuilder.buildABIFunctionSignature( + abiParameters: abiParameterSignatures, + returnType: abiReturnType + ) + + // Build extern function declaration (no body) + let externFuncDecl = FunctionDeclSyntax( + attributes: SwiftCodePattern.buildExternAttribute(moduleName: moduleName, abiName: abiName), + modifiers: DeclModifierListSyntax { DeclModifierSyntax(name: .keyword(.fileprivate)).with(\.trailingTrivia, .space) - }), + }, funcKeyword: .keyword(.func).with(\.trailingTrivia, .space), name: .identifier(abiName), - signature: FunctionSignatureSyntax( - parameterClause: FunctionParameterClauseSyntax(parametersBuilder: { - for param in abiParameterSignatures { - FunctionParameterSyntax( - firstName: .wildcardToken().with(\.trailingTrivia, .space), - secondName: .identifier(param.name), - type: IdentifierTypeSyntax(name: .identifier(param.type.swiftType)) - ) - } - }), - returnClause: ReturnClauseSyntax( - arrow: .arrowToken(), - type: IdentifierTypeSyntax(name: .identifier(abiReturnType.map { $0.swiftType } ?? "Void")) - ) + signature: signature + ) + + // Build stub function declaration (with fatalError body) + let stubFuncDecl = FunctionDeclSyntax( + modifiers: DeclModifierListSyntax { + DeclModifierSyntax(name: .keyword(.fileprivate)).with(\.trailingTrivia, .space) + }, + funcKeyword: .keyword(.func).with(\.trailingTrivia, .space), + name: .identifier(abiName), + signature: signature, + body: CodeBlockSyntax { + "fatalError(\"Only available on WebAssembly\")" + } + ) + + // Use conditional compilation helper + return DeclSyntax( + SwiftCodePattern.buildWasmConditionalCompilationDecls( + wasmDecl: DeclSyntax(externFuncDecl), + elseDecl: DeclSyntax(stubFuncDecl) ) ) - var externDecl = baseDecl - externDecl.attributes = AttributeListSyntax(itemsBuilder: { - "@_extern(wasm, module: \"\(raw: moduleName)\", name: \"\(raw: abiName)\")" - }).with(\.trailingTrivia, .newline) - var stubDecl = baseDecl - stubDecl.body = CodeBlockSyntax { - """ - fatalError("Only available on WebAssembly") - """ - } - return """ - #if arch(wasm32) - \(externDecl) - #else - \(stubDecl) - #endif - """ } func renderThunkDecl(name: String, parameters: [Parameter], returnType: BridgeType) -> DeclSyntax { + let effects = Effects(isAsync: false, isThrows: true) + let signature = SwiftSignatureBuilder.buildFunctionSignature( + parameters: parameters, + returnType: returnType, + effects: effects, + useWildcardLabels: true + ) return DeclSyntax( FunctionDeclSyntax( name: .identifier(name.backtickIfNeeded()), - signature: FunctionSignatureSyntax( - parameterClause: FunctionParameterClauseSyntax(parametersBuilder: { - for param in parameters { - FunctionParameterSyntax( - firstName: .wildcardToken(), - secondName: .identifier(param.name), - colon: .colonToken(), - type: IdentifierTypeSyntax(name: .identifier(param.type.swiftType)) - ) - } - }), - effectSpecifiers: ImportTS.buildFunctionEffect(throws: true, async: false), - returnClause: ReturnClauseSyntax( - arrow: .arrowToken(), - type: IdentifierTypeSyntax(name: .identifier(returnType.swiftType)) - ) - ), + signature: signature, body: CodeBlockSyntax { body } @@ -185,22 +282,18 @@ public struct ImportTS { } func renderConstructorDecl(parameters: [Parameter]) -> DeclSyntax { + let effects = Effects(isAsync: false, isThrows: true) + // Constructors don't have return types, so build signature without return clause + let signature = FunctionSignatureSyntax( + parameterClause: SwiftSignatureBuilder.buildParameterClause( + parameters: parameters, + useWildcardLabels: true + ), + effectSpecifiers: SwiftSignatureBuilder.buildEffectSpecifiers(effects: effects) + ) return DeclSyntax( InitializerDeclSyntax( - signature: FunctionSignatureSyntax( - parameterClause: FunctionParameterClauseSyntax( - parametersBuilder: { - for param in parameters { - FunctionParameterSyntax( - firstName: .wildcardToken(), - secondName: .identifier(param.name), - type: IdentifierTypeSyntax(name: .identifier(param.type.swiftType)) - ) - } - } - ), - effectSpecifiers: ImportTS.buildFunctionEffect(throws: true, async: false) - ), + signature: signature, bodyBuilder: { body } @@ -223,11 +316,11 @@ public struct ImportTS { _ function: ImportedFunctionSkeleton, topLevelDecls: inout [DeclSyntax] ) throws -> [DeclSyntax] { - let builder = ImportedThunkBuilder(moduleName: moduleName, abiName: function.abiName(context: nil)) + let builder = CallJSEmission(moduleName: moduleName, abiName: function.abiName(context: nil)) for param in function.parameters { try builder.lowerParameter(param: param) } - builder.call(returnType: function.returnType) + try builder.call(returnType: function.returnType) try builder.liftReturnValue(returnType: function.returnType) topLevelDecls.append(builder.renderImportDecl()) return [ @@ -244,12 +337,12 @@ public struct ImportTS { let name = type.name func renderMethod(method: ImportedFunctionSkeleton) throws -> [DeclSyntax] { - let builder = ImportedThunkBuilder(moduleName: moduleName, abiName: method.abiName(context: type)) + let builder = CallJSEmission(moduleName: moduleName, abiName: method.abiName(context: type)) try builder.lowerParameter(param: Parameter(label: nil, name: "self", type: .jsObject(name))) for param in method.parameters { try builder.lowerParameter(param: param) } - builder.call(returnType: method.returnType) + try builder.call(returnType: method.returnType) try builder.liftReturnValue(returnType: method.returnType) topLevelDecls.append(builder.renderImportDecl()) return [ @@ -263,11 +356,11 @@ public struct ImportTS { } func renderConstructorDecl(constructor: ImportedConstructorSkeleton) throws -> [DeclSyntax] { - let builder = ImportedThunkBuilder(moduleName: moduleName, abiName: constructor.abiName(context: type)) + let builder = CallJSEmission(moduleName: moduleName, abiName: constructor.abiName(context: type)) for param in constructor.parameters { try builder.lowerParameter(param: param) } - builder.call(returnType: .jsObject(name)) + try builder.call(returnType: .jsObject(name)) builder.assignThis(returnType: .jsObject(name)) topLevelDecls.append(builder.renderImportDecl()) return [ @@ -276,12 +369,12 @@ public struct ImportTS { } func renderGetterDecl(property: ImportedPropertySkeleton) throws -> AccessorDeclSyntax { - let builder = ImportedThunkBuilder( + let builder = CallJSEmission( moduleName: moduleName, abiName: property.getterAbiName(context: type) ) try builder.lowerParameter(param: Parameter(label: nil, name: "self", type: .jsObject(name))) - builder.call(returnType: property.type) + try builder.call(returnType: property.type) try builder.liftReturnValue(returnType: property.type) topLevelDecls.append(builder.renderImportDecl()) return AccessorDeclSyntax( @@ -294,14 +387,14 @@ public struct ImportTS { } func renderSetterDecl(property: ImportedPropertySkeleton) throws -> DeclSyntax { - let builder = ImportedThunkBuilder( + let builder = CallJSEmission( moduleName: moduleName, abiName: property.setterAbiName(context: type) ) let newValue = Parameter(label: nil, name: "newValue", type: property.type) try builder.lowerParameter(param: Parameter(label: nil, name: "self", type: .jsObject(name))) try builder.lowerParameter(param: newValue) - builder.call(returnType: .void) + try builder.call(returnType: .void) topLevelDecls.append(builder.renderImportDecl()) return builder.renderThunkDecl( name: "set\(property.name.capitalizedFirstLetter)", @@ -390,8 +483,8 @@ public struct ImportTS { return Trivia(pieces: lines.flatMap { [TriviaPiece.docLineComment("/// \($0)"), .newlines(1)] }) } - static func buildFunctionEffect(throws: Bool, async: Bool) -> FunctionEffectSpecifiersSyntax { - return FunctionEffectSpecifiersSyntax( + static func buildAccessorEffect(throws: Bool, async: Bool) -> AccessorEffectSpecifiersSyntax { + return AccessorEffectSpecifiersSyntax( asyncSpecifier: `async` ? .keyword(.async) : nil, throwsClause: `throws` ? ThrowsClauseSyntax( @@ -402,10 +495,162 @@ public struct ImportTS { ) : nil ) } - static func buildAccessorEffect(throws: Bool, async: Bool) -> AccessorEffectSpecifiersSyntax { - return AccessorEffectSpecifiersSyntax( - asyncSpecifier: `async` ? .keyword(.async) : nil, - throwsClause: `throws` +} + +/// Unified utility for building Swift function signatures using SwiftSyntax +/// +/// This struct eliminates code duplication by providing a single source of truth +/// for generating Swift function signatures across ImportTS, ExportSwift, and +/// other code generators. +struct SwiftSignatureBuilder { + /// Builds a complete function signature from parameters, return type, and effects + /// + /// - Parameters: + /// - parameters: Array of Parameter structs for Swift function signatures + /// - returnType: The return type of the function + /// - effects: Optional effects (async/throws) + /// - Returns: A FunctionSignatureSyntax node + static func buildFunctionSignature( + parameters: [Parameter], + returnType: BridgeType, + effects: Effects? = nil, + useWildcardLabels: Bool = false + ) -> FunctionSignatureSyntax { + return FunctionSignatureSyntax( + parameterClause: buildParameterClause(parameters: parameters, useWildcardLabels: useWildcardLabels), + effectSpecifiers: effects.flatMap { buildEffectSpecifiers(effects: $0) }, + returnClause: buildReturnClause(returnType: returnType) + ) + } + + /// Builds a function signature for ABI/extern functions using WasmCoreType parameters + /// + /// - Parameters: + /// - abiParameters: Array of (name, WasmCoreType) tuples for ABI signatures + /// - returnType: The return type as WasmCoreType (nil for Void) + /// - effects: Optional effects (async/throws) + /// - Returns: A FunctionSignatureSyntax node + static func buildABIFunctionSignature( + abiParameters: [(name: String, type: WasmCoreType)], + returnType: WasmCoreType?, + effects: Effects? = nil + ) -> FunctionSignatureSyntax { + return FunctionSignatureSyntax( + parameterClause: buildABIParameterClause(abiParameters: abiParameters), + effectSpecifiers: effects.flatMap { buildEffectSpecifiers(effects: $0) }, + returnClause: buildABIReturnClause(returnType: returnType) + ) + } + + /// Builds a parameter clause from an array of Parameter structs + /// + /// - Parameters: + /// - parameters: Array of Parameter structs + /// - useWildcardLabels: If true, all parameters use wildcard labels ("_ name: Type"). + /// If false, handles parameter labels: + /// - If label == name: single identifier (e.g., "count: Int") + /// - If label != name: labeled parameter (e.g., "label count: Int") + /// - If label == nil: wildcard label (e.g., "_ count: Int") + static func buildParameterClause( + parameters: [Parameter], + useWildcardLabels: Bool = false + ) -> FunctionParameterClauseSyntax { + return FunctionParameterClauseSyntax(parametersBuilder: { + for param in parameters { + if useWildcardLabels { + // Always use wildcard labels: "_ name: Type" + FunctionParameterSyntax( + firstName: .wildcardToken(), + secondName: .identifier(param.name), + colon: .colonToken(), + type: buildTypeSyntax(from: param.type) + ) + } else { + let label = param.label ?? param.name + if label == param.name { + // External label same as parameter name: "count: Int" + FunctionParameterSyntax( + firstName: .identifier(label), + secondName: nil, + colon: .colonToken(), + type: buildTypeSyntax(from: param.type) + ) + } else if param.label == nil { + // No label specified: use wildcard "_ name: Type" + FunctionParameterSyntax( + firstName: .wildcardToken(), + secondName: .identifier(param.name), + colon: .colonToken(), + type: buildTypeSyntax(from: param.type) + ) + } else { + // External label differs: "label count: Int" + FunctionParameterSyntax( + firstName: .identifier(label), + secondName: .identifier(param.name), + colon: .colonToken(), + type: buildTypeSyntax(from: param.type) + ) + } + } + } + }) + } + + /// Builds a parameter clause for ABI/extern functions + /// + /// All parameters use wildcard labels: "_ name: Type" + static func buildABIParameterClause( + abiParameters: [(name: String, type: WasmCoreType)] + ) -> FunctionParameterClauseSyntax { + return FunctionParameterClauseSyntax(parametersBuilder: { + for param in abiParameters { + FunctionParameterSyntax( + firstName: .wildcardToken().with(\.trailingTrivia, .space), + secondName: .identifier(param.name), + type: IdentifierTypeSyntax(name: .identifier(param.type.swiftType)) + ) + } + }) + } + + /// Builds a return clause from a BridgeType + /// + /// Always returns a ReturnClauseSyntax, including for Void types + /// (to match original behavior that explicitly includes "-> Void") + static func buildReturnClause(returnType: BridgeType) -> ReturnClauseSyntax? { + return ReturnClauseSyntax( + arrow: .arrowToken(), + type: buildTypeSyntax(from: returnType) + ) + } + + /// Builds a return clause for ABI/extern functions + /// + /// Returns nil for Void (when returnType is nil), otherwise returns a ReturnClauseSyntax + static func buildABIReturnClause(returnType: WasmCoreType?) -> ReturnClauseSyntax? { + guard let returnType = returnType else { + return ReturnClauseSyntax( + arrow: .arrowToken(), + type: IdentifierTypeSyntax(name: .identifier("Void")) + ) + } + return ReturnClauseSyntax( + arrow: .arrowToken(), + type: IdentifierTypeSyntax(name: .identifier(returnType.swiftType)) + ) + } + + /// Builds effect specifiers (async/throws) from an Effects struct + /// + /// Uses JSException as the thrown error type for throws clauses + static func buildEffectSpecifiers(effects: Effects) -> FunctionEffectSpecifiersSyntax? { + guard effects.isAsync || effects.isThrows else { + return nil + } + return FunctionEffectSpecifiersSyntax( + asyncSpecifier: effects.isAsync ? .keyword(.async) : nil, + throwsClause: effects.isThrows ? ThrowsClauseSyntax( throwsSpecifier: .keyword(.throws), leftParen: .leftParenToken(), @@ -414,6 +659,164 @@ public struct ImportTS { ) : nil ) } + + /// Builds a TypeSyntax node from a BridgeType + /// + /// Converts BridgeType to its Swift type representation as a TypeSyntax node + static func buildTypeSyntax(from type: BridgeType) -> TypeSyntax { + let identifierType = IdentifierTypeSyntax(name: .identifier(type.swiftType)) + return TypeSyntax(identifierType) + } +} + +enum SwiftCodePattern { + /// Builds a conditional compilation block with #if arch(wasm32) and #else fatalError + static func buildWasmConditionalCompilation( + wasmBody: CodeBlockItemListSyntax + ) -> IfConfigDeclSyntax { + return IfConfigDeclSyntax( + clauses: IfConfigClauseListSyntax { + IfConfigClauseSyntax( + poundKeyword: .poundIfToken(), + condition: ExprSyntax("arch(wasm32)"), + elements: .statements(wasmBody) + ) + IfConfigClauseSyntax( + poundKeyword: .poundElseToken(), + elements: .statements( + CodeBlockItemListSyntax { + "fatalError(\"Only available on WebAssembly\")" + } + ) + ) + } + ) + } + + /// Builds a conditional compilation block with #if arch(wasm32) and #else for declarations + static func buildWasmConditionalCompilationDecls( + wasmDecl: DeclSyntax, + elseDecl: DeclSyntax + ) -> IfConfigDeclSyntax { + return IfConfigDeclSyntax( + clauses: IfConfigClauseListSyntax { + IfConfigClauseSyntax( + poundKeyword: .poundIfToken(), + condition: ExprSyntax("arch(wasm32)"), + elements: .statements( + CodeBlockItemListSyntax { + CodeBlockItemSyntax(item: .decl(wasmDecl)) + } + ) + ) + IfConfigClauseSyntax( + poundKeyword: .poundElseToken(), + elements: .statements( + CodeBlockItemListSyntax { + CodeBlockItemSyntax(item: .decl(elseDecl)) + } + ) + ) + } + ) + } + + /// Builds the @_extern attribute for WebAssembly extern function declarations + /// Builds an @_extern function declaration (no body, just the declaration) + static func buildExternFunctionDecl( + moduleName: String, + abiName: String, + functionName: String, + signature: FunctionSignatureSyntax + ) -> FunctionDeclSyntax { + return FunctionDeclSyntax( + attributes: buildExternAttribute(moduleName: moduleName, abiName: abiName), + modifiers: DeclModifierListSyntax { + DeclModifierSyntax(name: .keyword(.fileprivate)) + }, + funcKeyword: .keyword(.func), + name: .identifier(functionName), + signature: signature + ) + } + + /// Builds the standard @_expose and @_cdecl attributes for WebAssembly-exposed functions + static func buildExposeAttributes(abiName: String) -> AttributeListSyntax { + return AttributeListSyntax { + AttributeSyntax( + attributeName: IdentifierTypeSyntax(name: .identifier("_expose")), + leftParen: .leftParenToken(), + arguments: .exposeAttributeArguments( + ExposeAttributeArgumentsSyntax( + language: .identifier("wasm"), + comma: .commaToken(), + cxxName: StringLiteralExprSyntax(content: abiName) + ) + ), + rightParen: .rightParenToken() + ) + .with(\.trailingTrivia, .newline) + + AttributeSyntax( + attributeName: IdentifierTypeSyntax(name: .identifier("_cdecl")), + leftParen: .leftParenToken(), + arguments: .string(StringLiteralExprSyntax(content: abiName)), + rightParen: .rightParenToken() + ) + .with(\.trailingTrivia, .newline) + } + } + + /// Builds a function declaration with @_expose/@_cdecl attributes and conditional compilation + static func buildExposedFunctionDecl( + abiName: String, + signature: FunctionSignatureSyntax, + body: CodeBlockItemListSyntax + ) -> FunctionDeclSyntax { + let funcBody = CodeBlockSyntax { + buildWasmConditionalCompilation(wasmBody: body) + } + + return FunctionDeclSyntax( + attributes: buildExposeAttributes(abiName: abiName), + modifiers: DeclModifierListSyntax { + DeclModifierSyntax(name: .keyword(.public)) + }, + funcKeyword: .keyword(.func), + name: .identifier("_\(abiName)"), + signature: signature, + body: funcBody + ) + } + + /// Builds the @_extern attribute for WebAssembly extern function declarations + static func buildExternAttribute(moduleName: String, abiName: String) -> AttributeListSyntax { + return AttributeListSyntax { + AttributeSyntax( + attributeName: IdentifierTypeSyntax(name: .identifier("_extern")), + leftParen: .leftParenToken(), + arguments: .argumentList( + LabeledExprListSyntax { + LabeledExprSyntax( + expression: ExprSyntax("wasm") + ) + LabeledExprSyntax( + label: .identifier("module"), + colon: .colonToken(), + expression: StringLiteralExprSyntax(content: moduleName) + ) + LabeledExprSyntax( + label: .identifier("name"), + colon: .colonToken(), + expression: StringLiteralExprSyntax(content: abiName) + ) + } + ), + rightParen: .rightParenToken() + ) + .with(\.trailingTrivia, .newline) + } + } } extension BridgeType { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Async.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Async.swift index 33ddda25..08e38435 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Async.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Async.swift @@ -21,7 +21,7 @@ public func _bjs_asyncReturnVoid() -> Int32 { @_expose(wasm, "bjs_asyncRoundTripInt") @_cdecl("bjs_asyncRoundTripInt") -public func _bjs_asyncRoundTripInt(v: Int32) -> Int32 { +public func _bjs_asyncRoundTripInt(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripInt(_: Int.bridgeJSLiftParameter(v)).jsValue @@ -34,7 +34,7 @@ public func _bjs_asyncRoundTripInt(v: Int32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripString") @_cdecl("bjs_asyncRoundTripString") -public func _bjs_asyncRoundTripString(vBytes: Int32, vLength: Int32) -> Int32 { +public func _bjs_asyncRoundTripString(_ vBytes: Int32, _ vLength: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripString(_: String.bridgeJSLiftParameter(vBytes, vLength)).jsValue @@ -47,7 +47,7 @@ public func _bjs_asyncRoundTripString(vBytes: Int32, vLength: Int32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripBool") @_cdecl("bjs_asyncRoundTripBool") -public func _bjs_asyncRoundTripBool(v: Int32) -> Int32 { +public func _bjs_asyncRoundTripBool(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripBool(_: Bool.bridgeJSLiftParameter(v)).jsValue @@ -60,7 +60,7 @@ public func _bjs_asyncRoundTripBool(v: Int32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripFloat") @_cdecl("bjs_asyncRoundTripFloat") -public func _bjs_asyncRoundTripFloat(v: Float32) -> Int32 { +public func _bjs_asyncRoundTripFloat(_ v: Float32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripFloat(_: Float.bridgeJSLiftParameter(v)).jsValue @@ -73,7 +73,7 @@ public func _bjs_asyncRoundTripFloat(v: Float32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripDouble") @_cdecl("bjs_asyncRoundTripDouble") -public func _bjs_asyncRoundTripDouble(v: Float64) -> Int32 { +public func _bjs_asyncRoundTripDouble(_ v: Float64) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripDouble(_: Double.bridgeJSLiftParameter(v)).jsValue @@ -86,7 +86,7 @@ public func _bjs_asyncRoundTripDouble(v: Float64) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripJSObject") @_cdecl("bjs_asyncRoundTripJSObject") -public func _bjs_asyncRoundTripJSObject(v: Int32) -> Int32 { +public func _bjs_asyncRoundTripJSObject(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripJSObject(_: JSObject.bridgeJSLiftParameter(v)).jsValue diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.ReverseOrder.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.ReverseOrder.swift index e50c6786..eef86b6d 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.ReverseOrder.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.ReverseOrder.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_standaloneFunction") @_cdecl("bjs_standaloneFunction") -public func _bjs_standaloneFunction(b: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_standaloneFunction(_ b: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = standaloneFunction(b: FunctionB.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -30,7 +30,7 @@ public func _bjs_FunctionA_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_FunctionA_processB") @_cdecl("bjs_FunctionA_processB") -public func _bjs_FunctionA_processB(_self: UnsafeMutableRawPointer, b: UnsafeMutableRawPointer) -> Void { +public func _bjs_FunctionA_processB(_ _self: UnsafeMutableRawPointer, _ b: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = FunctionA.bridgeJSLiftParameter(_self).processB(b: FunctionB.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -41,7 +41,7 @@ public func _bjs_FunctionA_processB(_self: UnsafeMutableRawPointer, b: UnsafeMut @_expose(wasm, "bjs_FunctionA_createB") @_cdecl("bjs_FunctionA_createB") -public func _bjs_FunctionA_createB(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_FunctionA_createB(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = FunctionA.bridgeJSLiftParameter(_self).createB(value: String.bridgeJSLiftParameter(valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -52,8 +52,12 @@ public func _bjs_FunctionA_createB(_self: UnsafeMutableRawPointer, valueBytes: I @_expose(wasm, "bjs_FunctionA_deinit") @_cdecl("bjs_FunctionA_deinit") -public func _bjs_FunctionA_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_FunctionA_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension FunctionA: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -64,16 +68,16 @@ extension FunctionA: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_FunctionA_wrap") -fileprivate func _bjs_FunctionA_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_FunctionA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_FunctionA_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_FunctionA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_FunctionB_init") @_cdecl("bjs_FunctionB_init") -public func _bjs_FunctionB_init(valueBytes: Int32, valueLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_FunctionB_init(_ valueBytes: Int32, _ valueLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = FunctionB(value: String.bridgeJSLiftParameter(valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -84,7 +88,7 @@ public func _bjs_FunctionB_init(valueBytes: Int32, valueLength: Int32) -> Unsafe @_expose(wasm, "bjs_FunctionB_value_get") @_cdecl("bjs_FunctionB_value_get") -public func _bjs_FunctionB_value_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_FunctionB_value_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = FunctionB.bridgeJSLiftParameter(_self).value return ret.bridgeJSLowerReturn() @@ -95,7 +99,7 @@ public func _bjs_FunctionB_value_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_FunctionB_value_set") @_cdecl("bjs_FunctionB_value_set") -public func _bjs_FunctionB_value_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_FunctionB_value_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) FunctionB.bridgeJSLiftParameter(_self).value = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -105,8 +109,12 @@ public func _bjs_FunctionB_value_set(_self: UnsafeMutableRawPointer, valueBytes: @_expose(wasm, "bjs_FunctionB_deinit") @_cdecl("bjs_FunctionB_deinit") -public func _bjs_FunctionB_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_FunctionB_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension FunctionB: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -117,9 +125,9 @@ extension FunctionB: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_FunctionB_wrap") -fileprivate func _bjs_FunctionB_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_FunctionB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_FunctionB_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_FunctionB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.swift index e8077c5c..72952036 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileFunctionTypes.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_standaloneFunction") @_cdecl("bjs_standaloneFunction") -public func _bjs_standaloneFunction(b: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_standaloneFunction(_ b: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = standaloneFunction(b: FunctionB.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -19,7 +19,7 @@ public func _bjs_standaloneFunction(b: UnsafeMutableRawPointer) -> UnsafeMutable @_expose(wasm, "bjs_FunctionB_init") @_cdecl("bjs_FunctionB_init") -public func _bjs_FunctionB_init(valueBytes: Int32, valueLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_FunctionB_init(_ valueBytes: Int32, _ valueLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = FunctionB(value: String.bridgeJSLiftParameter(valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -30,7 +30,7 @@ public func _bjs_FunctionB_init(valueBytes: Int32, valueLength: Int32) -> Unsafe @_expose(wasm, "bjs_FunctionB_value_get") @_cdecl("bjs_FunctionB_value_get") -public func _bjs_FunctionB_value_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_FunctionB_value_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = FunctionB.bridgeJSLiftParameter(_self).value return ret.bridgeJSLowerReturn() @@ -41,7 +41,7 @@ public func _bjs_FunctionB_value_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_FunctionB_value_set") @_cdecl("bjs_FunctionB_value_set") -public func _bjs_FunctionB_value_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_FunctionB_value_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) FunctionB.bridgeJSLiftParameter(_self).value = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -51,8 +51,12 @@ public func _bjs_FunctionB_value_set(_self: UnsafeMutableRawPointer, valueBytes: @_expose(wasm, "bjs_FunctionB_deinit") @_cdecl("bjs_FunctionB_deinit") -public func _bjs_FunctionB_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_FunctionB_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension FunctionB: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -63,9 +67,9 @@ extension FunctionB: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_FunctionB_wrap") -fileprivate func _bjs_FunctionB_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_FunctionB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_FunctionB_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_FunctionB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -83,7 +87,7 @@ public func _bjs_FunctionA_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_FunctionA_processB") @_cdecl("bjs_FunctionA_processB") -public func _bjs_FunctionA_processB(_self: UnsafeMutableRawPointer, b: UnsafeMutableRawPointer) -> Void { +public func _bjs_FunctionA_processB(_ _self: UnsafeMutableRawPointer, _ b: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = FunctionA.bridgeJSLiftParameter(_self).processB(b: FunctionB.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -94,7 +98,7 @@ public func _bjs_FunctionA_processB(_self: UnsafeMutableRawPointer, b: UnsafeMut @_expose(wasm, "bjs_FunctionA_createB") @_cdecl("bjs_FunctionA_createB") -public func _bjs_FunctionA_createB(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_FunctionA_createB(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = FunctionA.bridgeJSLiftParameter(_self).createB(value: String.bridgeJSLiftParameter(valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -105,8 +109,12 @@ public func _bjs_FunctionA_createB(_self: UnsafeMutableRawPointer, valueBytes: I @_expose(wasm, "bjs_FunctionA_deinit") @_cdecl("bjs_FunctionA_deinit") -public func _bjs_FunctionA_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_FunctionA_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension FunctionA: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -117,9 +125,9 @@ extension FunctionA: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_FunctionA_wrap") -fileprivate func _bjs_FunctionA_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_FunctionA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_FunctionA_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_FunctionA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.ReverseOrder.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.ReverseOrder.swift index a270c0e9..7504b289 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.ReverseOrder.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.ReverseOrder.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_ClassA_linkedB_get") @_cdecl("bjs_ClassA_linkedB_get") -public func _bjs_ClassA_linkedB_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ClassA_linkedB_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ClassA.bridgeJSLiftParameter(_self).linkedB return ret.bridgeJSLowerReturn() @@ -19,7 +19,7 @@ public func _bjs_ClassA_linkedB_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_ClassA_linkedB_set") @_cdecl("bjs_ClassA_linkedB_set") -public func _bjs_ClassA_linkedB_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_ClassA_linkedB_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ClassA.bridgeJSLiftParameter(_self).linkedB = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -29,8 +29,12 @@ public func _bjs_ClassA_linkedB_set(_self: UnsafeMutableRawPointer, valueIsSome: @_expose(wasm, "bjs_ClassA_deinit") @_cdecl("bjs_ClassA_deinit") -public func _bjs_ClassA_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ClassA_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ClassA: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -41,9 +45,9 @@ extension ClassA: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_ClassA_wrap") -fileprivate func _bjs_ClassA_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ClassA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ClassA_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ClassA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -61,8 +65,12 @@ public func _bjs_ClassB_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_ClassB_deinit") @_cdecl("bjs_ClassB_deinit") -public func _bjs_ClassB_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ClassB_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ClassB: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -73,9 +81,9 @@ extension ClassB: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_ClassB_wrap") -fileprivate func _bjs_ClassB_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ClassB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ClassB_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ClassB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.swift index ed05f7c2..04130f74 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/CrossFileTypeResolution.swift @@ -19,8 +19,12 @@ public func _bjs_ClassB_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_ClassB_deinit") @_cdecl("bjs_ClassB_deinit") -public func _bjs_ClassB_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ClassB_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ClassB: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -31,16 +35,16 @@ extension ClassB: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_ClassB_wrap") -fileprivate func _bjs_ClassB_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ClassB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ClassB_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ClassB_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_ClassA_linkedB_get") @_cdecl("bjs_ClassA_linkedB_get") -public func _bjs_ClassA_linkedB_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ClassA_linkedB_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ClassA.bridgeJSLiftParameter(_self).linkedB return ret.bridgeJSLowerReturn() @@ -51,7 +55,7 @@ public func _bjs_ClassA_linkedB_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_ClassA_linkedB_set") @_cdecl("bjs_ClassA_linkedB_set") -public func _bjs_ClassA_linkedB_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_ClassA_linkedB_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ClassA.bridgeJSLiftParameter(_self).linkedB = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -61,8 +65,12 @@ public func _bjs_ClassA_linkedB_set(_self: UnsafeMutableRawPointer, valueIsSome: @_expose(wasm, "bjs_ClassA_deinit") @_cdecl("bjs_ClassA_deinit") -public func _bjs_ClassA_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ClassA_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ClassA: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -73,9 +81,9 @@ extension ClassA: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_ClassA_wrap") -fileprivate func _bjs_ClassA_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ClassA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ClassA_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ClassA_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift index 03d037e9..f624dc33 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift @@ -76,7 +76,7 @@ extension MathOperations: _BridgedSwiftStruct { @_expose(wasm, "bjs_MathOperations_init") @_cdecl("bjs_MathOperations_init") -public func _bjs_MathOperations_init(baseValue: Float64) -> Void { +public func _bjs_MathOperations_init(_ baseValue: Float64) -> Void { #if arch(wasm32) let ret = MathOperations(baseValue: Double.bridgeJSLiftParameter(baseValue)) return ret.bridgeJSLowerReturn() @@ -87,7 +87,7 @@ public func _bjs_MathOperations_init(baseValue: Float64) -> Void { @_expose(wasm, "bjs_MathOperations_add") @_cdecl("bjs_MathOperations_add") -public func _bjs_MathOperations_add(a: Float64, b: Float64) -> Float64 { +public func _bjs_MathOperations_add(_ a: Float64, _ b: Float64) -> Float64 { #if arch(wasm32) let ret = MathOperations.bridgeJSLiftParameter().add(a: Double.bridgeJSLiftParameter(a), b: Double.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -98,7 +98,7 @@ public func _bjs_MathOperations_add(a: Float64, b: Float64) -> Float64 { @_expose(wasm, "bjs_MathOperations_multiply") @_cdecl("bjs_MathOperations_multiply") -public func _bjs_MathOperations_multiply(a: Float64, b: Float64) -> Float64 { +public func _bjs_MathOperations_multiply(_ a: Float64, _ b: Float64) -> Float64 { #if arch(wasm32) let ret = MathOperations.bridgeJSLiftParameter().multiply(a: Double.bridgeJSLiftParameter(a), b: Double.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -109,7 +109,7 @@ public func _bjs_MathOperations_multiply(a: Float64, b: Float64) -> Float64 { @_expose(wasm, "bjs_MathOperations_static_subtract") @_cdecl("bjs_MathOperations_static_subtract") -public func _bjs_MathOperations_static_subtract(a: Float64, b: Float64) -> Float64 { +public func _bjs_MathOperations_static_subtract(_ a: Float64, _ b: Float64) -> Float64 { #if arch(wasm32) let ret = MathOperations.subtract(a: Double.bridgeJSLiftParameter(a), b: Double.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -120,7 +120,7 @@ public func _bjs_MathOperations_static_subtract(a: Float64, b: Float64) -> Float @_expose(wasm, "bjs_testStringDefault") @_cdecl("bjs_testStringDefault") -public func _bjs_testStringDefault(messageBytes: Int32, messageLength: Int32) -> Void { +public func _bjs_testStringDefault(_ messageBytes: Int32, _ messageLength: Int32) -> Void { #if arch(wasm32) let ret = testStringDefault(message: String.bridgeJSLiftParameter(messageBytes, messageLength)) return ret.bridgeJSLowerReturn() @@ -131,7 +131,7 @@ public func _bjs_testStringDefault(messageBytes: Int32, messageLength: Int32) -> @_expose(wasm, "bjs_testNegativeIntDefault") @_cdecl("bjs_testNegativeIntDefault") -public func _bjs_testNegativeIntDefault(value: Int32) -> Int32 { +public func _bjs_testNegativeIntDefault(_ value: Int32) -> Int32 { #if arch(wasm32) let ret = testNegativeIntDefault(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -142,7 +142,7 @@ public func _bjs_testNegativeIntDefault(value: Int32) -> Int32 { @_expose(wasm, "bjs_testBoolDefault") @_cdecl("bjs_testBoolDefault") -public func _bjs_testBoolDefault(flag: Int32) -> Int32 { +public func _bjs_testBoolDefault(_ flag: Int32) -> Int32 { #if arch(wasm32) let ret = testBoolDefault(flag: Bool.bridgeJSLiftParameter(flag)) return ret.bridgeJSLowerReturn() @@ -153,7 +153,7 @@ public func _bjs_testBoolDefault(flag: Int32) -> Int32 { @_expose(wasm, "bjs_testNegativeFloatDefault") @_cdecl("bjs_testNegativeFloatDefault") -public func _bjs_testNegativeFloatDefault(temp: Float32) -> Float32 { +public func _bjs_testNegativeFloatDefault(_ temp: Float32) -> Float32 { #if arch(wasm32) let ret = testNegativeFloatDefault(temp: Float.bridgeJSLiftParameter(temp)) return ret.bridgeJSLowerReturn() @@ -164,7 +164,7 @@ public func _bjs_testNegativeFloatDefault(temp: Float32) -> Float32 { @_expose(wasm, "bjs_testDoubleDefault") @_cdecl("bjs_testDoubleDefault") -public func _bjs_testDoubleDefault(precision: Float64) -> Float64 { +public func _bjs_testDoubleDefault(_ precision: Float64) -> Float64 { #if arch(wasm32) let ret = testDoubleDefault(precision: Double.bridgeJSLiftParameter(precision)) return ret.bridgeJSLowerReturn() @@ -175,7 +175,7 @@ public func _bjs_testDoubleDefault(precision: Float64) -> Float64 { @_expose(wasm, "bjs_testOptionalDefault") @_cdecl("bjs_testOptionalDefault") -public func _bjs_testOptionalDefault(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_testOptionalDefault(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = testOptionalDefault(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -186,7 +186,7 @@ public func _bjs_testOptionalDefault(nameIsSome: Int32, nameBytes: Int32, nameLe @_expose(wasm, "bjs_testOptionalStringDefault") @_cdecl("bjs_testOptionalStringDefault") -public func _bjs_testOptionalStringDefault(greetingIsSome: Int32, greetingBytes: Int32, greetingLength: Int32) -> Void { +public func _bjs_testOptionalStringDefault(_ greetingIsSome: Int32, _ greetingBytes: Int32, _ greetingLength: Int32) -> Void { #if arch(wasm32) let ret = testOptionalStringDefault(greeting: Optional.bridgeJSLiftParameter(greetingIsSome, greetingBytes, greetingLength)) return ret.bridgeJSLowerReturn() @@ -197,7 +197,7 @@ public func _bjs_testOptionalStringDefault(greetingIsSome: Int32, greetingBytes: @_expose(wasm, "bjs_testMultipleDefaults") @_cdecl("bjs_testMultipleDefaults") -public func _bjs_testMultipleDefaults(titleBytes: Int32, titleLength: Int32, count: Int32, enabled: Int32) -> Void { +public func _bjs_testMultipleDefaults(_ titleBytes: Int32, _ titleLength: Int32, _ count: Int32, _ enabled: Int32) -> Void { #if arch(wasm32) let ret = testMultipleDefaults(title: String.bridgeJSLiftParameter(titleBytes, titleLength), count: Int.bridgeJSLiftParameter(count), enabled: Bool.bridgeJSLiftParameter(enabled)) return ret.bridgeJSLowerReturn() @@ -208,7 +208,7 @@ public func _bjs_testMultipleDefaults(titleBytes: Int32, titleLength: Int32, cou @_expose(wasm, "bjs_testEnumDefault") @_cdecl("bjs_testEnumDefault") -public func _bjs_testEnumDefault(status: Int32) -> Int32 { +public func _bjs_testEnumDefault(_ status: Int32) -> Int32 { #if arch(wasm32) let ret = testEnumDefault(status: Status.bridgeJSLiftParameter(status)) return ret.bridgeJSLowerReturn() @@ -219,7 +219,7 @@ public func _bjs_testEnumDefault(status: Int32) -> Int32 { @_expose(wasm, "bjs_testComplexInit") @_cdecl("bjs_testComplexInit") -public func _bjs_testComplexInit(greeter: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_testComplexInit(_ greeter: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = testComplexInit(greeter: DefaultGreeter.bridgeJSLiftParameter(greeter)) return ret.bridgeJSLowerReturn() @@ -230,7 +230,7 @@ public func _bjs_testComplexInit(greeter: UnsafeMutableRawPointer) -> UnsafeMuta @_expose(wasm, "bjs_testEmptyInit") @_cdecl("bjs_testEmptyInit") -public func _bjs_testEmptyInit(greeter: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_testEmptyInit(_ greeter: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = testEmptyInit(greeter: EmptyGreeter.bridgeJSLiftParameter(greeter)) return ret.bridgeJSLowerReturn() @@ -241,7 +241,7 @@ public func _bjs_testEmptyInit(greeter: UnsafeMutableRawPointer) -> UnsafeMutabl @_expose(wasm, "bjs_testOptionalStructDefault") @_cdecl("bjs_testOptionalStructDefault") -public func _bjs_testOptionalStructDefault(point: Int32) -> Void { +public func _bjs_testOptionalStructDefault(_ point: Int32) -> Void { #if arch(wasm32) let ret = testOptionalStructDefault(point: Optional.bridgeJSLiftParameter(point)) return ret.bridgeJSLowerReturn() @@ -252,7 +252,7 @@ public func _bjs_testOptionalStructDefault(point: Int32) -> Void { @_expose(wasm, "bjs_testOptionalStructWithValueDefault") @_cdecl("bjs_testOptionalStructWithValueDefault") -public func _bjs_testOptionalStructWithValueDefault(point: Int32) -> Void { +public func _bjs_testOptionalStructWithValueDefault(_ point: Int32) -> Void { #if arch(wasm32) let ret = testOptionalStructWithValueDefault(point: Optional.bridgeJSLiftParameter(point)) return ret.bridgeJSLowerReturn() @@ -263,7 +263,7 @@ public func _bjs_testOptionalStructWithValueDefault(point: Int32) -> Void { @_expose(wasm, "bjs_DefaultGreeter_init") @_cdecl("bjs_DefaultGreeter_init") -public func _bjs_DefaultGreeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_DefaultGreeter_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = DefaultGreeter(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -274,7 +274,7 @@ public func _bjs_DefaultGreeter_init(nameBytes: Int32, nameLength: Int32) -> Uns @_expose(wasm, "bjs_DefaultGreeter_name_get") @_cdecl("bjs_DefaultGreeter_name_get") -public func _bjs_DefaultGreeter_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DefaultGreeter_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DefaultGreeter.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -285,7 +285,7 @@ public func _bjs_DefaultGreeter_name_get(_self: UnsafeMutableRawPointer) -> Void @_expose(wasm, "bjs_DefaultGreeter_name_set") @_cdecl("bjs_DefaultGreeter_name_set") -public func _bjs_DefaultGreeter_name_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_DefaultGreeter_name_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) DefaultGreeter.bridgeJSLiftParameter(_self).name = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -295,8 +295,12 @@ public func _bjs_DefaultGreeter_name_set(_self: UnsafeMutableRawPointer, valueBy @_expose(wasm, "bjs_DefaultGreeter_deinit") @_cdecl("bjs_DefaultGreeter_deinit") -public func _bjs_DefaultGreeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_DefaultGreeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension DefaultGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -307,9 +311,9 @@ extension DefaultGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_DefaultGreeter_wrap") -fileprivate func _bjs_DefaultGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_DefaultGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_DefaultGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_DefaultGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -327,8 +331,12 @@ public func _bjs_EmptyGreeter_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_EmptyGreeter_deinit") @_cdecl("bjs_EmptyGreeter_deinit") -public func _bjs_EmptyGreeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_EmptyGreeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension EmptyGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -339,16 +347,16 @@ extension EmptyGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_EmptyGreeter_wrap") -fileprivate func _bjs_EmptyGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_EmptyGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_EmptyGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_EmptyGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_ConstructorDefaults_init") @_cdecl("bjs_ConstructorDefaults_init") -public func _bjs_ConstructorDefaults_init(nameBytes: Int32, nameLength: Int32, count: Int32, enabled: Int32, status: Int32, tagIsSome: Int32, tagBytes: Int32, tagLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_ConstructorDefaults_init(_ nameBytes: Int32, _ nameLength: Int32, _ count: Int32, _ enabled: Int32, _ status: Int32, _ tagIsSome: Int32, _ tagBytes: Int32, _ tagLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = ConstructorDefaults(name: String.bridgeJSLiftParameter(nameBytes, nameLength), count: Int.bridgeJSLiftParameter(count), enabled: Bool.bridgeJSLiftParameter(enabled), status: Status.bridgeJSLiftParameter(status), tag: Optional.bridgeJSLiftParameter(tagIsSome, tagBytes, tagLength)) return ret.bridgeJSLowerReturn() @@ -359,7 +367,7 @@ public func _bjs_ConstructorDefaults_init(nameBytes: Int32, nameLength: Int32, c @_expose(wasm, "bjs_ConstructorDefaults_name_get") @_cdecl("bjs_ConstructorDefaults_name_get") -public func _bjs_ConstructorDefaults_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ConstructorDefaults_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -370,7 +378,7 @@ public func _bjs_ConstructorDefaults_name_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_ConstructorDefaults_name_set") @_cdecl("bjs_ConstructorDefaults_name_set") -public func _bjs_ConstructorDefaults_name_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_ConstructorDefaults_name_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).name = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -380,7 +388,7 @@ public func _bjs_ConstructorDefaults_name_set(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_ConstructorDefaults_count_get") @_cdecl("bjs_ConstructorDefaults_count_get") -public func _bjs_ConstructorDefaults_count_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_ConstructorDefaults_count_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).count return ret.bridgeJSLowerReturn() @@ -391,7 +399,7 @@ public func _bjs_ConstructorDefaults_count_get(_self: UnsafeMutableRawPointer) - @_expose(wasm, "bjs_ConstructorDefaults_count_set") @_cdecl("bjs_ConstructorDefaults_count_set") -public func _bjs_ConstructorDefaults_count_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_ConstructorDefaults_count_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).count = Int.bridgeJSLiftParameter(value) #else @@ -401,7 +409,7 @@ public func _bjs_ConstructorDefaults_count_set(_self: UnsafeMutableRawPointer, v @_expose(wasm, "bjs_ConstructorDefaults_enabled_get") @_cdecl("bjs_ConstructorDefaults_enabled_get") -public func _bjs_ConstructorDefaults_enabled_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_ConstructorDefaults_enabled_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).enabled return ret.bridgeJSLowerReturn() @@ -412,7 +420,7 @@ public func _bjs_ConstructorDefaults_enabled_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_ConstructorDefaults_enabled_set") @_cdecl("bjs_ConstructorDefaults_enabled_set") -public func _bjs_ConstructorDefaults_enabled_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_ConstructorDefaults_enabled_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).enabled = Bool.bridgeJSLiftParameter(value) #else @@ -422,7 +430,7 @@ public func _bjs_ConstructorDefaults_enabled_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_ConstructorDefaults_status_get") @_cdecl("bjs_ConstructorDefaults_status_get") -public func _bjs_ConstructorDefaults_status_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_ConstructorDefaults_status_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).status return ret.bridgeJSLowerReturn() @@ -433,7 +441,7 @@ public func _bjs_ConstructorDefaults_status_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_ConstructorDefaults_status_set") @_cdecl("bjs_ConstructorDefaults_status_set") -public func _bjs_ConstructorDefaults_status_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_ConstructorDefaults_status_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).status = Status.bridgeJSLiftParameter(value) #else @@ -443,7 +451,7 @@ public func _bjs_ConstructorDefaults_status_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_ConstructorDefaults_tag_get") @_cdecl("bjs_ConstructorDefaults_tag_get") -public func _bjs_ConstructorDefaults_tag_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ConstructorDefaults_tag_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).tag return ret.bridgeJSLowerReturn() @@ -454,7 +462,7 @@ public func _bjs_ConstructorDefaults_tag_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_ConstructorDefaults_tag_set") @_cdecl("bjs_ConstructorDefaults_tag_set") -public func _bjs_ConstructorDefaults_tag_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_ConstructorDefaults_tag_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).tag = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -464,8 +472,12 @@ public func _bjs_ConstructorDefaults_tag_set(_self: UnsafeMutableRawPointer, val @_expose(wasm, "bjs_ConstructorDefaults_deinit") @_cdecl("bjs_ConstructorDefaults_deinit") -public func _bjs_ConstructorDefaults_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ConstructorDefaults_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ConstructorDefaults: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -476,9 +488,9 @@ extension ConstructorDefaults: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_ConstructorDefaults_wrap") -fileprivate func _bjs_ConstructorDefaults_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ConstructorDefaults_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ConstructorDefaults_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ConstructorDefaults_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift index bcc95ef4..1a1bc9ba 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift @@ -491,7 +491,7 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { @_expose(wasm, "bjs_handle") @_cdecl("bjs_handle") -public func _bjs_handle(result: Int32) -> Void { +public func _bjs_handle(_ result: Int32) -> Void { #if arch(wasm32) handle(result: APIResult.bridgeJSLiftParameter(result)) #else @@ -512,7 +512,7 @@ public func _bjs_getResult() -> Void { @_expose(wasm, "bjs_roundtripAPIResult") @_cdecl("bjs_roundtripAPIResult") -public func _bjs_roundtripAPIResult(result: Int32) -> Void { +public func _bjs_roundtripAPIResult(_ result: Int32) -> Void { #if arch(wasm32) let ret = roundtripAPIResult(result: APIResult.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -523,7 +523,7 @@ public func _bjs_roundtripAPIResult(result: Int32) -> Void { @_expose(wasm, "bjs_roundTripOptionalAPIResult") @_cdecl("bjs_roundTripOptionalAPIResult") -public func _bjs_roundTripOptionalAPIResult(resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalAPIResult(_ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalAPIResult(result: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) return ret.bridgeJSLowerReturn() @@ -534,7 +534,7 @@ public func _bjs_roundTripOptionalAPIResult(resultIsSome: Int32, resultCaseId: I @_expose(wasm, "bjs_handleComplex") @_cdecl("bjs_handleComplex") -public func _bjs_handleComplex(result: Int32) -> Void { +public func _bjs_handleComplex(_ result: Int32) -> Void { #if arch(wasm32) handleComplex(result: ComplexResult.bridgeJSLiftParameter(result)) #else @@ -555,7 +555,7 @@ public func _bjs_getComplexResult() -> Void { @_expose(wasm, "bjs_roundtripComplexResult") @_cdecl("bjs_roundtripComplexResult") -public func _bjs_roundtripComplexResult(result: Int32) -> Void { +public func _bjs_roundtripComplexResult(_ result: Int32) -> Void { #if arch(wasm32) let ret = roundtripComplexResult(_: ComplexResult.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -566,7 +566,7 @@ public func _bjs_roundtripComplexResult(result: Int32) -> Void { @_expose(wasm, "bjs_roundTripOptionalComplexResult") @_cdecl("bjs_roundTripOptionalComplexResult") -public func _bjs_roundTripOptionalComplexResult(resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalComplexResult(_ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalComplexResult(result: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) return ret.bridgeJSLowerReturn() @@ -577,7 +577,7 @@ public func _bjs_roundTripOptionalComplexResult(resultIsSome: Int32, resultCaseI @_expose(wasm, "bjs_roundTripOptionalUtilitiesResult") @_cdecl("bjs_roundTripOptionalUtilitiesResult") -public func _bjs_roundTripOptionalUtilitiesResult(resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalUtilitiesResult(_ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalUtilitiesResult(result: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) return ret.bridgeJSLowerReturn() @@ -588,7 +588,7 @@ public func _bjs_roundTripOptionalUtilitiesResult(resultIsSome: Int32, resultCas @_expose(wasm, "bjs_roundTripOptionalNetworkingResult") @_cdecl("bjs_roundTripOptionalNetworkingResult") -public func _bjs_roundTripOptionalNetworkingResult(resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalNetworkingResult(_ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalNetworkingResult(result: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) return ret.bridgeJSLowerReturn() @@ -599,7 +599,7 @@ public func _bjs_roundTripOptionalNetworkingResult(resultIsSome: Int32, resultCa @_expose(wasm, "bjs_roundTripOptionalAPIOptionalResult") @_cdecl("bjs_roundTripOptionalAPIOptionalResult") -public func _bjs_roundTripOptionalAPIOptionalResult(resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalAPIOptionalResult(_ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalAPIOptionalResult(result: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) return ret.bridgeJSLowerReturn() @@ -610,7 +610,7 @@ public func _bjs_roundTripOptionalAPIOptionalResult(resultIsSome: Int32, resultC @_expose(wasm, "bjs_compareAPIResults") @_cdecl("bjs_compareAPIResults") -public func _bjs_compareAPIResults(result1IsSome: Int32, result1CaseId: Int32, result2IsSome: Int32, result2CaseId: Int32) -> Void { +public func _bjs_compareAPIResults(_ result1IsSome: Int32, _ result1CaseId: Int32, _ result2IsSome: Int32, _ result2CaseId: Int32) -> Void { #if arch(wasm32) let _tmp_result2 = Optional.bridgeJSLiftParameter(result2IsSome, result2CaseId) let _tmp_result1 = Optional.bridgeJSLiftParameter(result1IsSome, result1CaseId) diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumCase.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumCase.swift index 06bfa86a..a513a22a 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumCase.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumCase.swift @@ -164,7 +164,7 @@ extension PublicStatus: _BridgedSwiftCaseEnum { @_expose(wasm, "bjs_setDirection") @_cdecl("bjs_setDirection") -public func _bjs_setDirection(direction: Int32) -> Void { +public func _bjs_setDirection(_ direction: Int32) -> Void { #if arch(wasm32) setDirection(_: Direction.bridgeJSLiftParameter(direction)) #else @@ -185,7 +185,7 @@ public func _bjs_getDirection() -> Int32 { @_expose(wasm, "bjs_processDirection") @_cdecl("bjs_processDirection") -public func _bjs_processDirection(input: Int32) -> Int32 { +public func _bjs_processDirection(_ input: Int32) -> Int32 { #if arch(wasm32) let ret = processDirection(_: Direction.bridgeJSLiftParameter(input)) return ret.bridgeJSLowerReturn() @@ -196,7 +196,7 @@ public func _bjs_processDirection(input: Int32) -> Int32 { @_expose(wasm, "bjs_roundTripOptionalDirection") @_cdecl("bjs_roundTripOptionalDirection") -public func _bjs_roundTripOptionalDirection(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalDirection(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalDirection(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -207,7 +207,7 @@ public func _bjs_roundTripOptionalDirection(inputIsSome: Int32, inputValue: Int3 @_expose(wasm, "bjs_setTSDirection") @_cdecl("bjs_setTSDirection") -public func _bjs_setTSDirection(direction: Int32) -> Void { +public func _bjs_setTSDirection(_ direction: Int32) -> Void { #if arch(wasm32) setTSDirection(_: TSDirection.bridgeJSLiftParameter(direction)) #else @@ -228,7 +228,7 @@ public func _bjs_getTSDirection() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalTSDirection") @_cdecl("bjs_roundTripOptionalTSDirection") -public func _bjs_roundTripOptionalTSDirection(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalTSDirection(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTSDirection(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.Global.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.Global.swift index cf497750..66f8e22a 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.Global.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.Global.swift @@ -103,7 +103,7 @@ public func _bjs_Converter_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Converter_toString") @_cdecl("bjs_Converter_toString") -public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_Converter_toString(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) let ret = Utils.Converter.bridgeJSLiftParameter(_self).toString(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -114,8 +114,12 @@ public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32 @_expose(wasm, "bjs_Converter_deinit") @_cdecl("bjs_Converter_deinit") -public func _bjs_Converter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Converter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Utils.Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -126,9 +130,9 @@ extension Utils.Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Converter_wrap") -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -146,7 +150,7 @@ public func _bjs_HTTPServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_HTTPServer_call") @_cdecl("bjs_HTTPServer_call") -public func _bjs_HTTPServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_HTTPServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) Networking.API.HTTPServer.bridgeJSLiftParameter(_self).call(_: Networking.API.Method.bridgeJSLiftParameter(method)) #else @@ -156,8 +160,12 @@ public func _bjs_HTTPServer_call(_self: UnsafeMutableRawPointer, method: Int32) @_expose(wasm, "bjs_HTTPServer_deinit") @_cdecl("bjs_HTTPServer_deinit") -public func _bjs_HTTPServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_HTTPServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Networking.API.HTTPServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -168,9 +176,9 @@ extension Networking.API.HTTPServer: ConvertibleToJSValue, _BridgedSwiftHeapObje #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_HTTPServer_wrap") -fileprivate func _bjs_HTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_HTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_HTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_HTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -188,7 +196,7 @@ public func _bjs_TestServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_TestServer_call") @_cdecl("bjs_TestServer_call") -public func _bjs_TestServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_TestServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) Internal.TestServer.bridgeJSLiftParameter(_self).call(_: Internal.SupportedMethod.bridgeJSLiftParameter(method)) #else @@ -198,8 +206,12 @@ public func _bjs_TestServer_call(_self: UnsafeMutableRawPointer, method: Int32) @_expose(wasm, "bjs_TestServer_deinit") @_cdecl("bjs_TestServer_deinit") -public func _bjs_TestServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_TestServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Internal.TestServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -210,9 +222,9 @@ extension Internal.TestServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_TestServer_wrap") -fileprivate func _bjs_TestServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_TestServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_TestServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_TestServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.swift index cf497750..66f8e22a 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumNamespace.swift @@ -103,7 +103,7 @@ public func _bjs_Converter_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Converter_toString") @_cdecl("bjs_Converter_toString") -public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_Converter_toString(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) let ret = Utils.Converter.bridgeJSLiftParameter(_self).toString(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -114,8 +114,12 @@ public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32 @_expose(wasm, "bjs_Converter_deinit") @_cdecl("bjs_Converter_deinit") -public func _bjs_Converter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Converter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Utils.Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -126,9 +130,9 @@ extension Utils.Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Converter_wrap") -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -146,7 +150,7 @@ public func _bjs_HTTPServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_HTTPServer_call") @_cdecl("bjs_HTTPServer_call") -public func _bjs_HTTPServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_HTTPServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) Networking.API.HTTPServer.bridgeJSLiftParameter(_self).call(_: Networking.API.Method.bridgeJSLiftParameter(method)) #else @@ -156,8 +160,12 @@ public func _bjs_HTTPServer_call(_self: UnsafeMutableRawPointer, method: Int32) @_expose(wasm, "bjs_HTTPServer_deinit") @_cdecl("bjs_HTTPServer_deinit") -public func _bjs_HTTPServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_HTTPServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Networking.API.HTTPServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -168,9 +176,9 @@ extension Networking.API.HTTPServer: ConvertibleToJSValue, _BridgedSwiftHeapObje #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_HTTPServer_wrap") -fileprivate func _bjs_HTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_HTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_HTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_HTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -188,7 +196,7 @@ public func _bjs_TestServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_TestServer_call") @_cdecl("bjs_TestServer_call") -public func _bjs_TestServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_TestServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) Internal.TestServer.bridgeJSLiftParameter(_self).call(_: Internal.SupportedMethod.bridgeJSLiftParameter(method)) #else @@ -198,8 +206,12 @@ public func _bjs_TestServer_call(_self: UnsafeMutableRawPointer, method: Int32) @_expose(wasm, "bjs_TestServer_deinit") @_cdecl("bjs_TestServer_deinit") -public func _bjs_TestServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_TestServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Internal.TestServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -210,9 +222,9 @@ extension Internal.TestServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_TestServer_wrap") -fileprivate func _bjs_TestServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_TestServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_TestServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_TestServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumRawType.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumRawType.swift index 9e03a665..5d88fce4 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumRawType.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumRawType.swift @@ -44,7 +44,7 @@ extension Ratio: _BridgedSwiftEnumNoPayload { @_expose(wasm, "bjs_setTheme") @_cdecl("bjs_setTheme") -public func _bjs_setTheme(themeBytes: Int32, themeLength: Int32) -> Void { +public func _bjs_setTheme(_ themeBytes: Int32, _ themeLength: Int32) -> Void { #if arch(wasm32) setTheme(_: Theme.bridgeJSLiftParameter(themeBytes, themeLength)) #else @@ -65,7 +65,7 @@ public func _bjs_getTheme() -> Void { @_expose(wasm, "bjs_roundTripOptionalTheme") @_cdecl("bjs_roundTripOptionalTheme") -public func _bjs_roundTripOptionalTheme(inputIsSome: Int32, inputBytes: Int32, inputLength: Int32) -> Void { +public func _bjs_roundTripOptionalTheme(_ inputIsSome: Int32, _ inputBytes: Int32, _ inputLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTheme(_: Optional.bridgeJSLiftParameter(inputIsSome, inputBytes, inputLength)) return ret.bridgeJSLowerReturn() @@ -76,7 +76,7 @@ public func _bjs_roundTripOptionalTheme(inputIsSome: Int32, inputBytes: Int32, i @_expose(wasm, "bjs_setTSTheme") @_cdecl("bjs_setTSTheme") -public func _bjs_setTSTheme(themeBytes: Int32, themeLength: Int32) -> Void { +public func _bjs_setTSTheme(_ themeBytes: Int32, _ themeLength: Int32) -> Void { #if arch(wasm32) setTSTheme(_: TSTheme.bridgeJSLiftParameter(themeBytes, themeLength)) #else @@ -97,7 +97,7 @@ public func _bjs_getTSTheme() -> Void { @_expose(wasm, "bjs_roundTripOptionalTSTheme") @_cdecl("bjs_roundTripOptionalTSTheme") -public func _bjs_roundTripOptionalTSTheme(inputIsSome: Int32, inputBytes: Int32, inputLength: Int32) -> Void { +public func _bjs_roundTripOptionalTSTheme(_ inputIsSome: Int32, _ inputBytes: Int32, _ inputLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTSTheme(_: Optional.bridgeJSLiftParameter(inputIsSome, inputBytes, inputLength)) return ret.bridgeJSLowerReturn() @@ -108,7 +108,7 @@ public func _bjs_roundTripOptionalTSTheme(inputIsSome: Int32, inputBytes: Int32, @_expose(wasm, "bjs_setFeatureFlag") @_cdecl("bjs_setFeatureFlag") -public func _bjs_setFeatureFlag(flag: Int32) -> Void { +public func _bjs_setFeatureFlag(_ flag: Int32) -> Void { #if arch(wasm32) setFeatureFlag(_: FeatureFlag.bridgeJSLiftParameter(flag)) #else @@ -129,7 +129,7 @@ public func _bjs_getFeatureFlag() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalFeatureFlag") @_cdecl("bjs_roundTripOptionalFeatureFlag") -public func _bjs_roundTripOptionalFeatureFlag(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalFeatureFlag(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalFeatureFlag(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -140,7 +140,7 @@ public func _bjs_roundTripOptionalFeatureFlag(inputIsSome: Int32, inputValue: In @_expose(wasm, "bjs_setHttpStatus") @_cdecl("bjs_setHttpStatus") -public func _bjs_setHttpStatus(status: Int32) -> Void { +public func _bjs_setHttpStatus(_ status: Int32) -> Void { #if arch(wasm32) setHttpStatus(_: HttpStatus.bridgeJSLiftParameter(status)) #else @@ -161,7 +161,7 @@ public func _bjs_getHttpStatus() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalHttpStatus") @_cdecl("bjs_roundTripOptionalHttpStatus") -public func _bjs_roundTripOptionalHttpStatus(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalHttpStatus(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalHttpStatus(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -172,7 +172,7 @@ public func _bjs_roundTripOptionalHttpStatus(inputIsSome: Int32, inputValue: Int @_expose(wasm, "bjs_setTSHttpStatus") @_cdecl("bjs_setTSHttpStatus") -public func _bjs_setTSHttpStatus(status: Int32) -> Void { +public func _bjs_setTSHttpStatus(_ status: Int32) -> Void { #if arch(wasm32) setTSHttpStatus(_: TSHttpStatus.bridgeJSLiftParameter(status)) #else @@ -193,7 +193,7 @@ public func _bjs_getTSHttpStatus() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalHttpStatus") @_cdecl("bjs_roundTripOptionalHttpStatus") -public func _bjs_roundTripOptionalHttpStatus(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalHttpStatus(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalHttpStatus(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -204,7 +204,7 @@ public func _bjs_roundTripOptionalHttpStatus(inputIsSome: Int32, inputValue: Int @_expose(wasm, "bjs_setPriority") @_cdecl("bjs_setPriority") -public func _bjs_setPriority(priority: Int32) -> Void { +public func _bjs_setPriority(_ priority: Int32) -> Void { #if arch(wasm32) setPriority(_: Priority.bridgeJSLiftParameter(priority)) #else @@ -225,7 +225,7 @@ public func _bjs_getPriority() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalPriority") @_cdecl("bjs_roundTripOptionalPriority") -public func _bjs_roundTripOptionalPriority(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalPriority(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalPriority(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -236,7 +236,7 @@ public func _bjs_roundTripOptionalPriority(inputIsSome: Int32, inputValue: Int32 @_expose(wasm, "bjs_setFileSize") @_cdecl("bjs_setFileSize") -public func _bjs_setFileSize(size: Int32) -> Void { +public func _bjs_setFileSize(_ size: Int32) -> Void { #if arch(wasm32) setFileSize(_: FileSize.bridgeJSLiftParameter(size)) #else @@ -257,7 +257,7 @@ public func _bjs_getFileSize() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalFileSize") @_cdecl("bjs_roundTripOptionalFileSize") -public func _bjs_roundTripOptionalFileSize(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalFileSize(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalFileSize(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -268,7 +268,7 @@ public func _bjs_roundTripOptionalFileSize(inputIsSome: Int32, inputValue: Int32 @_expose(wasm, "bjs_setUserId") @_cdecl("bjs_setUserId") -public func _bjs_setUserId(id: Int32) -> Void { +public func _bjs_setUserId(_ id: Int32) -> Void { #if arch(wasm32) setUserId(_: UserId.bridgeJSLiftParameter(id)) #else @@ -289,7 +289,7 @@ public func _bjs_getUserId() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalUserId") @_cdecl("bjs_roundTripOptionalUserId") -public func _bjs_roundTripOptionalUserId(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalUserId(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalUserId(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -300,7 +300,7 @@ public func _bjs_roundTripOptionalUserId(inputIsSome: Int32, inputValue: Int32) @_expose(wasm, "bjs_setTokenId") @_cdecl("bjs_setTokenId") -public func _bjs_setTokenId(token: Int32) -> Void { +public func _bjs_setTokenId(_ token: Int32) -> Void { #if arch(wasm32) setTokenId(_: TokenId.bridgeJSLiftParameter(token)) #else @@ -321,7 +321,7 @@ public func _bjs_getTokenId() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalTokenId") @_cdecl("bjs_roundTripOptionalTokenId") -public func _bjs_roundTripOptionalTokenId(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalTokenId(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTokenId(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -332,7 +332,7 @@ public func _bjs_roundTripOptionalTokenId(inputIsSome: Int32, inputValue: Int32) @_expose(wasm, "bjs_setSessionId") @_cdecl("bjs_setSessionId") -public func _bjs_setSessionId(session: Int32) -> Void { +public func _bjs_setSessionId(_ session: Int32) -> Void { #if arch(wasm32) setSessionId(_: SessionId.bridgeJSLiftParameter(session)) #else @@ -353,7 +353,7 @@ public func _bjs_getSessionId() -> Int32 { @_expose(wasm, "bjs_roundTripOptionalSessionId") @_cdecl("bjs_roundTripOptionalSessionId") -public func _bjs_roundTripOptionalSessionId(inputIsSome: Int32, inputValue: Int32) -> Void { +public func _bjs_roundTripOptionalSessionId(_ inputIsSome: Int32, _ inputValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalSessionId(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -364,7 +364,7 @@ public func _bjs_roundTripOptionalSessionId(inputIsSome: Int32, inputValue: Int3 @_expose(wasm, "bjs_setPrecision") @_cdecl("bjs_setPrecision") -public func _bjs_setPrecision(precision: Float32) -> Void { +public func _bjs_setPrecision(_ precision: Float32) -> Void { #if arch(wasm32) setPrecision(_: Precision.bridgeJSLiftParameter(precision)) #else @@ -385,7 +385,7 @@ public func _bjs_getPrecision() -> Float32 { @_expose(wasm, "bjs_roundTripOptionalPrecision") @_cdecl("bjs_roundTripOptionalPrecision") -public func _bjs_roundTripOptionalPrecision(inputIsSome: Int32, inputValue: Float32) -> Void { +public func _bjs_roundTripOptionalPrecision(_ inputIsSome: Int32, _ inputValue: Float32) -> Void { #if arch(wasm32) let ret = roundTripOptionalPrecision(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -396,7 +396,7 @@ public func _bjs_roundTripOptionalPrecision(inputIsSome: Int32, inputValue: Floa @_expose(wasm, "bjs_setRatio") @_cdecl("bjs_setRatio") -public func _bjs_setRatio(ratio: Float64) -> Void { +public func _bjs_setRatio(_ ratio: Float64) -> Void { #if arch(wasm32) setRatio(_: Ratio.bridgeJSLiftParameter(ratio)) #else @@ -417,7 +417,7 @@ public func _bjs_getRatio() -> Float64 { @_expose(wasm, "bjs_roundTripOptionalRatio") @_cdecl("bjs_roundTripOptionalRatio") -public func _bjs_roundTripOptionalRatio(inputIsSome: Int32, inputValue: Float64) -> Void { +public func _bjs_roundTripOptionalRatio(_ inputIsSome: Int32, _ inputValue: Float64) -> Void { #if arch(wasm32) let ret = roundTripOptionalRatio(_: Optional.bridgeJSLiftParameter(inputIsSome, inputValue)) return ret.bridgeJSLowerReturn() @@ -428,7 +428,7 @@ public func _bjs_roundTripOptionalRatio(inputIsSome: Int32, inputValue: Float64) @_expose(wasm, "bjs_processTheme") @_cdecl("bjs_processTheme") -public func _bjs_processTheme(themeBytes: Int32, themeLength: Int32) -> Int32 { +public func _bjs_processTheme(_ themeBytes: Int32, _ themeLength: Int32) -> Int32 { #if arch(wasm32) let ret = processTheme(_: Theme.bridgeJSLiftParameter(themeBytes, themeLength)) return ret.bridgeJSLowerReturn() @@ -439,7 +439,7 @@ public func _bjs_processTheme(themeBytes: Int32, themeLength: Int32) -> Int32 { @_expose(wasm, "bjs_convertPriority") @_cdecl("bjs_convertPriority") -public func _bjs_convertPriority(status: Int32) -> Int32 { +public func _bjs_convertPriority(_ status: Int32) -> Int32 { #if arch(wasm32) let ret = convertPriority(_: HttpStatus.bridgeJSLiftParameter(status)) return ret.bridgeJSLowerReturn() @@ -450,7 +450,7 @@ public func _bjs_convertPriority(status: Int32) -> Int32 { @_expose(wasm, "bjs_validateSession") @_cdecl("bjs_validateSession") -public func _bjs_validateSession(session: Int32) -> Void { +public func _bjs_validateSession(_ session: Int32) -> Void { #if arch(wasm32) let ret = validateSession(_: SessionId.bridgeJSLiftParameter(session)) return ret.bridgeJSLowerReturn() diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedGlobal.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedGlobal.swift index 774bf075..3e38fee4 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedGlobal.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedGlobal.swift @@ -30,7 +30,7 @@ public func _bjs_GlobalClass_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_GlobalClass_greet") @_cdecl("bjs_GlobalClass_greet") -public func _bjs_GlobalClass_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_GlobalClass_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = GlobalClass.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -41,8 +41,12 @@ public func _bjs_GlobalClass_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_GlobalClass_deinit") @_cdecl("bjs_GlobalClass_deinit") -public func _bjs_GlobalClass_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_GlobalClass_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension GlobalClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -53,9 +57,9 @@ extension GlobalClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_GlobalClass_wrap") -fileprivate func _bjs_GlobalClass_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_GlobalClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_GlobalClass_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_GlobalClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedPrivate.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedPrivate.swift index 10c62bb0..76a1a6c2 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedPrivate.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/MixedPrivate.swift @@ -30,7 +30,7 @@ public func _bjs_PrivateClass_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_PrivateClass_greet") @_cdecl("bjs_PrivateClass_greet") -public func _bjs_PrivateClass_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PrivateClass_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PrivateClass.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -41,8 +41,12 @@ public func _bjs_PrivateClass_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_PrivateClass_deinit") @_cdecl("bjs_PrivateClass_deinit") -public func _bjs_PrivateClass_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PrivateClass_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PrivateClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -53,9 +57,9 @@ extension PrivateClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_PrivateClass_wrap") -fileprivate func _bjs_PrivateClass_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PrivateClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PrivateClass_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PrivateClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.Global.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.Global.swift index 3e771446..19fe8ea9 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.Global.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.Global.swift @@ -30,7 +30,7 @@ public func _bjs_MyModule_Utils_namespacedFunction() -> Void { @_expose(wasm, "bjs_Greeter_init") @_cdecl("bjs_Greeter_init") -public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -41,7 +41,7 @@ public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMuta @_expose(wasm, "bjs_Greeter_greet") @_cdecl("bjs_Greeter_greet") -public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -52,8 +52,12 @@ public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_deinit") @_cdecl("bjs_Greeter_deinit") -public func _bjs_Greeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Greeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -64,9 +68,9 @@ extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Greeter_wrap") -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -84,7 +88,7 @@ public func _bjs_Converter_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Converter_toString") @_cdecl("bjs_Converter_toString") -public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_Converter_toString(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) let ret = Converter.bridgeJSLiftParameter(_self).toString(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -95,8 +99,12 @@ public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32 @_expose(wasm, "bjs_Converter_deinit") @_cdecl("bjs_Converter_deinit") -public func _bjs_Converter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Converter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -107,16 +115,16 @@ extension Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Converter_wrap") -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_UUID_uuidString") @_cdecl("bjs_UUID_uuidString") -public func _bjs_UUID_uuidString(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_UUID_uuidString(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = UUID.bridgeJSLiftParameter(_self).uuidString() return ret.bridgeJSLowerReturn() @@ -127,8 +135,12 @@ public func _bjs_UUID_uuidString(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_UUID_deinit") @_cdecl("bjs_UUID_deinit") -public func _bjs_UUID_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_UUID_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension UUID: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -139,9 +151,9 @@ extension UUID: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_UUID_wrap") -fileprivate func _bjs_UUID_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_UUID_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_UUID_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_UUID_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.swift index 3e771446..19fe8ea9 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Namespaces.swift @@ -30,7 +30,7 @@ public func _bjs_MyModule_Utils_namespacedFunction() -> Void { @_expose(wasm, "bjs_Greeter_init") @_cdecl("bjs_Greeter_init") -public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -41,7 +41,7 @@ public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMuta @_expose(wasm, "bjs_Greeter_greet") @_cdecl("bjs_Greeter_greet") -public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -52,8 +52,12 @@ public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_deinit") @_cdecl("bjs_Greeter_deinit") -public func _bjs_Greeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Greeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -64,9 +68,9 @@ extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Greeter_wrap") -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -84,7 +88,7 @@ public func _bjs_Converter_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Converter_toString") @_cdecl("bjs_Converter_toString") -public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_Converter_toString(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) let ret = Converter.bridgeJSLiftParameter(_self).toString(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -95,8 +99,12 @@ public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32 @_expose(wasm, "bjs_Converter_deinit") @_cdecl("bjs_Converter_deinit") -public func _bjs_Converter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Converter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -107,16 +115,16 @@ extension Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Converter_wrap") -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_UUID_uuidString") @_cdecl("bjs_UUID_uuidString") -public func _bjs_UUID_uuidString(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_UUID_uuidString(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = UUID.bridgeJSLiftParameter(_self).uuidString() return ret.bridgeJSLowerReturn() @@ -127,8 +135,12 @@ public func _bjs_UUID_uuidString(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_UUID_deinit") @_cdecl("bjs_UUID_deinit") -public func _bjs_UUID_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_UUID_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension UUID: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -139,9 +151,9 @@ extension UUID: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_UUID_wrap") -fileprivate func _bjs_UUID_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_UUID_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_UUID_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_UUID_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Optionals.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Optionals.swift index 0834943e..f2f19f9a 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Optionals.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Optionals.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_roundTripOptionalClass") @_cdecl("bjs_roundTripOptionalClass") -public func _bjs_roundTripOptionalClass(valueIsSome: Int32, valueValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_roundTripOptionalClass(_ valueIsSome: Int32, _ valueValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = roundTripOptionalClass(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -19,7 +19,7 @@ public func _bjs_roundTripOptionalClass(valueIsSome: Int32, valueValue: UnsafeMu @_expose(wasm, "bjs_testOptionalPropertyRoundtrip") @_cdecl("bjs_testOptionalPropertyRoundtrip") -public func _bjs_testOptionalPropertyRoundtrip(holderIsSome: Int32, holderValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_testOptionalPropertyRoundtrip(_ holderIsSome: Int32, _ holderValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = testOptionalPropertyRoundtrip(_: Optional.bridgeJSLiftParameter(holderIsSome, holderValue)) return ret.bridgeJSLowerReturn() @@ -30,7 +30,7 @@ public func _bjs_testOptionalPropertyRoundtrip(holderIsSome: Int32, holderValue: @_expose(wasm, "bjs_roundTripString") @_cdecl("bjs_roundTripString") -public func _bjs_roundTripString(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripString(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripString(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -41,7 +41,7 @@ public func _bjs_roundTripString(nameIsSome: Int32, nameBytes: Int32, nameLength @_expose(wasm, "bjs_roundTripInt") @_cdecl("bjs_roundTripInt") -public func _bjs_roundTripInt(valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_roundTripInt(_ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripInt(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -52,7 +52,7 @@ public func _bjs_roundTripInt(valueIsSome: Int32, valueValue: Int32) -> Void { @_expose(wasm, "bjs_roundTripBool") @_cdecl("bjs_roundTripBool") -public func _bjs_roundTripBool(flagIsSome: Int32, flagValue: Int32) -> Void { +public func _bjs_roundTripBool(_ flagIsSome: Int32, _ flagValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripBool(flag: Optional.bridgeJSLiftParameter(flagIsSome, flagValue)) return ret.bridgeJSLowerReturn() @@ -63,7 +63,7 @@ public func _bjs_roundTripBool(flagIsSome: Int32, flagValue: Int32) -> Void { @_expose(wasm, "bjs_roundTripFloat") @_cdecl("bjs_roundTripFloat") -public func _bjs_roundTripFloat(numberIsSome: Int32, numberValue: Float32) -> Void { +public func _bjs_roundTripFloat(_ numberIsSome: Int32, _ numberValue: Float32) -> Void { #if arch(wasm32) let ret = roundTripFloat(number: Optional.bridgeJSLiftParameter(numberIsSome, numberValue)) return ret.bridgeJSLowerReturn() @@ -74,7 +74,7 @@ public func _bjs_roundTripFloat(numberIsSome: Int32, numberValue: Float32) -> Vo @_expose(wasm, "bjs_roundTripDouble") @_cdecl("bjs_roundTripDouble") -public func _bjs_roundTripDouble(precisionIsSome: Int32, precisionValue: Float64) -> Void { +public func _bjs_roundTripDouble(_ precisionIsSome: Int32, _ precisionValue: Float64) -> Void { #if arch(wasm32) let ret = roundTripDouble(precision: Optional.bridgeJSLiftParameter(precisionIsSome, precisionValue)) return ret.bridgeJSLowerReturn() @@ -85,7 +85,7 @@ public func _bjs_roundTripDouble(precisionIsSome: Int32, precisionValue: Float64 @_expose(wasm, "bjs_roundTripSyntax") @_cdecl("bjs_roundTripSyntax") -public func _bjs_roundTripSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripSyntax(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripSyntax(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -96,7 +96,7 @@ public func _bjs_roundTripSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength @_expose(wasm, "bjs_roundTripMixSyntax") @_cdecl("bjs_roundTripMixSyntax") -public func _bjs_roundTripMixSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripMixSyntax(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripMixSyntax(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -107,7 +107,7 @@ public func _bjs_roundTripMixSyntax(nameIsSome: Int32, nameBytes: Int32, nameLen @_expose(wasm, "bjs_roundTripSwiftSyntax") @_cdecl("bjs_roundTripSwiftSyntax") -public func _bjs_roundTripSwiftSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripSwiftSyntax(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripSwiftSyntax(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -118,7 +118,7 @@ public func _bjs_roundTripSwiftSyntax(nameIsSome: Int32, nameBytes: Int32, nameL @_expose(wasm, "bjs_roundTripMixedSwiftSyntax") @_cdecl("bjs_roundTripMixedSwiftSyntax") -public func _bjs_roundTripMixedSwiftSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripMixedSwiftSyntax(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripMixedSwiftSyntax(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -129,7 +129,7 @@ public func _bjs_roundTripMixedSwiftSyntax(nameIsSome: Int32, nameBytes: Int32, @_expose(wasm, "bjs_roundTripWithSpaces") @_cdecl("bjs_roundTripWithSpaces") -public func _bjs_roundTripWithSpaces(valueIsSome: Int32, valueValue: Float64) -> Void { +public func _bjs_roundTripWithSpaces(_ valueIsSome: Int32, _ valueValue: Float64) -> Void { #if arch(wasm32) let ret = roundTripWithSpaces(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -140,7 +140,7 @@ public func _bjs_roundTripWithSpaces(valueIsSome: Int32, valueValue: Float64) -> @_expose(wasm, "bjs_roundTripAlias") @_cdecl("bjs_roundTripAlias") -public func _bjs_roundTripAlias(ageIsSome: Int32, ageValue: Int32) -> Void { +public func _bjs_roundTripAlias(_ ageIsSome: Int32, _ ageValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripAlias(age: Optional.bridgeJSLiftParameter(ageIsSome, ageValue)) return ret.bridgeJSLowerReturn() @@ -151,7 +151,7 @@ public func _bjs_roundTripAlias(ageIsSome: Int32, ageValue: Int32) -> Void { @_expose(wasm, "bjs_roundTripOptionalAlias") @_cdecl("bjs_roundTripOptionalAlias") -public func _bjs_roundTripOptionalAlias(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripOptionalAlias(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalAlias(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -162,7 +162,7 @@ public func _bjs_roundTripOptionalAlias(nameIsSome: Int32, nameBytes: Int32, nam @_expose(wasm, "bjs_testMixedOptionals") @_cdecl("bjs_testMixedOptionals") -public func _bjs_testMixedOptionals(firstNameIsSome: Int32, firstNameBytes: Int32, firstNameLength: Int32, lastNameIsSome: Int32, lastNameBytes: Int32, lastNameLength: Int32, ageIsSome: Int32, ageValue: Int32, active: Int32) -> Void { +public func _bjs_testMixedOptionals(_ firstNameIsSome: Int32, _ firstNameBytes: Int32, _ firstNameLength: Int32, _ lastNameIsSome: Int32, _ lastNameBytes: Int32, _ lastNameLength: Int32, _ ageIsSome: Int32, _ ageValue: Int32, _ active: Int32) -> Void { #if arch(wasm32) let ret = testMixedOptionals(firstName: Optional.bridgeJSLiftParameter(firstNameIsSome, firstNameBytes, firstNameLength), lastName: Optional.bridgeJSLiftParameter(lastNameIsSome, lastNameBytes, lastNameLength), age: Optional.bridgeJSLiftParameter(ageIsSome, ageValue), active: Bool.bridgeJSLiftParameter(active)) return ret.bridgeJSLowerReturn() @@ -173,7 +173,7 @@ public func _bjs_testMixedOptionals(firstNameIsSome: Int32, firstNameBytes: Int3 @_expose(wasm, "bjs_Greeter_init") @_cdecl("bjs_Greeter_init") -public func _bjs_Greeter_init(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_init(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -184,7 +184,7 @@ public func _bjs_Greeter_init(nameIsSome: Int32, nameBytes: Int32, nameLength: I @_expose(wasm, "bjs_Greeter_greet") @_cdecl("bjs_Greeter_greet") -public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -195,7 +195,7 @@ public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_changeName") @_cdecl("bjs_Greeter_changeName") -public func _bjs_Greeter_changeName(_self: UnsafeMutableRawPointer, nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_Greeter_changeName(_ _self: UnsafeMutableRawPointer, _ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) Greeter.bridgeJSLiftParameter(_self).changeName(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) #else @@ -205,7 +205,7 @@ public func _bjs_Greeter_changeName(_self: UnsafeMutableRawPointer, nameIsSome: @_expose(wasm, "bjs_Greeter_name_get") @_cdecl("bjs_Greeter_name_get") -public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -216,7 +216,7 @@ public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_name_set") @_cdecl("bjs_Greeter_name_set") -public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_Greeter_name_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) Greeter.bridgeJSLiftParameter(_self).name = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -226,8 +226,12 @@ public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueIsSome: I @_expose(wasm, "bjs_Greeter_deinit") @_cdecl("bjs_Greeter_deinit") -public func _bjs_Greeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Greeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -238,9 +242,9 @@ extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Greeter_wrap") -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -258,7 +262,7 @@ public func _bjs_OptionalPropertyHolder_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_OptionalPropertyHolder_optionalName_get") @_cdecl("bjs_OptionalPropertyHolder_optionalName_get") -public func _bjs_OptionalPropertyHolder_optionalName_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalName_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalName return ret.bridgeJSLowerReturn() @@ -269,7 +273,7 @@ public func _bjs_OptionalPropertyHolder_optionalName_get(_self: UnsafeMutableRaw @_expose(wasm, "bjs_OptionalPropertyHolder_optionalName_set") @_cdecl("bjs_OptionalPropertyHolder_optionalName_set") -public func _bjs_OptionalPropertyHolder_optionalName_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_OptionalPropertyHolder_optionalName_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalName = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -279,7 +283,7 @@ public func _bjs_OptionalPropertyHolder_optionalName_set(_self: UnsafeMutableRaw @_expose(wasm, "bjs_OptionalPropertyHolder_optionalAge_get") @_cdecl("bjs_OptionalPropertyHolder_optionalAge_get") -public func _bjs_OptionalPropertyHolder_optionalAge_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalAge_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalAge return ret.bridgeJSLowerReturn() @@ -290,7 +294,7 @@ public func _bjs_OptionalPropertyHolder_optionalAge_get(_self: UnsafeMutableRawP @_expose(wasm, "bjs_OptionalPropertyHolder_optionalAge_set") @_cdecl("bjs_OptionalPropertyHolder_optionalAge_set") -public func _bjs_OptionalPropertyHolder_optionalAge_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_OptionalPropertyHolder_optionalAge_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalAge = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -300,7 +304,7 @@ public func _bjs_OptionalPropertyHolder_optionalAge_set(_self: UnsafeMutableRawP @_expose(wasm, "bjs_OptionalPropertyHolder_optionalGreeter_get") @_cdecl("bjs_OptionalPropertyHolder_optionalGreeter_get") -public func _bjs_OptionalPropertyHolder_optionalGreeter_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalGreeter_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalGreeter return ret.bridgeJSLowerReturn() @@ -311,7 +315,7 @@ public func _bjs_OptionalPropertyHolder_optionalGreeter_get(_self: UnsafeMutable @_expose(wasm, "bjs_OptionalPropertyHolder_optionalGreeter_set") @_cdecl("bjs_OptionalPropertyHolder_optionalGreeter_set") -public func _bjs_OptionalPropertyHolder_optionalGreeter_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalGreeter_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalGreeter = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -321,8 +325,12 @@ public func _bjs_OptionalPropertyHolder_optionalGreeter_set(_self: UnsafeMutable @_expose(wasm, "bjs_OptionalPropertyHolder_deinit") @_cdecl("bjs_OptionalPropertyHolder_deinit") -public func _bjs_OptionalPropertyHolder_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_OptionalPropertyHolder_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension OptionalPropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -333,9 +341,9 @@ extension OptionalPropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_OptionalPropertyHolder_wrap") -fileprivate func _bjs_OptionalPropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_OptionalPropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_OptionalPropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_OptionalPropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PrimitiveParameters.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PrimitiveParameters.swift index 33097726..4f906704 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PrimitiveParameters.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PrimitiveParameters.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_check") @_cdecl("bjs_check") -public func _bjs_check(a: Int32, b: Float32, c: Float64, d: Int32) -> Void { +public func _bjs_check(_ a: Int32, _ b: Float32, _ c: Float64, _ d: Int32) -> Void { #if arch(wasm32) check(a: Int.bridgeJSLiftParameter(a), b: Float.bridgeJSLiftParameter(b), c: Double.bridgeJSLiftParameter(c), d: Bool.bridgeJSLiftParameter(d)) #else diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PropertyTypes.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PropertyTypes.swift index f622e3ac..96bde51e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PropertyTypes.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/PropertyTypes.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_createPropertyHolder") @_cdecl("bjs_createPropertyHolder") -public func _bjs_createPropertyHolder(intValue: Int32, floatValue: Float32, doubleValue: Float64, boolValue: Int32, stringValueBytes: Int32, stringValueLength: Int32, jsObject: Int32) -> UnsafeMutableRawPointer { +public func _bjs_createPropertyHolder(_ intValue: Int32, _ floatValue: Float32, _ doubleValue: Float64, _ boolValue: Int32, _ stringValueBytes: Int32, _ stringValueLength: Int32, _ jsObject: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = createPropertyHolder(intValue: Int.bridgeJSLiftParameter(intValue), floatValue: Float.bridgeJSLiftParameter(floatValue), doubleValue: Double.bridgeJSLiftParameter(doubleValue), boolValue: Bool.bridgeJSLiftParameter(boolValue), stringValue: String.bridgeJSLiftParameter(stringValueBytes, stringValueLength), jsObject: JSObject.bridgeJSLiftParameter(jsObject)) return ret.bridgeJSLowerReturn() @@ -19,7 +19,7 @@ public func _bjs_createPropertyHolder(intValue: Int32, floatValue: Float32, doub @_expose(wasm, "bjs_testPropertyHolder") @_cdecl("bjs_testPropertyHolder") -public func _bjs_testPropertyHolder(holder: UnsafeMutableRawPointer) -> Void { +public func _bjs_testPropertyHolder(_ holder: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = testPropertyHolder(holder: PropertyHolder.bridgeJSLiftParameter(holder)) return ret.bridgeJSLowerReturn() @@ -30,7 +30,7 @@ public func _bjs_testPropertyHolder(holder: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_PropertyHolder_init") @_cdecl("bjs_PropertyHolder_init") -public func _bjs_PropertyHolder_init(intValue: Int32, floatValue: Float32, doubleValue: Float64, boolValue: Int32, stringValueBytes: Int32, stringValueLength: Int32, jsObject: Int32) -> UnsafeMutableRawPointer { +public func _bjs_PropertyHolder_init(_ intValue: Int32, _ floatValue: Float32, _ doubleValue: Float64, _ boolValue: Int32, _ stringValueBytes: Int32, _ stringValueLength: Int32, _ jsObject: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = PropertyHolder(intValue: Int.bridgeJSLiftParameter(intValue), floatValue: Float.bridgeJSLiftParameter(floatValue), doubleValue: Double.bridgeJSLiftParameter(doubleValue), boolValue: Bool.bridgeJSLiftParameter(boolValue), stringValue: String.bridgeJSLiftParameter(stringValueBytes, stringValueLength), jsObject: JSObject.bridgeJSLiftParameter(jsObject)) return ret.bridgeJSLowerReturn() @@ -41,7 +41,7 @@ public func _bjs_PropertyHolder_init(intValue: Int32, floatValue: Float32, doubl @_expose(wasm, "bjs_PropertyHolder_getAllValues") @_cdecl("bjs_PropertyHolder_getAllValues") -public func _bjs_PropertyHolder_getAllValues(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_getAllValues(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).getAllValues() return ret.bridgeJSLowerReturn() @@ -52,7 +52,7 @@ public func _bjs_PropertyHolder_getAllValues(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_intValue_get") @_cdecl("bjs_PropertyHolder_intValue_get") -public func _bjs_PropertyHolder_intValue_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_intValue_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).intValue return ret.bridgeJSLowerReturn() @@ -63,7 +63,7 @@ public func _bjs_PropertyHolder_intValue_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_intValue_set") @_cdecl("bjs_PropertyHolder_intValue_set") -public func _bjs_PropertyHolder_intValue_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_intValue_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).intValue = Int.bridgeJSLiftParameter(value) #else @@ -73,7 +73,7 @@ public func _bjs_PropertyHolder_intValue_set(_self: UnsafeMutableRawPointer, val @_expose(wasm, "bjs_PropertyHolder_floatValue_get") @_cdecl("bjs_PropertyHolder_floatValue_get") -public func _bjs_PropertyHolder_floatValue_get(_self: UnsafeMutableRawPointer) -> Float32 { +public func _bjs_PropertyHolder_floatValue_get(_ _self: UnsafeMutableRawPointer) -> Float32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).floatValue return ret.bridgeJSLowerReturn() @@ -84,7 +84,7 @@ public func _bjs_PropertyHolder_floatValue_get(_self: UnsafeMutableRawPointer) - @_expose(wasm, "bjs_PropertyHolder_floatValue_set") @_cdecl("bjs_PropertyHolder_floatValue_set") -public func _bjs_PropertyHolder_floatValue_set(_self: UnsafeMutableRawPointer, value: Float32) -> Void { +public func _bjs_PropertyHolder_floatValue_set(_ _self: UnsafeMutableRawPointer, _ value: Float32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).floatValue = Float.bridgeJSLiftParameter(value) #else @@ -94,7 +94,7 @@ public func _bjs_PropertyHolder_floatValue_set(_self: UnsafeMutableRawPointer, v @_expose(wasm, "bjs_PropertyHolder_doubleValue_get") @_cdecl("bjs_PropertyHolder_doubleValue_get") -public func _bjs_PropertyHolder_doubleValue_get(_self: UnsafeMutableRawPointer) -> Float64 { +public func _bjs_PropertyHolder_doubleValue_get(_ _self: UnsafeMutableRawPointer) -> Float64 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).doubleValue return ret.bridgeJSLowerReturn() @@ -105,7 +105,7 @@ public func _bjs_PropertyHolder_doubleValue_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_doubleValue_set") @_cdecl("bjs_PropertyHolder_doubleValue_set") -public func _bjs_PropertyHolder_doubleValue_set(_self: UnsafeMutableRawPointer, value: Float64) -> Void { +public func _bjs_PropertyHolder_doubleValue_set(_ _self: UnsafeMutableRawPointer, _ value: Float64) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).doubleValue = Double.bridgeJSLiftParameter(value) #else @@ -115,7 +115,7 @@ public func _bjs_PropertyHolder_doubleValue_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_PropertyHolder_boolValue_get") @_cdecl("bjs_PropertyHolder_boolValue_get") -public func _bjs_PropertyHolder_boolValue_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_boolValue_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).boolValue return ret.bridgeJSLowerReturn() @@ -126,7 +126,7 @@ public func _bjs_PropertyHolder_boolValue_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_boolValue_set") @_cdecl("bjs_PropertyHolder_boolValue_set") -public func _bjs_PropertyHolder_boolValue_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_boolValue_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).boolValue = Bool.bridgeJSLiftParameter(value) #else @@ -136,7 +136,7 @@ public func _bjs_PropertyHolder_boolValue_set(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_PropertyHolder_stringValue_get") @_cdecl("bjs_PropertyHolder_stringValue_get") -public func _bjs_PropertyHolder_stringValue_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_stringValue_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).stringValue return ret.bridgeJSLowerReturn() @@ -147,7 +147,7 @@ public func _bjs_PropertyHolder_stringValue_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_stringValue_set") @_cdecl("bjs_PropertyHolder_stringValue_set") -public func _bjs_PropertyHolder_stringValue_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyHolder_stringValue_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).stringValue = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -157,7 +157,7 @@ public func _bjs_PropertyHolder_stringValue_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_PropertyHolder_readonlyInt_get") @_cdecl("bjs_PropertyHolder_readonlyInt_get") -public func _bjs_PropertyHolder_readonlyInt_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_readonlyInt_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyInt return ret.bridgeJSLowerReturn() @@ -168,7 +168,7 @@ public func _bjs_PropertyHolder_readonlyInt_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_readonlyFloat_get") @_cdecl("bjs_PropertyHolder_readonlyFloat_get") -public func _bjs_PropertyHolder_readonlyFloat_get(_self: UnsafeMutableRawPointer) -> Float32 { +public func _bjs_PropertyHolder_readonlyFloat_get(_ _self: UnsafeMutableRawPointer) -> Float32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyFloat return ret.bridgeJSLowerReturn() @@ -179,7 +179,7 @@ public func _bjs_PropertyHolder_readonlyFloat_get(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_PropertyHolder_readonlyDouble_get") @_cdecl("bjs_PropertyHolder_readonlyDouble_get") -public func _bjs_PropertyHolder_readonlyDouble_get(_self: UnsafeMutableRawPointer) -> Float64 { +public func _bjs_PropertyHolder_readonlyDouble_get(_ _self: UnsafeMutableRawPointer) -> Float64 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyDouble return ret.bridgeJSLowerReturn() @@ -190,7 +190,7 @@ public func _bjs_PropertyHolder_readonlyDouble_get(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_PropertyHolder_readonlyBool_get") @_cdecl("bjs_PropertyHolder_readonlyBool_get") -public func _bjs_PropertyHolder_readonlyBool_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_readonlyBool_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyBool return ret.bridgeJSLowerReturn() @@ -201,7 +201,7 @@ public func _bjs_PropertyHolder_readonlyBool_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_readonlyString_get") @_cdecl("bjs_PropertyHolder_readonlyString_get") -public func _bjs_PropertyHolder_readonlyString_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_readonlyString_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyString return ret.bridgeJSLowerReturn() @@ -212,7 +212,7 @@ public func _bjs_PropertyHolder_readonlyString_get(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_PropertyHolder_jsObject_get") @_cdecl("bjs_PropertyHolder_jsObject_get") -public func _bjs_PropertyHolder_jsObject_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_jsObject_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).jsObject return ret.bridgeJSLowerReturn() @@ -223,7 +223,7 @@ public func _bjs_PropertyHolder_jsObject_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_jsObject_set") @_cdecl("bjs_PropertyHolder_jsObject_set") -public func _bjs_PropertyHolder_jsObject_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_jsObject_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).jsObject = JSObject.bridgeJSLiftParameter(value) #else @@ -233,7 +233,7 @@ public func _bjs_PropertyHolder_jsObject_set(_self: UnsafeMutableRawPointer, val @_expose(wasm, "bjs_PropertyHolder_sibling_get") @_cdecl("bjs_PropertyHolder_sibling_get") -public func _bjs_PropertyHolder_sibling_get(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_PropertyHolder_sibling_get(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).sibling return ret.bridgeJSLowerReturn() @@ -244,7 +244,7 @@ public func _bjs_PropertyHolder_sibling_get(_self: UnsafeMutableRawPointer) -> U @_expose(wasm, "bjs_PropertyHolder_sibling_set") @_cdecl("bjs_PropertyHolder_sibling_set") -public func _bjs_PropertyHolder_sibling_set(_self: UnsafeMutableRawPointer, value: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_sibling_set(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).sibling = PropertyHolder.bridgeJSLiftParameter(value) #else @@ -254,7 +254,7 @@ public func _bjs_PropertyHolder_sibling_set(_self: UnsafeMutableRawPointer, valu @_expose(wasm, "bjs_PropertyHolder_lazyValue_get") @_cdecl("bjs_PropertyHolder_lazyValue_get") -public func _bjs_PropertyHolder_lazyValue_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_lazyValue_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).lazyValue return ret.bridgeJSLowerReturn() @@ -265,7 +265,7 @@ public func _bjs_PropertyHolder_lazyValue_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_lazyValue_set") @_cdecl("bjs_PropertyHolder_lazyValue_set") -public func _bjs_PropertyHolder_lazyValue_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyHolder_lazyValue_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).lazyValue = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -275,7 +275,7 @@ public func _bjs_PropertyHolder_lazyValue_set(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_PropertyHolder_computedReadonly_get") @_cdecl("bjs_PropertyHolder_computedReadonly_get") -public func _bjs_PropertyHolder_computedReadonly_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_computedReadonly_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).computedReadonly return ret.bridgeJSLowerReturn() @@ -286,7 +286,7 @@ public func _bjs_PropertyHolder_computedReadonly_get(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_PropertyHolder_computedReadWrite_get") @_cdecl("bjs_PropertyHolder_computedReadWrite_get") -public func _bjs_PropertyHolder_computedReadWrite_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_computedReadWrite_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).computedReadWrite return ret.bridgeJSLowerReturn() @@ -297,7 +297,7 @@ public func _bjs_PropertyHolder_computedReadWrite_get(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_PropertyHolder_computedReadWrite_set") @_cdecl("bjs_PropertyHolder_computedReadWrite_set") -public func _bjs_PropertyHolder_computedReadWrite_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyHolder_computedReadWrite_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).computedReadWrite = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -307,7 +307,7 @@ public func _bjs_PropertyHolder_computedReadWrite_set(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_PropertyHolder_observedProperty_get") @_cdecl("bjs_PropertyHolder_observedProperty_get") -public func _bjs_PropertyHolder_observedProperty_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_observedProperty_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).observedProperty return ret.bridgeJSLowerReturn() @@ -318,7 +318,7 @@ public func _bjs_PropertyHolder_observedProperty_get(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_PropertyHolder_observedProperty_set") @_cdecl("bjs_PropertyHolder_observedProperty_set") -public func _bjs_PropertyHolder_observedProperty_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_observedProperty_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).observedProperty = Int.bridgeJSLiftParameter(value) #else @@ -328,8 +328,12 @@ public func _bjs_PropertyHolder_observedProperty_set(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_PropertyHolder_deinit") @_cdecl("bjs_PropertyHolder_deinit") -public func _bjs_PropertyHolder_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PropertyHolder_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -340,9 +344,9 @@ extension PropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_PropertyHolder_wrap") -fileprivate func _bjs_PropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift index ef6160d2..318b908b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift @@ -9,170 +9,214 @@ struct AnyMyViewControllerDelegate: MyViewControllerDelegate, _BridgedSwiftProtocolWrapper { let jsObject: JSObject - func onSomethingHappened() { - _extern_onSomethingHappened(this: Int32(bitPattern: jsObject.id)) + func onSomethingHappened() -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + _extern_onSomethingHappened(jsObjectValue) } - func onValueChanged(_ value: String) { - _extern_onValueChanged(this: Int32(bitPattern: jsObject.id), value: value.bridgeJSLowerParameter()) + func onValueChanged(_ value: String) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let valueValue = value.bridgeJSLowerParameter() + _extern_onValueChanged(jsObjectValue, valueValue) } func onCountUpdated(count: Int) -> Bool { - let ret = _extern_onCountUpdated(this: Int32(bitPattern: jsObject.id), count: count.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let countValue = count.bridgeJSLowerParameter() + let ret = _extern_onCountUpdated(jsObjectValue, countValue) return Bool.bridgeJSLiftReturn(ret) } - func onLabelUpdated(_ prefix: String, _ suffix: String) { - _extern_onLabelUpdated(this: Int32(bitPattern: jsObject.id), prefix: prefix.bridgeJSLowerParameter(), suffix: suffix.bridgeJSLowerParameter()) + func onLabelUpdated(_ prefix: String, _ suffix: String) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let prefixValue = prefix.bridgeJSLowerParameter() + let suffixValue = suffix.bridgeJSLowerParameter() + _extern_onLabelUpdated(jsObjectValue, prefixValue, suffixValue) } func isCountEven() -> Bool { - let ret = _extern_isCountEven(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_isCountEven(jsObjectValue) return Bool.bridgeJSLiftReturn(ret) } - func onHelperUpdated(_ helper: Helper) { - _extern_onHelperUpdated(this: Int32(bitPattern: jsObject.id), helper: helper.bridgeJSLowerParameter()) + func onHelperUpdated(_ helper: Helper) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let helperPointer = helper.bridgeJSLowerParameter() + _extern_onHelperUpdated(jsObjectValue, helperPointer) } func createHelper() -> Helper { - let ret = _extern_createHelper(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_createHelper(jsObjectValue) return Helper.bridgeJSLiftReturn(ret) } - func onOptionalHelperUpdated(_ helper: Optional) { - let (helperIsSome, helperPointer) = helper.bridgeJSLowerParameterWithPresence() - _extern_onOptionalHelperUpdated(this: Int32(bitPattern: jsObject.id), helperIsSome: helperIsSome, helperPointer: helperPointer) + func onOptionalHelperUpdated(_ helper: Optional) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (helperIsSome, helperPointer) = helper.bridgeJSLowerParameter() + _extern_onOptionalHelperUpdated(jsObjectValue, helperIsSome, helperPointer) } func createOptionalHelper() -> Optional { - let ret = _extern_createOptionalHelper(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_createOptionalHelper(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } func createEnum() -> ExampleEnum { - let ret = _extern_createEnum(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_createEnum(jsObjectValue) return ExampleEnum.bridgeJSLiftReturn(ret) } - func handleResult(_ result: Result) { - _extern_handleResult(this: Int32(bitPattern: jsObject.id), result: result.bridgeJSLowerParameter()) + func handleResult(_ result: Result) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let resultCaseId = result.bridgeJSLowerParameter() + _extern_handleResult(jsObjectValue, resultCaseId) } func getResult() -> Result { - let ret = _extern_getResult(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_getResult(jsObjectValue) return Result.bridgeJSLiftReturn(ret) } var eventCount: Int { get { - let ret = bjs_MyViewControllerDelegate_eventCount_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_eventCount_get(jsObjectValue) return Int.bridgeJSLiftReturn(ret) } set { - bjs_MyViewControllerDelegate_eventCount_set(this: Int32(bitPattern: jsObject.id), value: newValue.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_eventCount_set(jsObjectValue, newValueValue) } } var delegateName: String { get { - let ret = bjs_MyViewControllerDelegate_delegateName_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_delegateName_get(jsObjectValue) return String.bridgeJSLiftReturn(ret) } } var optionalName: Optional { get { - bjs_MyViewControllerDelegate_optionalName_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_optionalName_get(jsObjectValue) return Optional.bridgeJSLiftReturnFromSideChannel() } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_MyViewControllerDelegate_optionalName_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_optionalName_set(jsObjectValue, newValueIsSome, newValueValue) } } var optionalRawEnum: Optional { get { - bjs_MyViewControllerDelegate_optionalRawEnum_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_optionalRawEnum_get(jsObjectValue) return Optional.bridgeJSLiftReturnFromSideChannel() } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_MyViewControllerDelegate_optionalRawEnum_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_optionalRawEnum_set(jsObjectValue, newValueIsSome, newValueValue) } } var rawStringEnum: ExampleEnum { get { - let ret = bjs_MyViewControllerDelegate_rawStringEnum_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_rawStringEnum_get(jsObjectValue) return ExampleEnum.bridgeJSLiftReturn(ret) } set { - bjs_MyViewControllerDelegate_rawStringEnum_set(this: Int32(bitPattern: jsObject.id), value: newValue.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_rawStringEnum_set(jsObjectValue, newValueValue) } } var result: Result { get { - let ret = bjs_MyViewControllerDelegate_result_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_result_get(jsObjectValue) return Result.bridgeJSLiftReturn(ret) } set { - bjs_MyViewControllerDelegate_result_set(this: Int32(bitPattern: jsObject.id), caseId: newValue.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let newValueCaseId = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_result_set(jsObjectValue, newValueCaseId) } } var optionalResult: Optional { get { - let ret = bjs_MyViewControllerDelegate_optionalResult_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_optionalResult_get(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } set { - let (isSome, caseId) = newValue.bridgeJSLowerParameterWithPresence() - bjs_MyViewControllerDelegate_optionalResult_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, caseId: caseId) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueCaseId) = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_optionalResult_set(jsObjectValue, newValueIsSome, newValueCaseId) } } var direction: Direction { get { - let ret = bjs_MyViewControllerDelegate_direction_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_direction_get(jsObjectValue) return Direction.bridgeJSLiftReturn(ret) } set { - bjs_MyViewControllerDelegate_direction_set(this: Int32(bitPattern: jsObject.id), value: newValue.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_direction_set(jsObjectValue, newValueValue) } } var directionOptional: Optional { get { - let ret = bjs_MyViewControllerDelegate_directionOptional_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_directionOptional_get(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_MyViewControllerDelegate_directionOptional_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_directionOptional_set(jsObjectValue, newValueIsSome, newValueValue) } } var priority: Priority { get { - let ret = bjs_MyViewControllerDelegate_priority_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_MyViewControllerDelegate_priority_get(jsObjectValue) return Priority.bridgeJSLiftReturn(ret) } set { - bjs_MyViewControllerDelegate_priority_set(this: Int32(bitPattern: jsObject.id), value: newValue.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_priority_set(jsObjectValue, newValueValue) } } var priorityOptional: Optional { get { - bjs_MyViewControllerDelegate_priorityOptional_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_priorityOptional_get(jsObjectValue) return Optional.bridgeJSLiftReturnFromSideChannel() } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_MyViewControllerDelegate_priorityOptional_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_MyViewControllerDelegate_priorityOptional_set(jsObjectValue, newValueIsSome, newValueValue) } } @@ -182,103 +226,103 @@ struct AnyMyViewControllerDelegate: MyViewControllerDelegate, _BridgedSwiftProto } @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_onSomethingHappened") -fileprivate func _extern_onSomethingHappened(this: Int32) +fileprivate func _extern_onSomethingHappened(_ jsObject: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_onValueChanged") -fileprivate func _extern_onValueChanged(this: Int32, value: Int32) +fileprivate func _extern_onValueChanged(_ jsObject: Int32, _ value: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_onCountUpdated") -fileprivate func _extern_onCountUpdated(this: Int32, count: Int32) -> Int32 +fileprivate func _extern_onCountUpdated(_ jsObject: Int32, _ count: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_onLabelUpdated") -fileprivate func _extern_onLabelUpdated(this: Int32, prefix: Int32, suffix: Int32) +fileprivate func _extern_onLabelUpdated(_ jsObject: Int32, _ prefix: Int32, _ suffix: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_isCountEven") -fileprivate func _extern_isCountEven(this: Int32) -> Int32 +fileprivate func _extern_isCountEven(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_onHelperUpdated") -fileprivate func _extern_onHelperUpdated(this: Int32, helper: UnsafeMutableRawPointer) +fileprivate func _extern_onHelperUpdated(_ jsObject: Int32, _ helper: UnsafeMutableRawPointer) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_createHelper") -fileprivate func _extern_createHelper(this: Int32) -> UnsafeMutableRawPointer +fileprivate func _extern_createHelper(_ jsObject: Int32) -> UnsafeMutableRawPointer @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_onOptionalHelperUpdated") -fileprivate func _extern_onOptionalHelperUpdated(this: Int32, helperIsSome: Int32, helperPointer: UnsafeMutableRawPointer) +fileprivate func _extern_onOptionalHelperUpdated(_ jsObject: Int32, _ helperIsSome: Int32, _ helperPointer: UnsafeMutableRawPointer) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_createOptionalHelper") -fileprivate func _extern_createOptionalHelper(this: Int32) -> UnsafeMutableRawPointer +fileprivate func _extern_createOptionalHelper(_ jsObject: Int32) -> UnsafeMutableRawPointer @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_createEnum") -fileprivate func _extern_createEnum(this: Int32) -> Int32 +fileprivate func _extern_createEnum(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_handleResult") -fileprivate func _extern_handleResult(this: Int32, result: Int32) +fileprivate func _extern_handleResult(_ jsObject: Int32, _ result: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_getResult") -fileprivate func _extern_getResult(this: Int32) -> Int32 +fileprivate func _extern_getResult(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_eventCount_get") -fileprivate func bjs_MyViewControllerDelegate_eventCount_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_eventCount_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_eventCount_set") -fileprivate func bjs_MyViewControllerDelegate_eventCount_set(this: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_eventCount_set(_ jsObject: Int32, _ newValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_delegateName_get") -fileprivate func bjs_MyViewControllerDelegate_delegateName_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_delegateName_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_optionalName_get") -fileprivate func bjs_MyViewControllerDelegate_optionalName_get(this: Int32) +fileprivate func bjs_MyViewControllerDelegate_optionalName_get(_ jsObject: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_optionalName_set") -fileprivate func bjs_MyViewControllerDelegate_optionalName_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_optionalName_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_optionalRawEnum_get") -fileprivate func bjs_MyViewControllerDelegate_optionalRawEnum_get(this: Int32) +fileprivate func bjs_MyViewControllerDelegate_optionalRawEnum_get(_ jsObject: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_optionalRawEnum_set") -fileprivate func bjs_MyViewControllerDelegate_optionalRawEnum_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_optionalRawEnum_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_rawStringEnum_get") -fileprivate func bjs_MyViewControllerDelegate_rawStringEnum_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_rawStringEnum_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_rawStringEnum_set") -fileprivate func bjs_MyViewControllerDelegate_rawStringEnum_set(this: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_rawStringEnum_set(_ jsObject: Int32, _ newValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_result_get") -fileprivate func bjs_MyViewControllerDelegate_result_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_result_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_result_set") -fileprivate func bjs_MyViewControllerDelegate_result_set(this: Int32, caseId: Int32) +fileprivate func bjs_MyViewControllerDelegate_result_set(_ jsObject: Int32, _ newValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_optionalResult_get") -fileprivate func bjs_MyViewControllerDelegate_optionalResult_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_optionalResult_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_optionalResult_set") -fileprivate func bjs_MyViewControllerDelegate_optionalResult_set(this: Int32, isSome: Int32, caseId: Int32) +fileprivate func bjs_MyViewControllerDelegate_optionalResult_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueCaseId: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_direction_get") -fileprivate func bjs_MyViewControllerDelegate_direction_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_direction_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_direction_set") -fileprivate func bjs_MyViewControllerDelegate_direction_set(this: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_direction_set(_ jsObject: Int32, _ newValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_directionOptional_get") -fileprivate func bjs_MyViewControllerDelegate_directionOptional_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_directionOptional_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_directionOptional_set") -fileprivate func bjs_MyViewControllerDelegate_directionOptional_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_directionOptional_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_priority_get") -fileprivate func bjs_MyViewControllerDelegate_priority_get(this: Int32) -> Int32 +fileprivate func bjs_MyViewControllerDelegate_priority_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_priority_set") -fileprivate func bjs_MyViewControllerDelegate_priority_set(this: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_priority_set(_ jsObject: Int32, _ newValue: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_priorityOptional_get") -fileprivate func bjs_MyViewControllerDelegate_priorityOptional_get(this: Int32) +fileprivate func bjs_MyViewControllerDelegate_priorityOptional_get(_ jsObject: Int32) -> Void @_extern(wasm, module: "TestModule", name: "bjs_MyViewControllerDelegate_priorityOptional_set") -fileprivate func bjs_MyViewControllerDelegate_priorityOptional_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_MyViewControllerDelegate_priorityOptional_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void extension Direction: _BridgedSwiftCaseEnum { @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 { @@ -384,7 +428,7 @@ extension Priority: _BridgedSwiftEnumNoPayload { @_expose(wasm, "bjs_Helper_init") @_cdecl("bjs_Helper_init") -public func _bjs_Helper_init(value: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Helper_init(_ value: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Helper(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -395,7 +439,7 @@ public func _bjs_Helper_init(value: Int32) -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Helper_increment") @_cdecl("bjs_Helper_increment") -public func _bjs_Helper_increment(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Helper_increment(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) Helper.bridgeJSLiftParameter(_self).increment() #else @@ -405,7 +449,7 @@ public func _bjs_Helper_increment(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Helper_value_get") @_cdecl("bjs_Helper_value_get") -public func _bjs_Helper_value_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_Helper_value_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = Helper.bridgeJSLiftParameter(_self).value return ret.bridgeJSLowerReturn() @@ -416,7 +460,7 @@ public func _bjs_Helper_value_get(_self: UnsafeMutableRawPointer) -> Int32 { @_expose(wasm, "bjs_Helper_value_set") @_cdecl("bjs_Helper_value_set") -public func _bjs_Helper_value_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_Helper_value_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) Helper.bridgeJSLiftParameter(_self).value = Int.bridgeJSLiftParameter(value) #else @@ -426,8 +470,12 @@ public func _bjs_Helper_value_set(_self: UnsafeMutableRawPointer, value: Int32) @_expose(wasm, "bjs_Helper_deinit") @_cdecl("bjs_Helper_deinit") -public func _bjs_Helper_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Helper_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Helper: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -438,16 +486,16 @@ extension Helper: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Helper_wrap") -fileprivate func _bjs_Helper_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Helper_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Helper_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Helper_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_MyViewController_init") @_cdecl("bjs_MyViewController_init") -public func _bjs_MyViewController_init(delegate: Int32) -> UnsafeMutableRawPointer { +public func _bjs_MyViewController_init(_ delegate: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = MyViewController(delegate: AnyMyViewControllerDelegate.bridgeJSLiftParameter(delegate)) return ret.bridgeJSLowerReturn() @@ -458,7 +506,7 @@ public func _bjs_MyViewController_init(delegate: Int32) -> UnsafeMutableRawPoint @_expose(wasm, "bjs_MyViewController_triggerEvent") @_cdecl("bjs_MyViewController_triggerEvent") -public func _bjs_MyViewController_triggerEvent(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_MyViewController_triggerEvent(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) MyViewController.bridgeJSLiftParameter(_self).triggerEvent() #else @@ -468,7 +516,7 @@ public func _bjs_MyViewController_triggerEvent(_self: UnsafeMutableRawPointer) - @_expose(wasm, "bjs_MyViewController_updateValue") @_cdecl("bjs_MyViewController_updateValue") -public func _bjs_MyViewController_updateValue(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_MyViewController_updateValue(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) MyViewController.bridgeJSLiftParameter(_self).updateValue(_: String.bridgeJSLiftParameter(valueBytes, valueLength)) #else @@ -478,7 +526,7 @@ public func _bjs_MyViewController_updateValue(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_MyViewController_updateCount") @_cdecl("bjs_MyViewController_updateCount") -public func _bjs_MyViewController_updateCount(_self: UnsafeMutableRawPointer, count: Int32) -> Int32 { +public func _bjs_MyViewController_updateCount(_ _self: UnsafeMutableRawPointer, _ count: Int32) -> Int32 { #if arch(wasm32) let ret = MyViewController.bridgeJSLiftParameter(_self).updateCount(_: Int.bridgeJSLiftParameter(count)) return ret.bridgeJSLowerReturn() @@ -489,7 +537,7 @@ public func _bjs_MyViewController_updateCount(_self: UnsafeMutableRawPointer, co @_expose(wasm, "bjs_MyViewController_updateLabel") @_cdecl("bjs_MyViewController_updateLabel") -public func _bjs_MyViewController_updateLabel(_self: UnsafeMutableRawPointer, prefixBytes: Int32, prefixLength: Int32, suffixBytes: Int32, suffixLength: Int32) -> Void { +public func _bjs_MyViewController_updateLabel(_ _self: UnsafeMutableRawPointer, _ prefixBytes: Int32, _ prefixLength: Int32, _ suffixBytes: Int32, _ suffixLength: Int32) -> Void { #if arch(wasm32) MyViewController.bridgeJSLiftParameter(_self).updateLabel(_: String.bridgeJSLiftParameter(prefixBytes, prefixLength), _: String.bridgeJSLiftParameter(suffixBytes, suffixLength)) #else @@ -499,7 +547,7 @@ public func _bjs_MyViewController_updateLabel(_self: UnsafeMutableRawPointer, pr @_expose(wasm, "bjs_MyViewController_checkEvenCount") @_cdecl("bjs_MyViewController_checkEvenCount") -public func _bjs_MyViewController_checkEvenCount(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_MyViewController_checkEvenCount(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = MyViewController.bridgeJSLiftParameter(_self).checkEvenCount() return ret.bridgeJSLowerReturn() @@ -510,7 +558,7 @@ public func _bjs_MyViewController_checkEvenCount(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_MyViewController_sendHelper") @_cdecl("bjs_MyViewController_sendHelper") -public func _bjs_MyViewController_sendHelper(_self: UnsafeMutableRawPointer, helper: UnsafeMutableRawPointer) -> Void { +public func _bjs_MyViewController_sendHelper(_ _self: UnsafeMutableRawPointer, _ helper: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) MyViewController.bridgeJSLiftParameter(_self).sendHelper(_: Helper.bridgeJSLiftParameter(helper)) #else @@ -520,7 +568,7 @@ public func _bjs_MyViewController_sendHelper(_self: UnsafeMutableRawPointer, hel @_expose(wasm, "bjs_MyViewController_delegate_get") @_cdecl("bjs_MyViewController_delegate_get") -public func _bjs_MyViewController_delegate_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_MyViewController_delegate_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = MyViewController.bridgeJSLiftParameter(_self).delegate as! AnyMyViewControllerDelegate return ret.bridgeJSLowerReturn() @@ -531,7 +579,7 @@ public func _bjs_MyViewController_delegate_get(_self: UnsafeMutableRawPointer) - @_expose(wasm, "bjs_MyViewController_delegate_set") @_cdecl("bjs_MyViewController_delegate_set") -public func _bjs_MyViewController_delegate_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_MyViewController_delegate_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) MyViewController.bridgeJSLiftParameter(_self).delegate = AnyMyViewControllerDelegate.bridgeJSLiftParameter(value) #else @@ -541,7 +589,7 @@ public func _bjs_MyViewController_delegate_set(_self: UnsafeMutableRawPointer, v @_expose(wasm, "bjs_MyViewController_secondDelegate_get") @_cdecl("bjs_MyViewController_secondDelegate_get") -public func _bjs_MyViewController_secondDelegate_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_MyViewController_secondDelegate_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = MyViewController.bridgeJSLiftParameter(_self).secondDelegate.flatMap { $0 as? AnyMyViewControllerDelegate @@ -554,7 +602,7 @@ public func _bjs_MyViewController_secondDelegate_get(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_MyViewController_secondDelegate_set") @_cdecl("bjs_MyViewController_secondDelegate_set") -public func _bjs_MyViewController_secondDelegate_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_MyViewController_secondDelegate_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) MyViewController.bridgeJSLiftParameter(_self).secondDelegate = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -564,8 +612,12 @@ public func _bjs_MyViewController_secondDelegate_set(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_MyViewController_deinit") @_cdecl("bjs_MyViewController_deinit") -public func _bjs_MyViewController_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_MyViewController_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension MyViewController: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -576,9 +628,9 @@ extension MyViewController: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_MyViewController_wrap") -fileprivate func _bjs_MyViewController_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_MyViewController_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_MyViewController_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_MyViewController_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift index 81ea282f..8ea228dc 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift @@ -43,7 +43,7 @@ extension Calculator: _BridgedSwiftCaseEnum { @_expose(wasm, "bjs_Calculator_static_square") @_cdecl("bjs_Calculator_static_square") -public func _bjs_Calculator_static_square(value: Int32) -> Int32 { +public func _bjs_Calculator_static_square(_ value: Int32) -> Int32 { #if arch(wasm32) let ret = Calculator.square(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -107,7 +107,7 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { @_expose(wasm, "bjs_APIResult_static_roundtrip") @_cdecl("bjs_APIResult_static_roundtrip") -public func _bjs_APIResult_static_roundtrip(value: Int32) -> Void { +public func _bjs_APIResult_static_roundtrip(_ value: Int32) -> Void { #if arch(wasm32) let ret = APIResult.roundtrip(value: APIResult.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -118,7 +118,7 @@ public func _bjs_APIResult_static_roundtrip(value: Int32) -> Void { @_expose(wasm, "bjs_Utils_String_static_uppercase") @_cdecl("bjs_Utils_String_static_uppercase") -public func _bjs_Utils_String_static_uppercase(textBytes: Int32, textLength: Int32) -> Void { +public func _bjs_Utils_String_static_uppercase(_ textBytes: Int32, _ textLength: Int32) -> Void { #if arch(wasm32) let ret = Utils.String.uppercase(_: String.bridgeJSLiftParameter(textBytes, textLength)) return ret.bridgeJSLowerReturn() @@ -140,7 +140,7 @@ public func _bjs_MathUtils_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_MathUtils_static_subtract") @_cdecl("bjs_MathUtils_static_subtract") -public func _bjs_MathUtils_static_subtract(a: Int32, b: Int32) -> Int32 { +public func _bjs_MathUtils_static_subtract(_ a: Int32, _ b: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.subtract(a: Int.bridgeJSLiftParameter(a), b: Int.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -151,7 +151,7 @@ public func _bjs_MathUtils_static_subtract(a: Int32, b: Int32) -> Int32 { @_expose(wasm, "bjs_MathUtils_static_add") @_cdecl("bjs_MathUtils_static_add") -public func _bjs_MathUtils_static_add(a: Int32, b: Int32) -> Int32 { +public func _bjs_MathUtils_static_add(_ a: Int32, _ b: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.add(a: Int.bridgeJSLiftParameter(a), b: Int.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -162,7 +162,7 @@ public func _bjs_MathUtils_static_add(a: Int32, b: Int32) -> Int32 { @_expose(wasm, "bjs_MathUtils_multiply") @_cdecl("bjs_MathUtils_multiply") -public func _bjs_MathUtils_multiply(_self: UnsafeMutableRawPointer, x: Int32, y: Int32) -> Int32 { +public func _bjs_MathUtils_multiply(_ _self: UnsafeMutableRawPointer, _ x: Int32, _ y: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.bridgeJSLiftParameter(_self).multiply(x: Int.bridgeJSLiftParameter(x), y: Int.bridgeJSLiftParameter(y)) return ret.bridgeJSLowerReturn() @@ -173,8 +173,12 @@ public func _bjs_MathUtils_multiply(_self: UnsafeMutableRawPointer, x: Int32, y: @_expose(wasm, "bjs_MathUtils_deinit") @_cdecl("bjs_MathUtils_deinit") -public func _bjs_MathUtils_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_MathUtils_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension MathUtils: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -185,9 +189,9 @@ extension MathUtils: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_MathUtils_wrap") -fileprivate func _bjs_MathUtils_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_MathUtils_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_MathUtils_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_MathUtils_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift index 81ea282f..8ea228dc 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift @@ -43,7 +43,7 @@ extension Calculator: _BridgedSwiftCaseEnum { @_expose(wasm, "bjs_Calculator_static_square") @_cdecl("bjs_Calculator_static_square") -public func _bjs_Calculator_static_square(value: Int32) -> Int32 { +public func _bjs_Calculator_static_square(_ value: Int32) -> Int32 { #if arch(wasm32) let ret = Calculator.square(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -107,7 +107,7 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { @_expose(wasm, "bjs_APIResult_static_roundtrip") @_cdecl("bjs_APIResult_static_roundtrip") -public func _bjs_APIResult_static_roundtrip(value: Int32) -> Void { +public func _bjs_APIResult_static_roundtrip(_ value: Int32) -> Void { #if arch(wasm32) let ret = APIResult.roundtrip(value: APIResult.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -118,7 +118,7 @@ public func _bjs_APIResult_static_roundtrip(value: Int32) -> Void { @_expose(wasm, "bjs_Utils_String_static_uppercase") @_cdecl("bjs_Utils_String_static_uppercase") -public func _bjs_Utils_String_static_uppercase(textBytes: Int32, textLength: Int32) -> Void { +public func _bjs_Utils_String_static_uppercase(_ textBytes: Int32, _ textLength: Int32) -> Void { #if arch(wasm32) let ret = Utils.String.uppercase(_: String.bridgeJSLiftParameter(textBytes, textLength)) return ret.bridgeJSLowerReturn() @@ -140,7 +140,7 @@ public func _bjs_MathUtils_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_MathUtils_static_subtract") @_cdecl("bjs_MathUtils_static_subtract") -public func _bjs_MathUtils_static_subtract(a: Int32, b: Int32) -> Int32 { +public func _bjs_MathUtils_static_subtract(_ a: Int32, _ b: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.subtract(a: Int.bridgeJSLiftParameter(a), b: Int.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -151,7 +151,7 @@ public func _bjs_MathUtils_static_subtract(a: Int32, b: Int32) -> Int32 { @_expose(wasm, "bjs_MathUtils_static_add") @_cdecl("bjs_MathUtils_static_add") -public func _bjs_MathUtils_static_add(a: Int32, b: Int32) -> Int32 { +public func _bjs_MathUtils_static_add(_ a: Int32, _ b: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.add(a: Int.bridgeJSLiftParameter(a), b: Int.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -162,7 +162,7 @@ public func _bjs_MathUtils_static_add(a: Int32, b: Int32) -> Int32 { @_expose(wasm, "bjs_MathUtils_multiply") @_cdecl("bjs_MathUtils_multiply") -public func _bjs_MathUtils_multiply(_self: UnsafeMutableRawPointer, x: Int32, y: Int32) -> Int32 { +public func _bjs_MathUtils_multiply(_ _self: UnsafeMutableRawPointer, _ x: Int32, _ y: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.bridgeJSLiftParameter(_self).multiply(x: Int.bridgeJSLiftParameter(x), y: Int.bridgeJSLiftParameter(y)) return ret.bridgeJSLowerReturn() @@ -173,8 +173,12 @@ public func _bjs_MathUtils_multiply(_self: UnsafeMutableRawPointer, x: Int32, y: @_expose(wasm, "bjs_MathUtils_deinit") @_cdecl("bjs_MathUtils_deinit") -public func _bjs_MathUtils_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_MathUtils_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension MathUtils: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -185,9 +189,9 @@ extension MathUtils: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_MathUtils_wrap") -fileprivate func _bjs_MathUtils_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_MathUtils_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_MathUtils_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_MathUtils_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.Global.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.Global.swift index e34f26f8..91577ebf 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.Global.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.Global.swift @@ -54,7 +54,7 @@ public func _bjs_PropertyEnum_static_enumProperty_get() -> Void { @_expose(wasm, "bjs_PropertyEnum_static_enumProperty_set") @_cdecl("bjs_PropertyEnum_static_enumProperty_set") -public func _bjs_PropertyEnum_static_enumProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyEnum_static_enumProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyEnum.enumProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -86,7 +86,7 @@ public func _bjs_PropertyEnum_static_computedEnum_get() -> Void { @_expose(wasm, "bjs_PropertyEnum_static_computedEnum_set") @_cdecl("bjs_PropertyEnum_static_computedEnum_set") -public func _bjs_PropertyEnum_static_computedEnum_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyEnum_static_computedEnum_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyEnum.computedEnum = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -107,7 +107,7 @@ public func _bjs_PropertyNamespace_static_namespaceProperty_get() -> Void { @_expose(wasm, "bjs_PropertyNamespace_static_namespaceProperty_set") @_cdecl("bjs_PropertyNamespace_static_namespaceProperty_set") -public func _bjs_PropertyNamespace_static_namespaceProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyNamespace_static_namespaceProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyNamespace.namespaceProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -139,7 +139,7 @@ public func _bjs_PropertyNamespace_Nested_static_nestedProperty_get() -> Int32 { @_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedProperty_set") @_cdecl("bjs_PropertyNamespace_Nested_static_nestedProperty_set") -public func _bjs_PropertyNamespace_Nested_static_nestedProperty_set(value: Int32) -> Void { +public func _bjs_PropertyNamespace_Nested_static_nestedProperty_set(_ value: Int32) -> Void { #if arch(wasm32) PropertyNamespace.Nested.nestedProperty = Int.bridgeJSLiftParameter(value) #else @@ -171,7 +171,7 @@ public func _bjs_PropertyNamespace_Nested_static_nestedDouble_get() -> Float64 { @_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedDouble_set") @_cdecl("bjs_PropertyNamespace_Nested_static_nestedDouble_set") -public func _bjs_PropertyNamespace_Nested_static_nestedDouble_set(value: Float64) -> Void { +public func _bjs_PropertyNamespace_Nested_static_nestedDouble_set(_ value: Float64) -> Void { #if arch(wasm32) PropertyNamespace.Nested.nestedDouble = Double.bridgeJSLiftParameter(value) #else @@ -214,7 +214,7 @@ public func _bjs_PropertyClass_static_staticVariable_get() -> Int32 { @_expose(wasm, "bjs_PropertyClass_static_staticVariable_set") @_cdecl("bjs_PropertyClass_static_staticVariable_set") -public func _bjs_PropertyClass_static_staticVariable_set(value: Int32) -> Void { +public func _bjs_PropertyClass_static_staticVariable_set(_ value: Int32) -> Void { #if arch(wasm32) PropertyClass.staticVariable = Int.bridgeJSLiftParameter(value) #else @@ -235,7 +235,7 @@ public func _bjs_PropertyClass_static_jsObjectProperty_get() -> Int32 { @_expose(wasm, "bjs_PropertyClass_static_jsObjectProperty_set") @_cdecl("bjs_PropertyClass_static_jsObjectProperty_set") -public func _bjs_PropertyClass_static_jsObjectProperty_set(value: Int32) -> Void { +public func _bjs_PropertyClass_static_jsObjectProperty_set(_ value: Int32) -> Void { #if arch(wasm32) PropertyClass.jsObjectProperty = JSObject.bridgeJSLiftParameter(value) #else @@ -256,7 +256,7 @@ public func _bjs_PropertyClass_static_classVariable_get() -> Void { @_expose(wasm, "bjs_PropertyClass_static_classVariable_set") @_cdecl("bjs_PropertyClass_static_classVariable_set") -public func _bjs_PropertyClass_static_classVariable_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyClass_static_classVariable_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyClass.classVariable = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -277,7 +277,7 @@ public func _bjs_PropertyClass_static_computedProperty_get() -> Void { @_expose(wasm, "bjs_PropertyClass_static_computedProperty_set") @_cdecl("bjs_PropertyClass_static_computedProperty_set") -public func _bjs_PropertyClass_static_computedProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyClass_static_computedProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyClass.computedProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -309,7 +309,7 @@ public func _bjs_PropertyClass_static_optionalProperty_get() -> Void { @_expose(wasm, "bjs_PropertyClass_static_optionalProperty_set") @_cdecl("bjs_PropertyClass_static_optionalProperty_set") -public func _bjs_PropertyClass_static_optionalProperty_set(valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyClass_static_optionalProperty_set(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyClass.optionalProperty = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -319,8 +319,12 @@ public func _bjs_PropertyClass_static_optionalProperty_set(valueIsSome: Int32, v @_expose(wasm, "bjs_PropertyClass_deinit") @_cdecl("bjs_PropertyClass_deinit") -public func _bjs_PropertyClass_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PropertyClass_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PropertyClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -331,9 +335,9 @@ extension PropertyClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_PropertyClass_wrap") -fileprivate func _bjs_PropertyClass_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PropertyClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PropertyClass_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PropertyClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.swift index e34f26f8..91577ebf 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticProperties.swift @@ -54,7 +54,7 @@ public func _bjs_PropertyEnum_static_enumProperty_get() -> Void { @_expose(wasm, "bjs_PropertyEnum_static_enumProperty_set") @_cdecl("bjs_PropertyEnum_static_enumProperty_set") -public func _bjs_PropertyEnum_static_enumProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyEnum_static_enumProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyEnum.enumProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -86,7 +86,7 @@ public func _bjs_PropertyEnum_static_computedEnum_get() -> Void { @_expose(wasm, "bjs_PropertyEnum_static_computedEnum_set") @_cdecl("bjs_PropertyEnum_static_computedEnum_set") -public func _bjs_PropertyEnum_static_computedEnum_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyEnum_static_computedEnum_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyEnum.computedEnum = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -107,7 +107,7 @@ public func _bjs_PropertyNamespace_static_namespaceProperty_get() -> Void { @_expose(wasm, "bjs_PropertyNamespace_static_namespaceProperty_set") @_cdecl("bjs_PropertyNamespace_static_namespaceProperty_set") -public func _bjs_PropertyNamespace_static_namespaceProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyNamespace_static_namespaceProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyNamespace.namespaceProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -139,7 +139,7 @@ public func _bjs_PropertyNamespace_Nested_static_nestedProperty_get() -> Int32 { @_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedProperty_set") @_cdecl("bjs_PropertyNamespace_Nested_static_nestedProperty_set") -public func _bjs_PropertyNamespace_Nested_static_nestedProperty_set(value: Int32) -> Void { +public func _bjs_PropertyNamespace_Nested_static_nestedProperty_set(_ value: Int32) -> Void { #if arch(wasm32) PropertyNamespace.Nested.nestedProperty = Int.bridgeJSLiftParameter(value) #else @@ -171,7 +171,7 @@ public func _bjs_PropertyNamespace_Nested_static_nestedDouble_get() -> Float64 { @_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedDouble_set") @_cdecl("bjs_PropertyNamespace_Nested_static_nestedDouble_set") -public func _bjs_PropertyNamespace_Nested_static_nestedDouble_set(value: Float64) -> Void { +public func _bjs_PropertyNamespace_Nested_static_nestedDouble_set(_ value: Float64) -> Void { #if arch(wasm32) PropertyNamespace.Nested.nestedDouble = Double.bridgeJSLiftParameter(value) #else @@ -214,7 +214,7 @@ public func _bjs_PropertyClass_static_staticVariable_get() -> Int32 { @_expose(wasm, "bjs_PropertyClass_static_staticVariable_set") @_cdecl("bjs_PropertyClass_static_staticVariable_set") -public func _bjs_PropertyClass_static_staticVariable_set(value: Int32) -> Void { +public func _bjs_PropertyClass_static_staticVariable_set(_ value: Int32) -> Void { #if arch(wasm32) PropertyClass.staticVariable = Int.bridgeJSLiftParameter(value) #else @@ -235,7 +235,7 @@ public func _bjs_PropertyClass_static_jsObjectProperty_get() -> Int32 { @_expose(wasm, "bjs_PropertyClass_static_jsObjectProperty_set") @_cdecl("bjs_PropertyClass_static_jsObjectProperty_set") -public func _bjs_PropertyClass_static_jsObjectProperty_set(value: Int32) -> Void { +public func _bjs_PropertyClass_static_jsObjectProperty_set(_ value: Int32) -> Void { #if arch(wasm32) PropertyClass.jsObjectProperty = JSObject.bridgeJSLiftParameter(value) #else @@ -256,7 +256,7 @@ public func _bjs_PropertyClass_static_classVariable_get() -> Void { @_expose(wasm, "bjs_PropertyClass_static_classVariable_set") @_cdecl("bjs_PropertyClass_static_classVariable_set") -public func _bjs_PropertyClass_static_classVariable_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyClass_static_classVariable_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyClass.classVariable = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -277,7 +277,7 @@ public func _bjs_PropertyClass_static_computedProperty_get() -> Void { @_expose(wasm, "bjs_PropertyClass_static_computedProperty_set") @_cdecl("bjs_PropertyClass_static_computedProperty_set") -public func _bjs_PropertyClass_static_computedProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyClass_static_computedProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyClass.computedProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -309,7 +309,7 @@ public func _bjs_PropertyClass_static_optionalProperty_get() -> Void { @_expose(wasm, "bjs_PropertyClass_static_optionalProperty_set") @_cdecl("bjs_PropertyClass_static_optionalProperty_set") -public func _bjs_PropertyClass_static_optionalProperty_set(valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyClass_static_optionalProperty_set(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyClass.optionalProperty = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -319,8 +319,12 @@ public func _bjs_PropertyClass_static_optionalProperty_set(valueIsSome: Int32, v @_expose(wasm, "bjs_PropertyClass_deinit") @_cdecl("bjs_PropertyClass_deinit") -public func _bjs_PropertyClass_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PropertyClass_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PropertyClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -331,9 +335,9 @@ extension PropertyClass: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_PropertyClass_wrap") -fileprivate func _bjs_PropertyClass_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PropertyClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PropertyClass_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PropertyClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StringParameter.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StringParameter.swift index 2a43d7bf..6e32c00d 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StringParameter.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StringParameter.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_checkString") @_cdecl("bjs_checkString") -public func _bjs_checkString(aBytes: Int32, aLength: Int32) -> Void { +public func _bjs_checkString(_ aBytes: Int32, _ aLength: Int32) -> Void { #if arch(wasm32) checkString(a: String.bridgeJSLiftParameter(aBytes, aLength)) #else @@ -18,7 +18,7 @@ public func _bjs_checkString(aBytes: Int32, aLength: Int32) -> Void { @_expose(wasm, "bjs_roundtripString") @_cdecl("bjs_roundtripString") -public func _bjs_roundtripString(aBytes: Int32, aLength: Int32) -> Void { +public func _bjs_roundtripString(_ aBytes: Int32, _ aLength: Int32) -> Void { #if arch(wasm32) let ret = roundtripString(a: String.bridgeJSLiftParameter(aBytes, aLength)) return ret.bridgeJSLowerReturn() diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClass.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClass.swift index 097f73a9..65279210 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClass.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClass.swift @@ -8,7 +8,7 @@ @_expose(wasm, "bjs_takeGreeter") @_cdecl("bjs_takeGreeter") -public func _bjs_takeGreeter(greeter: UnsafeMutableRawPointer) -> Void { +public func _bjs_takeGreeter(_ greeter: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) takeGreeter(greeter: Greeter.bridgeJSLiftParameter(greeter)) #else @@ -18,7 +18,7 @@ public func _bjs_takeGreeter(greeter: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_init") @_cdecl("bjs_Greeter_init") -public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -29,7 +29,7 @@ public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMuta @_expose(wasm, "bjs_Greeter_greet") @_cdecl("bjs_Greeter_greet") -public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -40,7 +40,7 @@ public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_changeName") @_cdecl("bjs_Greeter_changeName") -public func _bjs_Greeter_changeName(_self: UnsafeMutableRawPointer, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_Greeter_changeName(_ _self: UnsafeMutableRawPointer, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) Greeter.bridgeJSLiftParameter(_self).changeName(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) #else @@ -50,7 +50,7 @@ public func _bjs_Greeter_changeName(_self: UnsafeMutableRawPointer, nameBytes: I @_expose(wasm, "bjs_Greeter_name_get") @_cdecl("bjs_Greeter_name_get") -public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -61,7 +61,7 @@ public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_name_set") @_cdecl("bjs_Greeter_name_set") -public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_Greeter_name_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) Greeter.bridgeJSLiftParameter(_self).name = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -71,8 +71,12 @@ public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueBytes: In @_expose(wasm, "bjs_Greeter_deinit") @_cdecl("bjs_Greeter_deinit") -public func _bjs_Greeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Greeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -83,17 +87,21 @@ extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Greeter_wrap") -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_PublicGreeter_deinit") @_cdecl("bjs_PublicGreeter_deinit") -public func _bjs_PublicGreeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PublicGreeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PublicGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -104,17 +112,21 @@ extension PublicGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_PublicGreeter_wrap") -fileprivate func _bjs_PublicGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PublicGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PublicGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PublicGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_PackageGreeter_deinit") @_cdecl("bjs_PackageGreeter_deinit") -public func _bjs_PackageGreeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PackageGreeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PackageGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -125,9 +137,9 @@ extension PackageGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_PackageGreeter_wrap") -fileprivate func _bjs_PackageGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PackageGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PackageGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PackageGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift index c036a797..2e57a8a5 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift @@ -6,8 +6,14 @@ @_spi(BridgeJS) import JavaScriptKit +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModule10HttpStatusO_Si") -fileprivate func invoke_js_callback_TestModule_10TestModule10HttpStatusO_Si(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModule10HttpStatusO_Si(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModule10HttpStatusO_Si(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModule10HttpStatusO_Si: _BridgedSwiftClosureBox { let closure: (HttpStatus) -> Int @@ -21,23 +27,24 @@ private enum _BJS_Closure_10TestModule10HttpStatusO_Si { let box = _BJS_ClosureBox_10TestModule10HttpStatusO_Si(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (HttpStatus) -> Int { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModule10HttpStatusO_Si(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Int.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModule10HttpStatusO_Si(callbackValue, param0Value) + return Int.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModule10HttpStatusO_Si") @_cdecl("invoke_swift_closure_TestModule_10TestModule10HttpStatusO_Si") -public func _invoke_swift_closure_TestModule_10TestModule10HttpStatusO_Si(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Int32 { +public func _invoke_swift_closure_TestModule_10TestModule10HttpStatusO_Si(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Int32 { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModule10HttpStatusO_Si>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(HttpStatus.bridgeJSLiftParameter(param0)) @@ -47,8 +54,14 @@ public func _invoke_swift_closure_TestModule_10TestModule10HttpStatusO_Si(boxPtr #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModule5ThemeO_SS") -fileprivate func invoke_js_callback_TestModule_10TestModule5ThemeO_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModule5ThemeO_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModule5ThemeO_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModule5ThemeO_SS: _BridgedSwiftClosureBox { let closure: (Theme) -> String @@ -62,23 +75,24 @@ private enum _BJS_Closure_10TestModule5ThemeO_SS { let box = _BJS_ClosureBox_10TestModule5ThemeO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Theme) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModule5ThemeO_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModule5ThemeO_SS(callbackValue, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModule5ThemeO_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModule5ThemeO_SS") -public func _invoke_swift_closure_TestModule_10TestModule5ThemeO_SS(boxPtr: UnsafeMutableRawPointer, param0Bytes: Int32, param0Length: Int32) -> Void { +public func _invoke_swift_closure_TestModule_10TestModule5ThemeO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0Bytes: Int32, _ param0Length: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModule5ThemeO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Theme.bridgeJSLiftParameter(param0Bytes, param0Length)) @@ -88,8 +102,14 @@ public func _invoke_swift_closure_TestModule_10TestModule5ThemeO_SS(boxPtr: Unsa #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModule5ThemeO_Sb") -fileprivate func invoke_js_callback_TestModule_10TestModule5ThemeO_Sb(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModule5ThemeO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModule5ThemeO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModule5ThemeO_Sb: _BridgedSwiftClosureBox { let closure: (Theme) -> Bool @@ -103,23 +123,24 @@ private enum _BJS_Closure_10TestModule5ThemeO_Sb { let box = _BJS_ClosureBox_10TestModule5ThemeO_Sb(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Theme) -> Bool { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModule5ThemeO_Sb(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Bool.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModule5ThemeO_Sb(callbackValue, param0Value) + return Bool.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModule5ThemeO_Sb") @_cdecl("invoke_swift_closure_TestModule_10TestModule5ThemeO_Sb") -public func _invoke_swift_closure_TestModule_10TestModule5ThemeO_Sb(boxPtr: UnsafeMutableRawPointer, param0Bytes: Int32, param0Length: Int32) -> Int32 { +public func _invoke_swift_closure_TestModule_10TestModule5ThemeO_Sb(_ boxPtr: UnsafeMutableRawPointer, _ param0Bytes: Int32, _ param0Length: Int32) -> Int32 { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModule5ThemeO_Sb>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Theme.bridgeJSLiftParameter(param0Bytes, param0Length)) @@ -129,8 +150,14 @@ public func _invoke_swift_closure_TestModule_10TestModule5ThemeO_Sb(boxPtr: Unsa #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModule6PersonC_SS") -fileprivate func invoke_js_callback_TestModule_10TestModule6PersonC_SS(_: Int32, _: UnsafeMutableRawPointer) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModule6PersonC_SS(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModule6PersonC_SS(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModule6PersonC_SS: _BridgedSwiftClosureBox { let closure: (Person) -> String @@ -144,23 +171,24 @@ private enum _BJS_Closure_10TestModule6PersonC_SS { let box = _BJS_ClosureBox_10TestModule6PersonC_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Person) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModule6PersonC_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Pointer = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModule6PersonC_SS(callbackValue, param0Pointer) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModule6PersonC_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModule6PersonC_SS") -public func _invoke_swift_closure_TestModule_10TestModule6PersonC_SS(boxPtr: UnsafeMutableRawPointer, param0: UnsafeMutableRawPointer) -> Void { +public func _invoke_swift_closure_TestModule_10TestModule6PersonC_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModule6PersonC_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Person.bridgeJSLiftParameter(param0)) @@ -170,8 +198,14 @@ public func _invoke_swift_closure_TestModule_10TestModule6PersonC_SS(boxPtr: Uns #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModule9APIResultO_SS") -fileprivate func invoke_js_callback_TestModule_10TestModule9APIResultO_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModule9APIResultO_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModule9APIResultO_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModule9APIResultO_SS: _BridgedSwiftClosureBox { let closure: (APIResult) -> String @@ -185,23 +219,24 @@ private enum _BJS_Closure_10TestModule9APIResultO_SS { let box = _BJS_ClosureBox_10TestModule9APIResultO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (APIResult) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModule9APIResultO_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0CaseId = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModule9APIResultO_SS(callbackValue, param0CaseId) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModule9APIResultO_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModule9APIResultO_SS") -public func _invoke_swift_closure_TestModule_10TestModule9APIResultO_SS(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Void { +public func _invoke_swift_closure_TestModule_10TestModule9APIResultO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModule9APIResultO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(APIResult.bridgeJSLiftParameter(param0)) @@ -211,8 +246,14 @@ public func _invoke_swift_closure_TestModule_10TestModule9APIResultO_SS(boxPtr: #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModule9DirectionO_SS") -fileprivate func invoke_js_callback_TestModule_10TestModule9DirectionO_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModule9DirectionO_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModule9DirectionO_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModule9DirectionO_SS: _BridgedSwiftClosureBox { let closure: (Direction) -> String @@ -226,23 +267,24 @@ private enum _BJS_Closure_10TestModule9DirectionO_SS { let box = _BJS_ClosureBox_10TestModule9DirectionO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Direction) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModule9DirectionO_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModule9DirectionO_SS(callbackValue, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModule9DirectionO_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModule9DirectionO_SS") -public func _invoke_swift_closure_TestModule_10TestModule9DirectionO_SS(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Void { +public func _invoke_swift_closure_TestModule_10TestModule9DirectionO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModule9DirectionO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Direction.bridgeJSLiftParameter(param0)) @@ -252,8 +294,14 @@ public func _invoke_swift_closure_TestModule_10TestModule9DirectionO_SS(boxPtr: #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModule9DirectionO_Sb") -fileprivate func invoke_js_callback_TestModule_10TestModule9DirectionO_Sb(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModule9DirectionO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModule9DirectionO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModule9DirectionO_Sb: _BridgedSwiftClosureBox { let closure: (Direction) -> Bool @@ -267,23 +315,24 @@ private enum _BJS_Closure_10TestModule9DirectionO_Sb { let box = _BJS_ClosureBox_10TestModule9DirectionO_Sb(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Direction) -> Bool { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModule9DirectionO_Sb(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Bool.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModule9DirectionO_Sb(callbackValue, param0Value) + return Bool.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModule9DirectionO_Sb") @_cdecl("invoke_swift_closure_TestModule_10TestModule9DirectionO_Sb") -public func _invoke_swift_closure_TestModule_10TestModule9DirectionO_Sb(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Int32 { +public func _invoke_swift_closure_TestModule_10TestModule9DirectionO_Sb(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Int32 { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModule9DirectionO_Sb>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Direction.bridgeJSLiftParameter(param0)) @@ -293,8 +342,14 @@ public func _invoke_swift_closure_TestModule_10TestModule9DirectionO_Sb(boxPtr: #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuleSS_SS") -fileprivate func invoke_js_callback_TestModule_10TestModuleSS_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModuleSS_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModuleSS_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModuleSS_SS: _BridgedSwiftClosureBox { let closure: (String) -> String @@ -308,23 +363,24 @@ private enum _BJS_Closure_10TestModuleSS_SS { let box = _BJS_ClosureBox_10TestModuleSS_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (String) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_TestModule_10TestModuleSS_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuleSS_SS(callbackValue, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModuleSS_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModuleSS_SS") -public func _invoke_swift_closure_TestModule_10TestModuleSS_SS(boxPtr: UnsafeMutableRawPointer, param0Bytes: Int32, param0Length: Int32) -> Void { +public func _invoke_swift_closure_TestModule_10TestModuleSS_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0Bytes: Int32, _ param0Length: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModuleSS_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(String.bridgeJSLiftParameter(param0Bytes, param0Length)) @@ -334,8 +390,14 @@ public func _invoke_swift_closure_TestModule_10TestModuleSS_SS(boxPtr: UnsafeMut #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuleSq5ThemeO_SS") -fileprivate func invoke_js_callback_TestModule_10TestModuleSq5ThemeO_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModuleSq5ThemeO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModuleSq5ThemeO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModuleSq5ThemeO_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -349,24 +411,24 @@ private enum _BJS_Closure_10TestModuleSq5ThemeO_SS { let box = _BJS_ClosureBox_10TestModuleSq5ThemeO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_TestModule_10TestModuleSq5ThemeO_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Value) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuleSq5ThemeO_SS(callbackValue, param0IsSome, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModuleSq5ThemeO_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModuleSq5ThemeO_SS") -public func _invoke_swift_closure_TestModule_10TestModuleSq5ThemeO_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Bytes: Int32, param0Length: Int32) -> Void { +public func _invoke_swift_closure_TestModule_10TestModuleSq5ThemeO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Bytes: Int32, _ param0Length: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModuleSq5ThemeO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Bytes, param0Length)) @@ -376,8 +438,14 @@ public func _invoke_swift_closure_TestModule_10TestModuleSq5ThemeO_SS(boxPtr: Un #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS") -fileprivate func invoke_js_callback_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(_: Int32, _: Int32, _: UnsafeMutableRawPointer, _: Int32, _: Int32, _: Int32, _: Float64) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Pointer: UnsafeMutableRawPointer, _ param1IsSome: Int32, _ param1Value: Int32, _ param2IsSome: Int32, _ param2Value: Float64) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Pointer: UnsafeMutableRawPointer, _ param1IsSome: Int32, _ param1Value: Int32, _ param2IsSome: Int32, _ param2Value: Float64) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModuleSq6PersonCSqSSSqSd_SS: _BridgedSwiftClosureBox { let closure: (Optional, Optional, Optional) -> String @@ -391,26 +459,26 @@ private enum _BJS_Closure_10TestModuleSq6PersonCSqSSSqSd_SS { let box = _BJS_ClosureBox_10TestModuleSq6PersonCSqSSSqSd_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional, Optional, Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0, param1, param2 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithRetain() -let (param1IsSome, param1Value) = param1.bridgeJSLowerParameterWithPresence() -let (param2IsSome, param2Value) = param2.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value, param1IsSome, param1Value, param2IsSome, param2Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0, param1, param2 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Pointer) = param0.bridgeJSLowerParameter() + let (param1IsSome, param1Value) = param1.bridgeJSLowerParameter() + let (param2IsSome, param2Value) = param2.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(callbackValue, param0IsSome, param0Pointer, param1IsSome, param1Value, param2IsSome, param2Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS") -public func _invoke_swift_closure_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Value: UnsafeMutableRawPointer, param1IsSome: Int32, param1Bytes: Int32, param1Length: Int32, param2IsSome: Int32, param2Value: Float64) -> Void { +public func _invoke_swift_closure_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Value: UnsafeMutableRawPointer, _ param1IsSome: Int32, _ param1Bytes: Int32, _ param1Length: Int32, _ param2IsSome: Int32, _ param2Value: Float64) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModuleSq6PersonCSqSSSqSd_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Value), Optional.bridgeJSLiftParameter(param1IsSome, param1Bytes, param1Length), Optional.bridgeJSLiftParameter(param2IsSome, param2Value)) @@ -420,8 +488,14 @@ public func _invoke_swift_closure_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS(b #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuleSq6PersonC_SS") -fileprivate func invoke_js_callback_TestModule_10TestModuleSq6PersonC_SS(_: Int32, _: Int32, _: UnsafeMutableRawPointer) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModuleSq6PersonC_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModuleSq6PersonC_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModuleSq6PersonC_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -435,24 +509,24 @@ private enum _BJS_Closure_10TestModuleSq6PersonC_SS { let box = _BJS_ClosureBox_10TestModuleSq6PersonC_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithRetain() -let resultId = invoke_js_callback_TestModule_10TestModuleSq6PersonC_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Pointer) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuleSq6PersonC_SS(callbackValue, param0IsSome, param0Pointer) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModuleSq6PersonC_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModuleSq6PersonC_SS") -public func _invoke_swift_closure_TestModule_10TestModuleSq6PersonC_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Value: UnsafeMutableRawPointer) -> Void { +public func _invoke_swift_closure_TestModule_10TestModuleSq6PersonC_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModuleSq6PersonC_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Value)) @@ -462,8 +536,14 @@ public func _invoke_swift_closure_TestModule_10TestModuleSq6PersonC_SS(boxPtr: U #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuleSq9APIResultO_SS") -fileprivate func invoke_js_callback_TestModule_10TestModuleSq9APIResultO_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModuleSq9APIResultO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0CaseId: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModuleSq9APIResultO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0CaseId: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModuleSq9APIResultO_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -477,24 +557,24 @@ private enum _BJS_Closure_10TestModuleSq9APIResultO_SS { let box = _BJS_ClosureBox_10TestModuleSq9APIResultO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_TestModule_10TestModuleSq9APIResultO_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0CaseId) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuleSq9APIResultO_SS(callbackValue, param0IsSome, param0CaseId) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModuleSq9APIResultO_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModuleSq9APIResultO_SS") -public func _invoke_swift_closure_TestModule_10TestModuleSq9APIResultO_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0CaseId: Int32) -> Void { +public func _invoke_swift_closure_TestModule_10TestModuleSq9APIResultO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0CaseId: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModuleSq9APIResultO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0CaseId)) @@ -504,8 +584,14 @@ public func _invoke_swift_closure_TestModule_10TestModuleSq9APIResultO_SS(boxPtr #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_TestModule_10TestModuleSq9DirectionO_SS") -fileprivate func invoke_js_callback_TestModule_10TestModuleSq9DirectionO_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_TestModule_10TestModuleSq9DirectionO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_TestModule_10TestModuleSq9DirectionO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_10TestModuleSq9DirectionO_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -519,24 +605,24 @@ private enum _BJS_Closure_10TestModuleSq9DirectionO_SS { let box = _BJS_ClosureBox_10TestModuleSq9DirectionO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_TestModule_10TestModuleSq9DirectionO_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Value) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_TestModule_10TestModuleSq9DirectionO_SS(callbackValue, param0IsSome, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_TestModule_10TestModuleSq9DirectionO_SS") @_cdecl("invoke_swift_closure_TestModule_10TestModuleSq9DirectionO_SS") -public func _invoke_swift_closure_TestModule_10TestModuleSq9DirectionO_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Value: Int32) -> Void { +public func _invoke_swift_closure_TestModule_10TestModuleSq9DirectionO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Value: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_10TestModuleSq9DirectionO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Value)) @@ -680,7 +766,7 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { @_expose(wasm, "bjs_Person_init") @_cdecl("bjs_Person_init") -public func _bjs_Person_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Person_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Person(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -691,8 +777,12 @@ public func _bjs_Person_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutab @_expose(wasm, "bjs_Person_deinit") @_cdecl("bjs_Person_deinit") -public func _bjs_Person_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Person_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Person: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -703,16 +793,16 @@ extension Person: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Person_wrap") -fileprivate func _bjs_Person_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Person_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Person_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Person_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_TestProcessor_init") @_cdecl("bjs_TestProcessor_init") -public func _bjs_TestProcessor_init(transform: Int32) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_init(_ transform: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor(transform: _BJS_Closure_10TestModuleSS_SS.bridgeJSLift(transform)) return ret.bridgeJSLowerReturn() @@ -723,7 +813,7 @@ public func _bjs_TestProcessor_init(transform: Int32) -> UnsafeMutableRawPointer @_expose(wasm, "bjs_TestProcessor_getTransform") @_cdecl("bjs_TestProcessor_getTransform") -public func _bjs_TestProcessor_getTransform(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_getTransform(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).getTransform() return _BJS_Closure_10TestModuleSS_SS.bridgeJSLower(ret) @@ -734,7 +824,7 @@ public func _bjs_TestProcessor_getTransform(_self: UnsafeMutableRawPointer) -> U @_expose(wasm, "bjs_TestProcessor_processWithCustom") @_cdecl("bjs_TestProcessor_processWithCustom") -public func _bjs_TestProcessor_processWithCustom(_self: UnsafeMutableRawPointer, textBytes: Int32, textLength: Int32, customTransform: Int32) -> Void { +public func _bjs_TestProcessor_processWithCustom(_ _self: UnsafeMutableRawPointer, _ textBytes: Int32, _ textLength: Int32, _ customTransform: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processWithCustom(_: String.bridgeJSLiftParameter(textBytes, textLength), customTransform: _BJS_Closure_10TestModuleSS_SS.bridgeJSLift(customTransform)) return ret.bridgeJSLowerReturn() @@ -745,7 +835,7 @@ public func _bjs_TestProcessor_processWithCustom(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TestProcessor_printTogether") @_cdecl("bjs_TestProcessor_printTogether") -public func _bjs_TestProcessor_printTogether(_self: UnsafeMutableRawPointer, person: UnsafeMutableRawPointer, nameBytes: Int32, nameLength: Int32, ratio: Float64, customTransform: Int32) -> Void { +public func _bjs_TestProcessor_printTogether(_ _self: UnsafeMutableRawPointer, _ person: UnsafeMutableRawPointer, _ nameBytes: Int32, _ nameLength: Int32, _ ratio: Float64, _ customTransform: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).printTogether(person: Person.bridgeJSLiftParameter(person), name: String.bridgeJSLiftParameter(nameBytes, nameLength), ratio: Double.bridgeJSLiftParameter(ratio), customTransform: _BJS_Closure_10TestModuleSq6PersonCSqSSSqSd_SS.bridgeJSLift(customTransform)) return ret.bridgeJSLowerReturn() @@ -756,7 +846,7 @@ public func _bjs_TestProcessor_printTogether(_self: UnsafeMutableRawPointer, per @_expose(wasm, "bjs_TestProcessor_roundtrip") @_cdecl("bjs_TestProcessor_roundtrip") -public func _bjs_TestProcessor_roundtrip(_self: UnsafeMutableRawPointer, personClosure: Int32) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_roundtrip(_ _self: UnsafeMutableRawPointer, _ personClosure: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).roundtrip(_: _BJS_Closure_10TestModule6PersonC_SS.bridgeJSLift(personClosure)) return _BJS_Closure_10TestModule6PersonC_SS.bridgeJSLower(ret) @@ -767,7 +857,7 @@ public func _bjs_TestProcessor_roundtrip(_self: UnsafeMutableRawPointer, personC @_expose(wasm, "bjs_TestProcessor_roundtripOptional") @_cdecl("bjs_TestProcessor_roundtripOptional") -public func _bjs_TestProcessor_roundtripOptional(_self: UnsafeMutableRawPointer, personClosure: Int32) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_roundtripOptional(_ _self: UnsafeMutableRawPointer, _ personClosure: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).roundtripOptional(_: _BJS_Closure_10TestModuleSq6PersonC_SS.bridgeJSLift(personClosure)) return _BJS_Closure_10TestModuleSq6PersonC_SS.bridgeJSLower(ret) @@ -778,7 +868,7 @@ public func _bjs_TestProcessor_roundtripOptional(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TestProcessor_processDirection") @_cdecl("bjs_TestProcessor_processDirection") -public func _bjs_TestProcessor_processDirection(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TestProcessor_processDirection(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processDirection(_: _BJS_Closure_10TestModule9DirectionO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -789,7 +879,7 @@ public func _bjs_TestProcessor_processDirection(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TestProcessor_processTheme") @_cdecl("bjs_TestProcessor_processTheme") -public func _bjs_TestProcessor_processTheme(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TestProcessor_processTheme(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processTheme(_: _BJS_Closure_10TestModule5ThemeO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -800,7 +890,7 @@ public func _bjs_TestProcessor_processTheme(_self: UnsafeMutableRawPointer, call @_expose(wasm, "bjs_TestProcessor_processHttpStatus") @_cdecl("bjs_TestProcessor_processHttpStatus") -public func _bjs_TestProcessor_processHttpStatus(_self: UnsafeMutableRawPointer, callback: Int32) -> Int32 { +public func _bjs_TestProcessor_processHttpStatus(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Int32 { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processHttpStatus(_: _BJS_Closure_10TestModule10HttpStatusO_Si.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -811,7 +901,7 @@ public func _bjs_TestProcessor_processHttpStatus(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TestProcessor_processAPIResult") @_cdecl("bjs_TestProcessor_processAPIResult") -public func _bjs_TestProcessor_processAPIResult(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TestProcessor_processAPIResult(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processAPIResult(_: _BJS_Closure_10TestModule9APIResultO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -822,7 +912,7 @@ public func _bjs_TestProcessor_processAPIResult(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TestProcessor_makeDirectionChecker") @_cdecl("bjs_TestProcessor_makeDirectionChecker") -public func _bjs_TestProcessor_makeDirectionChecker(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_makeDirectionChecker(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).makeDirectionChecker() return _BJS_Closure_10TestModule9DirectionO_Sb.bridgeJSLower(ret) @@ -833,7 +923,7 @@ public func _bjs_TestProcessor_makeDirectionChecker(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_TestProcessor_makeThemeValidator") @_cdecl("bjs_TestProcessor_makeThemeValidator") -public func _bjs_TestProcessor_makeThemeValidator(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_makeThemeValidator(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).makeThemeValidator() return _BJS_Closure_10TestModule5ThemeO_Sb.bridgeJSLower(ret) @@ -844,7 +934,7 @@ public func _bjs_TestProcessor_makeThemeValidator(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_TestProcessor_makeStatusCodeExtractor") @_cdecl("bjs_TestProcessor_makeStatusCodeExtractor") -public func _bjs_TestProcessor_makeStatusCodeExtractor(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_makeStatusCodeExtractor(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).makeStatusCodeExtractor() return _BJS_Closure_10TestModule10HttpStatusO_Si.bridgeJSLower(ret) @@ -855,7 +945,7 @@ public func _bjs_TestProcessor_makeStatusCodeExtractor(_self: UnsafeMutableRawPo @_expose(wasm, "bjs_TestProcessor_makeAPIResultHandler") @_cdecl("bjs_TestProcessor_makeAPIResultHandler") -public func _bjs_TestProcessor_makeAPIResultHandler(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_makeAPIResultHandler(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).makeAPIResultHandler() return _BJS_Closure_10TestModule9APIResultO_SS.bridgeJSLower(ret) @@ -866,7 +956,7 @@ public func _bjs_TestProcessor_makeAPIResultHandler(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_TestProcessor_processOptionalDirection") @_cdecl("bjs_TestProcessor_processOptionalDirection") -public func _bjs_TestProcessor_processOptionalDirection(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TestProcessor_processOptionalDirection(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processOptionalDirection(_: _BJS_Closure_10TestModuleSq9DirectionO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -877,7 +967,7 @@ public func _bjs_TestProcessor_processOptionalDirection(_self: UnsafeMutableRawP @_expose(wasm, "bjs_TestProcessor_processOptionalTheme") @_cdecl("bjs_TestProcessor_processOptionalTheme") -public func _bjs_TestProcessor_processOptionalTheme(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TestProcessor_processOptionalTheme(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processOptionalTheme(_: _BJS_Closure_10TestModuleSq5ThemeO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -888,7 +978,7 @@ public func _bjs_TestProcessor_processOptionalTheme(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_TestProcessor_processOptionalAPIResult") @_cdecl("bjs_TestProcessor_processOptionalAPIResult") -public func _bjs_TestProcessor_processOptionalAPIResult(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TestProcessor_processOptionalAPIResult(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).processOptionalAPIResult(_: _BJS_Closure_10TestModuleSq9APIResultO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -899,7 +989,7 @@ public func _bjs_TestProcessor_processOptionalAPIResult(_self: UnsafeMutableRawP @_expose(wasm, "bjs_TestProcessor_makeOptionalDirectionFormatter") @_cdecl("bjs_TestProcessor_makeOptionalDirectionFormatter") -public func _bjs_TestProcessor_makeOptionalDirectionFormatter(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TestProcessor_makeOptionalDirectionFormatter(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TestProcessor.bridgeJSLiftParameter(_self).makeOptionalDirectionFormatter() return _BJS_Closure_10TestModuleSq9DirectionO_SS.bridgeJSLower(ret) @@ -910,8 +1000,12 @@ public func _bjs_TestProcessor_makeOptionalDirectionFormatter(_self: UnsafeMutab @_expose(wasm, "bjs_TestProcessor_deinit") @_cdecl("bjs_TestProcessor_deinit") -public func _bjs_TestProcessor_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_TestProcessor_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension TestProcessor: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -922,9 +1016,9 @@ extension TestProcessor: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_TestProcessor_wrap") -fileprivate func _bjs_TestProcessor_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_TestProcessor_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_TestProcessor_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_TestProcessor_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift index 57635c62..f35fc3b0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift @@ -38,7 +38,7 @@ extension DataPoint: _BridgedSwiftStruct { @_expose(wasm, "bjs_DataPoint_init") @_cdecl("bjs_DataPoint_init") -public func _bjs_DataPoint_init(x: Float64, y: Float64, labelBytes: Int32, labelLength: Int32, optCountIsSome: Int32, optCountValue: Int32, optFlagIsSome: Int32, optFlagValue: Int32) -> Void { +public func _bjs_DataPoint_init(_ x: Float64, _ y: Float64, _ labelBytes: Int32, _ labelLength: Int32, _ optCountIsSome: Int32, _ optCountValue: Int32, _ optFlagIsSome: Int32, _ optFlagValue: Int32) -> Void { #if arch(wasm32) let ret = DataPoint(x: Double.bridgeJSLiftParameter(x), y: Double.bridgeJSLiftParameter(y), label: String.bridgeJSLiftParameter(labelBytes, labelLength), optCount: Optional.bridgeJSLiftParameter(optCountIsSome, optCountValue), optFlag: Optional.bridgeJSLiftParameter(optFlagIsSome, optFlagValue)) return ret.bridgeJSLowerReturn() @@ -146,7 +146,7 @@ public func _bjs_ConfigStruct_static_defaultConfig_get() -> Void { @_expose(wasm, "bjs_ConfigStruct_static_defaultConfig_set") @_cdecl("bjs_ConfigStruct_static_defaultConfig_set") -public func _bjs_ConfigStruct_static_defaultConfig_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_ConfigStruct_static_defaultConfig_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) ConfigStruct.defaultConfig = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -167,7 +167,7 @@ public func _bjs_ConfigStruct_static_timeout_get() -> Float64 { @_expose(wasm, "bjs_ConfigStruct_static_timeout_set") @_cdecl("bjs_ConfigStruct_static_timeout_set") -public func _bjs_ConfigStruct_static_timeout_set(value: Float64) -> Void { +public func _bjs_ConfigStruct_static_timeout_set(_ value: Float64) -> Void { #if arch(wasm32) ConfigStruct.timeout = Double.bridgeJSLiftParameter(value) #else @@ -188,7 +188,7 @@ public func _bjs_ConfigStruct_static_computedSetting_get() -> Void { @_expose(wasm, "bjs_ConfigStruct_static_update") @_cdecl("bjs_ConfigStruct_static_update") -public func _bjs_ConfigStruct_static_update(timeout: Float64) -> Float64 { +public func _bjs_ConfigStruct_static_update(_ timeout: Float64) -> Float64 { #if arch(wasm32) let ret = ConfigStruct.update(_: Double.bridgeJSLiftParameter(timeout)) return ret.bridgeJSLowerReturn() @@ -210,7 +210,7 @@ public func _bjs_roundtrip() -> Void { @_expose(wasm, "bjs_Greeter_init") @_cdecl("bjs_Greeter_init") -public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -221,7 +221,7 @@ public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMuta @_expose(wasm, "bjs_Greeter_greet") @_cdecl("bjs_Greeter_greet") -public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -232,7 +232,7 @@ public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_name_get") @_cdecl("bjs_Greeter_name_get") -public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -243,7 +243,7 @@ public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_name_set") @_cdecl("bjs_Greeter_name_set") -public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_Greeter_name_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) Greeter.bridgeJSLiftParameter(_self).name = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -253,8 +253,12 @@ public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueBytes: In @_expose(wasm, "bjs_Greeter_deinit") @_cdecl("bjs_Greeter_deinit") -public func _bjs_Greeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Greeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -265,9 +269,9 @@ extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "TestModule", name: "bjs_Greeter_wrap") -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/ArrayParameter.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/ArrayParameter.swift index 1806d8aa..56425b20 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/ArrayParameter.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/ArrayParameter.swift @@ -16,7 +16,8 @@ fileprivate func bjs_checkArray(_ a: Int32) -> Void { #endif func checkArray(_ a: JSObject) throws(JSException) -> Void { - bjs_checkArray(a.bridgeJSLowerParameter()) + let aValue = a.bridgeJSLowerParameter() + bjs_checkArray(aValue) if let error = _swift_js_take_exception() { throw error } @@ -32,7 +33,9 @@ fileprivate func bjs_checkArrayWithLength(_ a: Int32, _ b: Float64) -> Void { #endif func checkArrayWithLength(_ a: JSObject, _ b: Double) throws(JSException) -> Void { - bjs_checkArrayWithLength(a.bridgeJSLowerParameter(), b.bridgeJSLowerParameter()) + let aValue = a.bridgeJSLowerParameter() + let bValue = b.bridgeJSLowerParameter() + bjs_checkArrayWithLength(aValue, bValue) if let error = _swift_js_take_exception() { throw error } @@ -48,7 +51,8 @@ fileprivate func bjs_checkArray(_ a: Int32) -> Void { #endif func checkArray(_ a: JSObject) throws(JSException) -> Void { - bjs_checkArray(a.bridgeJSLowerParameter()) + let aValue = a.bridgeJSLowerParameter() + bjs_checkArray(aValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Async.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Async.swift index 5e564aa3..41a89ad2 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Async.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Async.swift @@ -33,7 +33,8 @@ fileprivate func bjs_asyncRoundTripInt(_ v: Float64) -> Int32 { #endif func asyncRoundTripInt(_ v: Double) throws(JSException) -> JSPromise { - let ret = bjs_asyncRoundTripInt(v.bridgeJSLowerParameter()) + let vValue = v.bridgeJSLowerParameter() + let ret = bjs_asyncRoundTripInt(vValue) if let error = _swift_js_take_exception() { throw error } @@ -50,7 +51,8 @@ fileprivate func bjs_asyncRoundTripString(_ v: Int32) -> Int32 { #endif func asyncRoundTripString(_ v: String) throws(JSException) -> JSPromise { - let ret = bjs_asyncRoundTripString(v.bridgeJSLowerParameter()) + let vValue = v.bridgeJSLowerParameter() + let ret = bjs_asyncRoundTripString(vValue) if let error = _swift_js_take_exception() { throw error } @@ -67,7 +69,8 @@ fileprivate func bjs_asyncRoundTripBool(_ v: Int32) -> Int32 { #endif func asyncRoundTripBool(_ v: Bool) throws(JSException) -> JSPromise { - let ret = bjs_asyncRoundTripBool(v.bridgeJSLowerParameter()) + let vValue = v.bridgeJSLowerParameter() + let ret = bjs_asyncRoundTripBool(vValue) if let error = _swift_js_take_exception() { throw error } @@ -84,7 +87,8 @@ fileprivate func bjs_asyncRoundTripFloat(_ v: Float64) -> Int32 { #endif func asyncRoundTripFloat(_ v: Double) throws(JSException) -> JSPromise { - let ret = bjs_asyncRoundTripFloat(v.bridgeJSLowerParameter()) + let vValue = v.bridgeJSLowerParameter() + let ret = bjs_asyncRoundTripFloat(vValue) if let error = _swift_js_take_exception() { throw error } @@ -101,7 +105,8 @@ fileprivate func bjs_asyncRoundTripDouble(_ v: Float64) -> Int32 { #endif func asyncRoundTripDouble(_ v: Double) throws(JSException) -> JSPromise { - let ret = bjs_asyncRoundTripDouble(v.bridgeJSLowerParameter()) + let vValue = v.bridgeJSLowerParameter() + let ret = bjs_asyncRoundTripDouble(vValue) if let error = _swift_js_take_exception() { throw error } @@ -118,7 +123,8 @@ fileprivate func bjs_asyncRoundTripJSObject(_ v: Int32) -> Int32 { #endif func asyncRoundTripJSObject(_ v: JSObject) throws(JSException) -> JSPromise { - let ret = bjs_asyncRoundTripJSObject(v.bridgeJSLowerParameter()) + let vValue = v.bridgeJSLowerParameter() + let ret = bjs_asyncRoundTripJSObject(vValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Interface.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Interface.swift index 12e04e05..12277171 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Interface.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Interface.swift @@ -49,7 +49,10 @@ struct Animatable: _JSBridgedClass { } func animate(_ keyframes: JSObject, _ options: JSObject) throws(JSException) -> JSObject { - let ret = bjs_Animatable_animate(self.bridgeJSLowerParameter(), keyframes.bridgeJSLowerParameter(), options.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let keyframesValue = keyframes.bridgeJSLowerParameter() + let optionsValue = options.bridgeJSLowerParameter() + let ret = bjs_Animatable_animate(selfValue, keyframesValue, optionsValue) if let error = _swift_js_take_exception() { throw error } @@ -57,7 +60,9 @@ struct Animatable: _JSBridgedClass { } func getAnimations(_ options: JSObject) throws(JSException) -> JSObject { - let ret = bjs_Animatable_getAnimations(self.bridgeJSLowerParameter(), options.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let optionsValue = options.bridgeJSLowerParameter() + let ret = bjs_Animatable_getAnimations(selfValue, optionsValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/InvalidPropertyNames.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/InvalidPropertyNames.swift index 9fa2feaf..c7868299 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/InvalidPropertyNames.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/InvalidPropertyNames.swift @@ -67,7 +67,8 @@ struct ArrayBufferLike: _JSBridgedClass { var byteLength: Double { get throws(JSException) { - let ret = bjs_ArrayBufferLike_byteLength_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_ArrayBufferLike_byteLength_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -76,7 +77,10 @@ struct ArrayBufferLike: _JSBridgedClass { } func slice(_ begin: Double, _ end: Double) throws(JSException) -> ArrayBufferLike { - let ret = bjs_ArrayBufferLike_slice(self.bridgeJSLowerParameter(), begin.bridgeJSLowerParameter(), end.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let beginValue = begin.bridgeJSLowerParameter() + let endValue = end.bridgeJSLowerParameter() + let ret = bjs_ArrayBufferLike_slice(selfValue, beginValue, endValue) if let error = _swift_js_take_exception() { throw error } @@ -157,7 +161,8 @@ struct WeirdNaming: _JSBridgedClass { var normalProperty: String { get throws(JSException) { - let ret = bjs_WeirdNaming_normalProperty_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_WeirdNaming_normalProperty_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -166,7 +171,9 @@ struct WeirdNaming: _JSBridgedClass { } func setNormalProperty(_ newValue: String) throws(JSException) -> Void { - bjs_WeirdNaming_normalProperty_set(self.bridgeJSLowerParameter(), newValue.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_WeirdNaming_normalProperty_set(selfValue, newValueValue) if let error = _swift_js_take_exception() { throw error } @@ -174,7 +181,8 @@ struct WeirdNaming: _JSBridgedClass { var `for`: String { get throws(JSException) { - let ret = bjs_WeirdNaming_for_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_WeirdNaming_for_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -183,7 +191,9 @@ struct WeirdNaming: _JSBridgedClass { } func setFor(_ newValue: String) throws(JSException) -> Void { - bjs_WeirdNaming_for_set(self.bridgeJSLowerParameter(), newValue.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_WeirdNaming_for_set(selfValue, newValueValue) if let error = _swift_js_take_exception() { throw error } @@ -191,7 +201,8 @@ struct WeirdNaming: _JSBridgedClass { var `Any`: String { get throws(JSException) { - let ret = bjs_WeirdNaming_Any_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_WeirdNaming_Any_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -200,14 +211,17 @@ struct WeirdNaming: _JSBridgedClass { } func setAny(_ newValue: String) throws(JSException) -> Void { - bjs_WeirdNaming_Any_set(self.bridgeJSLowerParameter(), newValue.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_WeirdNaming_Any_set(selfValue, newValueValue) if let error = _swift_js_take_exception() { throw error } } func `as`() throws(JSException) -> Void { - bjs_WeirdNaming_as(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + bjs_WeirdNaming_as(selfValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/MultipleImportedTypes.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/MultipleImportedTypes.swift index 3102cd6e..1f8a1480 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/MultipleImportedTypes.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/MultipleImportedTypes.swift @@ -16,7 +16,8 @@ fileprivate func bjs_createDatabaseConnection(_ config: Int32) -> Int32 { #endif func createDatabaseConnection(_ config: JSObject) throws(JSException) -> DatabaseConnection { - let ret = bjs_createDatabaseConnection(config.bridgeJSLowerParameter()) + let configValue = config.bridgeJSLowerParameter() + let ret = bjs_createDatabaseConnection(configValue) if let error = _swift_js_take_exception() { throw error } @@ -33,7 +34,8 @@ fileprivate func bjs_createLogger(_ level: Int32) -> Int32 { #endif func createLogger(_ level: String) throws(JSException) -> Logger { - let ret = bjs_createLogger(level.bridgeJSLowerParameter()) + let levelValue = level.bridgeJSLowerParameter() + let ret = bjs_createLogger(levelValue) if let error = _swift_js_take_exception() { throw error } @@ -111,7 +113,8 @@ struct DatabaseConnection: _JSBridgedClass { var isConnected: Bool { get throws(JSException) { - let ret = bjs_DatabaseConnection_isConnected_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_DatabaseConnection_isConnected_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -121,7 +124,8 @@ struct DatabaseConnection: _JSBridgedClass { var connectionTimeout: Double { get throws(JSException) { - let ret = bjs_DatabaseConnection_connectionTimeout_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_DatabaseConnection_connectionTimeout_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -130,21 +134,27 @@ struct DatabaseConnection: _JSBridgedClass { } func setConnectionTimeout(_ newValue: Double) throws(JSException) -> Void { - bjs_DatabaseConnection_connectionTimeout_set(self.bridgeJSLowerParameter(), newValue.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_DatabaseConnection_connectionTimeout_set(selfValue, newValueValue) if let error = _swift_js_take_exception() { throw error } } func connect(_ url: String) throws(JSException) -> Void { - bjs_DatabaseConnection_connect(self.bridgeJSLowerParameter(), url.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let urlValue = url.bridgeJSLowerParameter() + bjs_DatabaseConnection_connect(selfValue, urlValue) if let error = _swift_js_take_exception() { throw error } } func execute(_ query: String) throws(JSException) -> JSObject { - let ret = bjs_DatabaseConnection_execute(self.bridgeJSLowerParameter(), query.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let queryValue = query.bridgeJSLowerParameter() + let ret = bjs_DatabaseConnection_execute(selfValue, queryValue) if let error = _swift_js_take_exception() { throw error } @@ -189,7 +199,8 @@ struct Logger: _JSBridgedClass { var level: String { get throws(JSException) { - let ret = bjs_Logger_level_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_Logger_level_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -198,14 +209,19 @@ struct Logger: _JSBridgedClass { } func log(_ message: String) throws(JSException) -> Void { - bjs_Logger_log(self.bridgeJSLowerParameter(), message.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let messageValue = message.bridgeJSLowerParameter() + bjs_Logger_log(selfValue, messageValue) if let error = _swift_js_take_exception() { throw error } } func error(_ message: String, _ error: JSObject) throws(JSException) -> Void { - bjs_Logger_error(self.bridgeJSLowerParameter(), message.bridgeJSLowerParameter(), error.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let messageValue = message.bridgeJSLowerParameter() + let errorValue = error.bridgeJSLowerParameter() + bjs_Logger_error(selfValue, messageValue, errorValue) if let error = _swift_js_take_exception() { throw error } @@ -249,7 +265,8 @@ struct ConfigManager: _JSBridgedClass { var configPath: String { get throws(JSException) { - let ret = bjs_ConfigManager_configPath_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_ConfigManager_configPath_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -258,7 +275,9 @@ struct ConfigManager: _JSBridgedClass { } func get(_ key: String) throws(JSException) -> JSObject { - let ret = bjs_ConfigManager_get(self.bridgeJSLowerParameter(), key.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let keyValue = key.bridgeJSLowerParameter() + let ret = bjs_ConfigManager_get(selfValue, keyValue) if let error = _swift_js_take_exception() { throw error } @@ -266,7 +285,10 @@ struct ConfigManager: _JSBridgedClass { } func set(_ key: String, _ value: JSObject) throws(JSException) -> Void { - bjs_ConfigManager_set(self.bridgeJSLowerParameter(), key.bridgeJSLowerParameter(), value.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let keyValue = key.bridgeJSLowerParameter() + let valueValue = value.bridgeJSLowerParameter() + bjs_ConfigManager_set(selfValue, keyValue, valueValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/PrimitiveParameters.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/PrimitiveParameters.swift index 2643eaa0..90088799 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/PrimitiveParameters.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/PrimitiveParameters.swift @@ -16,7 +16,9 @@ fileprivate func bjs_check(_ a: Float64, _ b: Int32) -> Void { #endif func check(_ a: Double, _ b: Bool) throws(JSException) -> Void { - bjs_check(a.bridgeJSLowerParameter(), b.bridgeJSLowerParameter()) + let aValue = a.bridgeJSLowerParameter() + let bValue = b.bridgeJSLowerParameter() + bjs_check(aValue, bValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/StringParameter.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/StringParameter.swift index 68b341ca..35502a7c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/StringParameter.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/StringParameter.swift @@ -16,7 +16,8 @@ fileprivate func bjs_checkString(_ a: Int32) -> Void { #endif func checkString(_ a: String) throws(JSException) -> Void { - bjs_checkString(a.bridgeJSLowerParameter()) + let aValue = a.bridgeJSLowerParameter() + bjs_checkString(aValue) if let error = _swift_js_take_exception() { throw error } @@ -32,7 +33,9 @@ fileprivate func bjs_checkStringWithLength(_ a: Int32, _ b: Float64) -> Void { #endif func checkStringWithLength(_ a: String, _ b: Double) throws(JSException) -> Void { - bjs_checkStringWithLength(a.bridgeJSLowerParameter(), b.bridgeJSLowerParameter()) + let aValue = a.bridgeJSLowerParameter() + let bValue = b.bridgeJSLowerParameter() + bjs_checkStringWithLength(aValue, bValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TS2SkeletonLike.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TS2SkeletonLike.swift index 2e4331c7..26d37a90 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TS2SkeletonLike.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TS2SkeletonLike.swift @@ -33,7 +33,8 @@ fileprivate func bjs_createCodeGenerator(_ format: Int32) -> Int32 { #endif func createCodeGenerator(_ format: String) throws(JSException) -> CodeGenerator { - let ret = bjs_createCodeGenerator(format.bridgeJSLowerParameter()) + let formatValue = format.bridgeJSLowerParameter() + let ret = bjs_createCodeGenerator(formatValue) if let error = _swift_js_take_exception() { throw error } @@ -76,7 +77,8 @@ struct TypeScriptProcessor: _JSBridgedClass { var version: String { get throws(JSException) { - let ret = bjs_TypeScriptProcessor_version_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_TypeScriptProcessor_version_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -85,7 +87,9 @@ struct TypeScriptProcessor: _JSBridgedClass { } func convert(_ ts: String) throws(JSException) -> String { - let ret = bjs_TypeScriptProcessor_convert(self.bridgeJSLowerParameter(), ts.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let tsValue = ts.bridgeJSLowerParameter() + let ret = bjs_TypeScriptProcessor_convert(selfValue, tsValue) if let error = _swift_js_take_exception() { throw error } @@ -93,7 +97,9 @@ struct TypeScriptProcessor: _JSBridgedClass { } func validate(_ ts: String) throws(JSException) -> Bool { - let ret = bjs_TypeScriptProcessor_validate(self.bridgeJSLowerParameter(), ts.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let tsValue = ts.bridgeJSLowerParameter() + let ret = bjs_TypeScriptProcessor_validate(selfValue, tsValue) if let error = _swift_js_take_exception() { throw error } @@ -129,7 +135,8 @@ struct CodeGenerator: _JSBridgedClass { var outputFormat: String { get throws(JSException) { - let ret = bjs_CodeGenerator_outputFormat_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_CodeGenerator_outputFormat_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -138,7 +145,9 @@ struct CodeGenerator: _JSBridgedClass { } func generate(_ input: JSObject) throws(JSException) -> String { - let ret = bjs_CodeGenerator_generate(self.bridgeJSLowerParameter(), input.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let inputValue = input.bridgeJSLowerParameter() + let ret = bjs_CodeGenerator_generate(selfValue, inputValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeAlias.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeAlias.swift index e539e65d..afd99723 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeAlias.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeAlias.swift @@ -16,7 +16,8 @@ fileprivate func bjs_checkSimple(_ a: Float64) -> Void { #endif func checkSimple(_ a: Double) throws(JSException) -> Void { - bjs_checkSimple(a.bridgeJSLowerParameter()) + let aValue = a.bridgeJSLowerParameter() + bjs_checkSimple(aValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeScriptClass.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeScriptClass.swift index 148419de..6d1bdca3 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeScriptClass.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeScriptClass.swift @@ -68,7 +68,8 @@ struct Greeter: _JSBridgedClass { } init(_ name: String) throws(JSException) { - let ret = bjs_Greeter_init(name.bridgeJSLowerParameter()) + let nameValue = name.bridgeJSLowerParameter() + let ret = bjs_Greeter_init(nameValue) if let error = _swift_js_take_exception() { throw error } @@ -77,7 +78,8 @@ struct Greeter: _JSBridgedClass { var name: String { get throws(JSException) { - let ret = bjs_Greeter_name_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_Greeter_name_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -86,7 +88,9 @@ struct Greeter: _JSBridgedClass { } func setName(_ newValue: String) throws(JSException) -> Void { - bjs_Greeter_name_set(self.bridgeJSLowerParameter(), newValue.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_Greeter_name_set(selfValue, newValueValue) if let error = _swift_js_take_exception() { throw error } @@ -94,7 +98,8 @@ struct Greeter: _JSBridgedClass { var age: Double { get throws(JSException) { - let ret = bjs_Greeter_age_get(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_Greeter_age_get(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -103,7 +108,8 @@ struct Greeter: _JSBridgedClass { } func greet() throws(JSException) -> String { - let ret = bjs_Greeter_greet(self.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let ret = bjs_Greeter_greet(selfValue) if let error = _swift_js_take_exception() { throw error } @@ -111,7 +117,9 @@ struct Greeter: _JSBridgedClass { } func changeName(_ name: String) throws(JSException) -> Void { - bjs_Greeter_changeName(self.bridgeJSLowerParameter(), name.bridgeJSLowerParameter()) + let selfValue = self.bridgeJSLowerParameter() + let nameValue = name.bridgeJSLowerParameter() + bjs_Greeter_changeName(selfValue, nameValue) if let error = _swift_js_take_exception() { throw error } diff --git a/Sources/JavaScriptKit/BridgeJSIntrinsics.swift b/Sources/JavaScriptKit/BridgeJSIntrinsics.swift index b3262cb9..92ab52f0 100644 --- a/Sources/JavaScriptKit/BridgeJSIntrinsics.swift +++ b/Sources/JavaScriptKit/BridgeJSIntrinsics.swift @@ -78,7 +78,6 @@ import _CJavaScriptKit // - `func bridgeJSLowerReturn() -> <#WasmCoreType#>`: lower the given higher-level return value to a Wasm core type // // Optional types (ExportSwift only) additionally define: -// - `func bridgeJSLowerParameterWithPresence()`: lower optional as (isSome, value) tuple for protocol setters/parameters (borrows object) // - `func bridgeJSLowerParameterWithRetain()`: lower optional heap object with ownership transfer for escaping closures // - `func bridgeJSLiftReturnFromSideChannel()`: lift optional from side-channel storage for protocol property getters // @@ -653,7 +652,7 @@ extension Optional where Wrapped == Bool { // MARK: ExportSwift - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, value: Int32 ) { switch consume self { @@ -703,7 +702,7 @@ extension Optional where Wrapped == Int { // MARK: ExportSwift - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, value: Int32 ) { switch consume self { @@ -743,7 +742,7 @@ extension Optional where Wrapped == Int { extension Optional where Wrapped == String { // MARK: ExportSwift - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, value: Int32 ) { switch consume self { @@ -786,7 +785,7 @@ extension Optional where Wrapped == String { extension Optional where Wrapped == JSObject { // MARK: ExportSwift - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, value: Int32 ) { switch consume self { @@ -840,18 +839,7 @@ extension Optional where Wrapped: _BridgedSwiftProtocolWrapper { /// Optional support for Swift heap objects extension Optional where Wrapped: _BridgedSwiftHeapObject { - // MARK: ImportTS - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> UnsafeMutableRawPointer { - switch consume self { - case .none: - // Return null pointer for nil - return UnsafeMutableRawPointer(bitPattern: 0).unsafelyUnwrapped - case .some(let value): - // Pass unretained pointer since JS will manage the lifetime - return Unmanaged.passUnretained(value).toOpaque() - } - } - + // MARK: ExportSwift /// Lowers optional Swift heap object as (isSome, pointer) tuple for protocol parameters. /// /// This method uses `passUnretained()` because the caller (JavaScript protocol implementation) @@ -859,7 +847,7 @@ extension Optional where Wrapped: _BridgedSwiftHeapObject { /// duration of the call. /// /// - Returns: A tuple containing presence flag (0 for nil, 1 for some) and unretained pointer - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, pointer: UnsafeMutableRawPointer ) { switch consume self { @@ -931,13 +919,19 @@ extension Optional where Wrapped: _BridgedSwiftHeapObject { } } extension Optional where Wrapped == Float { - // MARK: ImportTS - - @available(*, unavailable, message: "Optional Float type is not supported to be passed to imported JS functions") - @_spi(BridgeJS) public consuming func bridgeJSLowerParameter() -> Void {} - // MARK: ExportSwift + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( + isSome: Int32, value: Float32 + ) { + switch consume self { + case .none: + return (isSome: 0, value: 0.0) + case .some(let wrapped): + return (isSome: 1, value: wrapped.bridgeJSLowerParameter()) + } + } + @_spi(BridgeJS) public static func bridgeJSLiftParameter(_ isSome: Int32, _ wrappedValue: Float32) -> Float? { if isSome == 0 { return nil @@ -967,13 +961,19 @@ extension Optional where Wrapped == Float { /// Optional support for Double extension Optional where Wrapped == Double { - // MARK: ImportTS - - @available(*, unavailable, message: "Optional Double type is not supported to be passed to imported JS functions") - @_spi(BridgeJS) public consuming func bridgeJSLowerParameter() -> Void {} - // MARK: ExportSwift + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( + isSome: Int32, value: Float64 + ) { + switch consume self { + case .none: + return (isSome: 0, value: 0.0) + case .some(let wrapped): + return (isSome: 1, value: wrapped.bridgeJSLowerParameter()) + } + } + @_spi(BridgeJS) public static func bridgeJSLiftParameter(_ isSome: Int32, _ wrappedValue: Float64) -> Double? { if isSome == 0 { return nil @@ -1005,7 +1005,7 @@ extension Optional where Wrapped == Double { extension Optional where Wrapped: _BridgedSwiftCaseEnum { // MARK: ExportSwift - @_spi(BridgeJS) public consuming func bridgeJSLowerParameterWithPresence() -> (isSome: Int32, value: Int32) { + @_spi(BridgeJS) public consuming func bridgeJSLowerParameter() -> (isSome: Int32, value: Int32) { switch consume self { case .none: return (isSome: 0, value: 0) @@ -1061,7 +1061,7 @@ extension Optional where Wrapped: _BridgedSwiftTypeLoweredIntoVoidType { extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepresentable, Wrapped.RawValue == String { // MARK: ExportSwift - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, value: Int32 ) { switch consume self { @@ -1099,7 +1099,7 @@ extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepres extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepresentable, Wrapped.RawValue == Int { // MARK: ExportSwift - @_spi(BridgeJS) public consuming func bridgeJSLowerParameterWithPresence() -> (isSome: Int32, value: Int32) { + @_spi(BridgeJS) public consuming func bridgeJSLowerParameter() -> (isSome: Int32, value: Int32) { switch consume self { case .none: return (isSome: 0, value: 0) @@ -1146,7 +1146,7 @@ extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepres extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepresentable, Wrapped.RawValue == Float { // MARK: ExportSwift - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, value: Float32 ) { switch consume self { @@ -1181,7 +1181,7 @@ extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepres extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepresentable, Wrapped.RawValue == Double { // MARK: ExportSwift - @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameterWithPresence() -> ( + @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> ( isSome: Int32, value: Float64 ) { switch consume self { @@ -1218,7 +1218,7 @@ extension Optional where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepres extension Optional where Wrapped: _BridgedSwiftAssociatedValueEnum { // MARK: ExportSwift - @_spi(BridgeJS) public consuming func bridgeJSLowerParameterWithPresence() -> (isSome: Int32, caseId: Int32) { + @_spi(BridgeJS) public consuming func bridgeJSLowerParameter() -> (isSome: Int32, caseId: Int32) { switch consume self { case .none: return (isSome: 0, caseId: 0) diff --git a/Tests/BridgeJSGlobalTests/Generated/BridgeJS.ExportSwift.swift b/Tests/BridgeJSGlobalTests/Generated/BridgeJS.ExportSwift.swift index 8e0c5f18..09cd79ec 100644 --- a/Tests/BridgeJSGlobalTests/Generated/BridgeJS.ExportSwift.swift +++ b/Tests/BridgeJSGlobalTests/Generated/BridgeJS.ExportSwift.swift @@ -103,7 +103,7 @@ public func _bjs_GlobalStaticPropertyNamespace_static_namespaceProperty_get() -> @_expose(wasm, "bjs_GlobalStaticPropertyNamespace_static_namespaceProperty_set") @_cdecl("bjs_GlobalStaticPropertyNamespace_static_namespaceProperty_set") -public func _bjs_GlobalStaticPropertyNamespace_static_namespaceProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_GlobalStaticPropertyNamespace_static_namespaceProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) GlobalStaticPropertyNamespace.namespaceProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -135,7 +135,7 @@ public func _bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedPro @_expose(wasm, "bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedProperty_set") @_cdecl("bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedProperty_set") -public func _bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedProperty_set(value: Int32) -> Void { +public func _bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedProperty_set(_ value: Int32) -> Void { #if arch(wasm32) GlobalStaticPropertyNamespace.NestedProperties.nestedProperty = Int.bridgeJSLiftParameter(value) #else @@ -167,7 +167,7 @@ public func _bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedDou @_expose(wasm, "bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedDouble_set") @_cdecl("bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedDouble_set") -public func _bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedDouble_set(value: Float64) -> Void { +public func _bjs_GlobalStaticPropertyNamespace_NestedProperties_static_nestedDouble_set(_ value: Float64) -> Void { #if arch(wasm32) GlobalStaticPropertyNamespace.NestedProperties.nestedDouble = Double.bridgeJSLiftParameter(value) #else @@ -188,7 +188,7 @@ public func _bjs_TestHTTPServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_TestHTTPServer_call") @_cdecl("bjs_TestHTTPServer_call") -public func _bjs_TestHTTPServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_TestHTTPServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) GlobalNetworking.API.TestHTTPServer.bridgeJSLiftParameter(_self).call(_: GlobalNetworking.API.CallMethod.bridgeJSLiftParameter(method)) #else @@ -198,8 +198,12 @@ public func _bjs_TestHTTPServer_call(_self: UnsafeMutableRawPointer, method: Int @_expose(wasm, "bjs_TestHTTPServer_deinit") @_cdecl("bjs_TestHTTPServer_deinit") -public func _bjs_TestHTTPServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_TestHTTPServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension GlobalNetworking.API.TestHTTPServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -210,9 +214,9 @@ extension GlobalNetworking.API.TestHTTPServer: ConvertibleToJSValue, _BridgedSwi #if arch(wasm32) @_extern(wasm, module: "BridgeJSGlobalTests", name: "bjs_TestHTTPServer_wrap") -fileprivate func _bjs_TestHTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_TestHTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_TestHTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_TestHTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -230,7 +234,7 @@ public func _bjs_TestInternalServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_TestInternalServer_call") @_cdecl("bjs_TestInternalServer_call") -public func _bjs_TestInternalServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_TestInternalServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) Internal.TestInternalServer.bridgeJSLiftParameter(_self).call(_: Internal.SupportedServerMethod.bridgeJSLiftParameter(method)) #else @@ -240,8 +244,12 @@ public func _bjs_TestInternalServer_call(_self: UnsafeMutableRawPointer, method: @_expose(wasm, "bjs_TestInternalServer_deinit") @_cdecl("bjs_TestInternalServer_deinit") -public func _bjs_TestInternalServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_TestInternalServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Internal.TestInternalServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -252,9 +260,9 @@ extension Internal.TestInternalServer: ConvertibleToJSValue, _BridgedSwiftHeapOb #if arch(wasm32) @_extern(wasm, module: "BridgeJSGlobalTests", name: "bjs_TestInternalServer_wrap") -fileprivate func _bjs_TestInternalServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_TestInternalServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_TestInternalServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_TestInternalServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -272,7 +280,7 @@ public func _bjs_PublicConverter_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_PublicConverter_toString") @_cdecl("bjs_PublicConverter_toString") -public func _bjs_PublicConverter_toString(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PublicConverter_toString(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) let ret = GlobalUtils.PublicConverter.bridgeJSLiftParameter(_self).toString(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -283,8 +291,12 @@ public func _bjs_PublicConverter_toString(_self: UnsafeMutableRawPointer, value: @_expose(wasm, "bjs_PublicConverter_deinit") @_cdecl("bjs_PublicConverter_deinit") -public func _bjs_PublicConverter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PublicConverter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension GlobalUtils.PublicConverter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -295,9 +307,9 @@ extension GlobalUtils.PublicConverter: ConvertibleToJSValue, _BridgedSwiftHeapOb #if arch(wasm32) @_extern(wasm, module: "BridgeJSGlobalTests", name: "bjs_PublicConverter_wrap") -fileprivate func _bjs_PublicConverter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PublicConverter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PublicConverter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PublicConverter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file diff --git a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.ExportSwift.swift b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.ExportSwift.swift index addeedb1..0a95e88f 100644 --- a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.ExportSwift.swift +++ b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.ExportSwift.swift @@ -6,8 +6,14 @@ @_spi(BridgeJS) import JavaScriptKit +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTests10HttpStatusO_Si: _BridgedSwiftClosureBox { let closure: (HttpStatus) -> Int @@ -21,23 +27,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTests10HttpStatusO_Si { let box = _BJS_ClosureBox_20BridgeJSRuntimeTests10HttpStatusO_Si(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (HttpStatus) -> Int { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Int.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si(callbackValue, param0Value) + return Int.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Int32 { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10HttpStatusO_Si(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Int32 { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTests10HttpStatusO_Si>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(HttpStatus.bridgeJSLiftParameter(param0)) @@ -47,8 +54,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests10H #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTests5ThemeO_SS: _BridgedSwiftClosureBox { let closure: (Theme) -> String @@ -62,23 +75,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTests5ThemeO_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTests5ThemeO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Theme) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS(callbackValue, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS(boxPtr: UnsafeMutableRawPointer, param0Bytes: Int32, param0Length: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0Bytes: Int32, _ param0Length: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTests5ThemeO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Theme.bridgeJSLiftParameter(param0Bytes, param0Length)) @@ -88,8 +102,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5Th #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTests5ThemeO_Sb: _BridgedSwiftClosureBox { let closure: (Theme) -> Bool @@ -103,23 +123,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTests5ThemeO_Sb { let box = _BJS_ClosureBox_20BridgeJSRuntimeTests5ThemeO_Sb(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Theme) -> Bool { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Bool.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb(callbackValue, param0Value) + return Bool.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb(boxPtr: UnsafeMutableRawPointer, param0Bytes: Int32, param0Length: Int32) -> Int32 { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5ThemeO_Sb(_ boxPtr: UnsafeMutableRawPointer, _ param0Bytes: Int32, _ param0Length: Int32) -> Int32 { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTests5ThemeO_Sb>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Theme.bridgeJSLiftParameter(param0Bytes, param0Length)) @@ -129,8 +150,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests5Th #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS(_: Int32, _: UnsafeMutableRawPointer) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS(_ callback: Int32, _ param0: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTests7GreeterC_SS: _BridgedSwiftClosureBox { let closure: (Greeter) -> String @@ -144,23 +171,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTests7GreeterC_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTests7GreeterC_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Greeter) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Pointer = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS(callbackValue, param0Pointer) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS(boxPtr: UnsafeMutableRawPointer, param0: UnsafeMutableRawPointer) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7GreeterC_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTests7GreeterC_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Greeter.bridgeJSLiftParameter(param0)) @@ -170,8 +198,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests7Gr #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTests9APIResultO_SS: _BridgedSwiftClosureBox { let closure: (APIResult) -> String @@ -185,23 +219,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTests9APIResultO_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTests9APIResultO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (APIResult) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0CaseId = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS(callbackValue, param0CaseId) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9APIResultO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTests9APIResultO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(APIResult.bridgeJSLiftParameter(param0)) @@ -211,8 +246,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9AP #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTests9DirectionO_SS: _BridgedSwiftClosureBox { let closure: (Direction) -> String @@ -226,23 +267,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTests9DirectionO_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTests9DirectionO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Direction) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS(callbackValue, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTests9DirectionO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Direction.bridgeJSLiftParameter(param0)) @@ -252,8 +294,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9Di #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTests9DirectionO_Sb: _BridgedSwiftClosureBox { let closure: (Direction) -> Bool @@ -267,23 +315,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTests9DirectionO_Sb { let box = _BJS_ClosureBox_20BridgeJSRuntimeTests9DirectionO_Sb(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Direction) -> Bool { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Bool.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb(callbackValue, param0Value) + return Bool.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Int32 { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9DirectionO_Sb(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Int32 { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTests9DirectionO_Sb>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Direction.bridgeJSLiftParameter(param0)) @@ -293,8 +342,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTests9Di #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC(_: Int32, _: Int32) -> UnsafeMutableRawPointer +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC(_ callback: Int32, _ param0: Int32) -> UnsafeMutableRawPointer +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC(_ callback: Int32, _ param0: Int32) -> UnsafeMutableRawPointer { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSS_7GreeterC: _BridgedSwiftClosureBox { let closure: (String) -> Greeter @@ -308,23 +363,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSS_7GreeterC { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSS_7GreeterC(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (String) -> Greeter { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Greeter.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC(callbackValue, param0Value) + return Greeter.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC(boxPtr: UnsafeMutableRawPointer, param0Bytes: Int32, param0Length: Int32) -> UnsafeMutableRawPointer { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_7GreeterC(_ boxPtr: UnsafeMutableRawPointer, _ param0Bytes: Int32, _ param0Length: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSS_7GreeterC>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(String.bridgeJSLiftParameter(param0Bytes, param0Length)) @@ -334,8 +390,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_ #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSS_SS: _BridgedSwiftClosureBox { let closure: (String) -> String @@ -349,23 +411,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSS_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSS_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (String) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS(callbackValue, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS(boxPtr: UnsafeMutableRawPointer, param0Bytes: Int32, param0Length: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0Bytes: Int32, _ param0Length: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSS_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(String.bridgeJSLiftParameter(param0Bytes, param0Length)) @@ -375,8 +438,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSS_ #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS(_: Int32, _: Int32, _: Int32, _: Float64) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS(_ callback: Int32, _ param0: Int32, _ param1: Int32, _ param2: Float64) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS(_ callback: Int32, _ param0: Int32, _ param1: Int32, _ param2: Float64) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSiSSSd_SS: _BridgedSwiftClosureBox { let closure: (Int, String, Double) -> String @@ -390,23 +459,26 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSiSSSd_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSiSSSd_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Int, String, Double) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0, param1, param2 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter(), param1.bridgeJSLowerParameter(), param2.bridgeJSLowerParameter()) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0, param1, param2 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let param1Value = param1.bridgeJSLowerParameter() + let param2Value = param2.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS(callbackValue, param0Value, param1Value, param2Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS(boxPtr: UnsafeMutableRawPointer, param0: Int32, param1Bytes: Int32, param1Length: Int32, param2: Float64) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiSSSd_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32, _ param1Bytes: Int32, _ param1Length: Int32, _ param2: Float64) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSiSSSd_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Int.bridgeJSLiftParameter(param0), String.bridgeJSLiftParameter(param1Bytes, param1Length), Double.bridgeJSLiftParameter(param2)) @@ -416,8 +488,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSiS #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si(_: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si(_ callback: Int32, _ param0: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si(_ callback: Int32, _ param0: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSi_Si: _BridgedSwiftClosureBox { let closure: (Int) -> Int @@ -431,23 +509,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSi_Si { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSi_Si(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Int) -> Int { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si(callback.bridgeJSLowerParameter(), param0.bridgeJSLowerParameter()) - return Int.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let param0Value = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si(callbackValue, param0Value) + return Int.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si(boxPtr: UnsafeMutableRawPointer, param0: Int32) -> Int32 { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_Si(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Int32 { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSi_Si>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Int.bridgeJSLiftParameter(param0)) @@ -457,8 +536,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSi_ #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSq5ThemeO_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -472,24 +557,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSq5ThemeO_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSq5ThemeO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Value) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS(callbackValue, param0IsSome, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Bytes: Int32, param0Length: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5ThemeO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Bytes: Int32, _ param0Length: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSq5ThemeO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Bytes, param0Length)) @@ -499,8 +584,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq5 #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS(_: Int32, _: Int32, _: UnsafeMutableRawPointer) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Pointer: UnsafeMutableRawPointer) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Pointer: UnsafeMutableRawPointer) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSq7GreeterC_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -514,24 +605,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSq7GreeterC_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSq7GreeterC_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithRetain() -let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Pointer) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS(callbackValue, param0IsSome, param0Pointer) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Value: UnsafeMutableRawPointer) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7GreeterC_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSq7GreeterC_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Value)) @@ -541,8 +632,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq7 #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0CaseId: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0CaseId: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSq9APIResultO_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -556,24 +653,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSq9APIResultO_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSq9APIResultO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0CaseId) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS(callbackValue, param0IsSome, param0CaseId) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0CaseId: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9APIResultO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0CaseId: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSq9APIResultO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0CaseId)) @@ -583,8 +680,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9 #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSq9DirectionO_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -598,24 +701,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSq9DirectionO_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSq9DirectionO_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Value) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS(callbackValue, param0IsSome, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Value: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9DirectionO_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Value: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSq9DirectionO_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Value)) @@ -625,8 +728,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSq9 #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSqSS_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -640,24 +749,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSqSS_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSqSS_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Value) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS(callbackValue, param0IsSome, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Bytes: Int32, param0Length: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSS_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Bytes: Int32, _ param0Length: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSqSS_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Bytes, param0Length)) @@ -667,8 +776,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqS #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS(_: Int32, _: Int32, _: Int32) -> Int32 +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS(_ callback: Int32, _ param0IsSome: Int32, _ param0Value: Int32) -> Int32 { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsSqSi_SS: _BridgedSwiftClosureBox { let closure: (Optional) -> String @@ -682,24 +797,24 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsSqSi_SS { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsSqSi_SS(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> (Optional) -> String { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] param0 in - #if arch(wasm32) - let (param0IsSome, param0Value) = param0.bridgeJSLowerParameterWithPresence() -let resultId = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS(callback.bridgeJSLowerParameter(), param0IsSome, param0Value) - return String.bridgeJSLiftReturn(resultId) - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] param0 in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let (param0IsSome, param0Value) = param0.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS(callbackValue, param0IsSome, param0Value) + return String.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS(boxPtr: UnsafeMutableRawPointer, param0IsSome: Int32, param0Value: Int32) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqSi_SS(_ boxPtr: UnsafeMutableRawPointer, _ param0IsSome: Int32, _ param0Value: Int32) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsSqSi_SS>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure(Optional.bridgeJSLiftParameter(param0IsSome, param0Value)) @@ -709,8 +824,14 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsSqS #endif } +#if arch(wasm32) @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC") -fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC(_: Int32) -> Void +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC(_ callback: Int32) -> UnsafeMutableRawPointer +#else +fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC(_ callback: Int32) -> UnsafeMutableRawPointer { + fatalError("Only available on WebAssembly") +} +#endif private final class _BJS_ClosureBox_20BridgeJSRuntimeTestsy_Sq7GreeterC: _BridgedSwiftClosureBox { let closure: () -> Optional @@ -724,23 +845,23 @@ private enum _BJS_Closure_20BridgeJSRuntimeTestsy_Sq7GreeterC { let box = _BJS_ClosureBox_20BridgeJSRuntimeTestsy_Sq7GreeterC(closure) return Unmanaged.passRetained(box).toOpaque() } - static func bridgeJSLift(_ callbackId: Int32) -> () -> Optional { - let callback = JSObject.bridgeJSLiftParameter(callbackId) - return { [callback] in - #if arch(wasm32) - invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC(callback.bridgeJSLowerParameter()) - return Optional.bridgeJSLiftReturnFromSideChannel() - #else - fatalError("Only available on WebAssembly") - #endif - } + let callback = JSObject.bridgeJSLiftParameter(callbackId) + return { [callback] in + #if arch(wasm32) + let callbackValue = callback.bridgeJSLowerParameter() + let ret = invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC(callbackValue) + return Optional.bridgeJSLiftReturn(ret) + #else + fatalError("Only available on WebAssembly") + #endif } + } } @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC") @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC") -public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC(boxPtr: UnsafeMutableRawPointer) -> Void { +public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_Sq7GreeterC(_ boxPtr: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let box = Unmanaged<_BJS_ClosureBox_20BridgeJSRuntimeTestsy_Sq7GreeterC>.fromOpaque(boxPtr).takeUnretainedValue() let result = box.closure() @@ -753,161 +874,197 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestsy_S struct AnyDataProcessor: DataProcessor, _BridgedSwiftProtocolWrapper { let jsObject: JSObject - func increment(by amount: Int) { - _extern_increment(this: Int32(bitPattern: jsObject.id), amount: amount.bridgeJSLowerParameter()) + func increment(by amount: Int) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let amountValue = amount.bridgeJSLowerParameter() + _extern_increment(jsObjectValue, amountValue) } func getValue() -> Int { - let ret = _extern_getValue(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_getValue(jsObjectValue) return Int.bridgeJSLiftReturn(ret) } - func setLabelElements(_ labelPrefix: String, _ labelSuffix: String) { - _extern_setLabelElements(this: Int32(bitPattern: jsObject.id), labelPrefix: labelPrefix.bridgeJSLowerParameter(), labelSuffix: labelSuffix.bridgeJSLowerParameter()) + func setLabelElements(_ labelPrefix: String, _ labelSuffix: String) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let labelPrefixValue = labelPrefix.bridgeJSLowerParameter() + let labelSuffixValue = labelSuffix.bridgeJSLowerParameter() + _extern_setLabelElements(jsObjectValue, labelPrefixValue, labelSuffixValue) } func getLabel() -> String { - let ret = _extern_getLabel(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_getLabel(jsObjectValue) return String.bridgeJSLiftReturn(ret) } func isEven() -> Bool { - let ret = _extern_isEven(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_isEven(jsObjectValue) return Bool.bridgeJSLiftReturn(ret) } func processGreeter(_ greeter: Greeter) -> String { - let ret = _extern_processGreeter(this: Int32(bitPattern: jsObject.id), greeter: greeter.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let greeterPointer = greeter.bridgeJSLowerParameter() + let ret = _extern_processGreeter(jsObjectValue, greeterPointer) return String.bridgeJSLiftReturn(ret) } func createGreeter() -> Greeter { - let ret = _extern_createGreeter(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_createGreeter(jsObjectValue) return Greeter.bridgeJSLiftReturn(ret) } func processOptionalGreeter(_ greeter: Optional) -> String { - let (greeterIsSome, greeterPointer) = greeter.bridgeJSLowerParameterWithPresence() - let ret = _extern_processOptionalGreeter(this: Int32(bitPattern: jsObject.id), greeterIsSome: greeterIsSome, greeterPointer: greeterPointer) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (greeterIsSome, greeterPointer) = greeter.bridgeJSLowerParameter() + let ret = _extern_processOptionalGreeter(jsObjectValue, greeterIsSome, greeterPointer) return String.bridgeJSLiftReturn(ret) } func createOptionalGreeter() -> Optional { - let ret = _extern_createOptionalGreeter(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_createOptionalGreeter(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } - func handleAPIResult(_ result: Optional) { - let (resultIsSome, resultCaseId) = result.bridgeJSLowerParameterWithPresence() - _extern_handleAPIResult(this: Int32(bitPattern: jsObject.id), resultIsSome: resultIsSome, resultCaseId: resultCaseId) + func handleAPIResult(_ result: Optional) -> Void { + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (resultIsSome, resultCaseId) = result.bridgeJSLowerParameter() + _extern_handleAPIResult(jsObjectValue, resultIsSome, resultCaseId) } func getAPIResult() -> Optional { - let ret = _extern_getAPIResult(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = _extern_getAPIResult(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } var count: Int { get { - let ret = bjs_DataProcessor_count_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_DataProcessor_count_get(jsObjectValue) return Int.bridgeJSLiftReturn(ret) } set { - bjs_DataProcessor_count_set(this: Int32(bitPattern: jsObject.id), value: newValue.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let newValueValue = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_count_set(jsObjectValue, newValueValue) } } var name: String { get { - let ret = bjs_DataProcessor_name_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_DataProcessor_name_get(jsObjectValue) return String.bridgeJSLiftReturn(ret) } } var optionalTag: Optional { get { - bjs_DataProcessor_optionalTag_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_DataProcessor_optionalTag_get(jsObjectValue) return Optional.bridgeJSLiftReturnFromSideChannel() } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_DataProcessor_optionalTag_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_optionalTag_set(jsObjectValue, newValueIsSome, newValueValue) } } var optionalCount: Optional { get { - bjs_DataProcessor_optionalCount_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_DataProcessor_optionalCount_get(jsObjectValue) return Optional.bridgeJSLiftReturnFromSideChannel() } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_DataProcessor_optionalCount_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_optionalCount_set(jsObjectValue, newValueIsSome, newValueValue) } } var direction: Optional { get { - let ret = bjs_DataProcessor_direction_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_DataProcessor_direction_get(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_DataProcessor_direction_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_direction_set(jsObjectValue, newValueIsSome, newValueValue) } } var optionalTheme: Optional { get { - bjs_DataProcessor_optionalTheme_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_DataProcessor_optionalTheme_get(jsObjectValue) return Optional.bridgeJSLiftReturnFromSideChannel() } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_DataProcessor_optionalTheme_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_optionalTheme_set(jsObjectValue, newValueIsSome, newValueValue) } } var httpStatus: Optional { get { - bjs_DataProcessor_httpStatus_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + bjs_DataProcessor_httpStatus_get(jsObjectValue) return Optional.bridgeJSLiftReturnFromSideChannel() } set { - let (isSome, value) = newValue.bridgeJSLowerParameterWithPresence() - bjs_DataProcessor_httpStatus_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, value: value) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueValue) = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_httpStatus_set(jsObjectValue, newValueIsSome, newValueValue) } } var apiResult: Optional { get { - let ret = bjs_DataProcessor_apiResult_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_DataProcessor_apiResult_get(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } set { - let (isSome, caseId) = newValue.bridgeJSLowerParameterWithPresence() - bjs_DataProcessor_apiResult_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, caseId: caseId) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValueCaseId) = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_apiResult_set(jsObjectValue, newValueIsSome, newValueCaseId) } } var helper: Greeter { get { - let ret = bjs_DataProcessor_helper_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_DataProcessor_helper_get(jsObjectValue) return Greeter.bridgeJSLiftReturn(ret) } set { - bjs_DataProcessor_helper_set(this: Int32(bitPattern: jsObject.id), pointer: newValue.bridgeJSLowerParameter()) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let newValuePointer = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_helper_set(jsObjectValue, newValuePointer) } } var optionalHelper: Optional { get { - let ret = bjs_DataProcessor_optionalHelper_get(this: Int32(bitPattern: jsObject.id)) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let ret = bjs_DataProcessor_optionalHelper_get(jsObjectValue) return Optional.bridgeJSLiftReturn(ret) } set { - let (isSome, pointer) = newValue.bridgeJSLowerParameterWithPresence() - bjs_DataProcessor_optionalHelper_set(this: Int32(bitPattern: jsObject.id), isSome: isSome, pointer: pointer) + let jsObjectValue = jsObject.bridgeJSLowerParameter() + let (newValueIsSome, newValuePointer) = newValue.bridgeJSLowerParameter() + bjs_DataProcessor_optionalHelper_set(jsObjectValue, newValueIsSome, newValuePointer) } } @@ -917,94 +1074,94 @@ struct AnyDataProcessor: DataProcessor, _BridgedSwiftProtocolWrapper { } @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_increment") -fileprivate func _extern_increment(this: Int32, amount: Int32) +fileprivate func _extern_increment(_ jsObject: Int32, _ amount: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_getValue") -fileprivate func _extern_getValue(this: Int32) -> Int32 +fileprivate func _extern_getValue(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_setLabelElements") -fileprivate func _extern_setLabelElements(this: Int32, labelPrefix: Int32, labelSuffix: Int32) +fileprivate func _extern_setLabelElements(_ jsObject: Int32, _ labelPrefix: Int32, _ labelSuffix: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_getLabel") -fileprivate func _extern_getLabel(this: Int32) -> Int32 +fileprivate func _extern_getLabel(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_isEven") -fileprivate func _extern_isEven(this: Int32) -> Int32 +fileprivate func _extern_isEven(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_processGreeter") -fileprivate func _extern_processGreeter(this: Int32, greeter: UnsafeMutableRawPointer) -> Int32 +fileprivate func _extern_processGreeter(_ jsObject: Int32, _ greeter: UnsafeMutableRawPointer) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_createGreeter") -fileprivate func _extern_createGreeter(this: Int32) -> UnsafeMutableRawPointer +fileprivate func _extern_createGreeter(_ jsObject: Int32) -> UnsafeMutableRawPointer @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_processOptionalGreeter") -fileprivate func _extern_processOptionalGreeter(this: Int32, greeterIsSome: Int32, greeterPointer: UnsafeMutableRawPointer) -> Int32 +fileprivate func _extern_processOptionalGreeter(_ jsObject: Int32, _ greeterIsSome: Int32, _ greeterPointer: UnsafeMutableRawPointer) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_createOptionalGreeter") -fileprivate func _extern_createOptionalGreeter(this: Int32) -> UnsafeMutableRawPointer +fileprivate func _extern_createOptionalGreeter(_ jsObject: Int32) -> UnsafeMutableRawPointer @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_handleAPIResult") -fileprivate func _extern_handleAPIResult(this: Int32, resultIsSome: Int32, resultCaseId: Int32) +fileprivate func _extern_handleAPIResult(_ jsObject: Int32, _ resultIsSome: Int32, _ resultCaseId: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_getAPIResult") -fileprivate func _extern_getAPIResult(this: Int32) -> Int32 +fileprivate func _extern_getAPIResult(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_count_get") -fileprivate func bjs_DataProcessor_count_get(this: Int32) -> Int32 +fileprivate func bjs_DataProcessor_count_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_count_set") -fileprivate func bjs_DataProcessor_count_set(this: Int32, value: Int32) +fileprivate func bjs_DataProcessor_count_set(_ jsObject: Int32, _ newValue: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_name_get") -fileprivate func bjs_DataProcessor_name_get(this: Int32) -> Int32 +fileprivate func bjs_DataProcessor_name_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalTag_get") -fileprivate func bjs_DataProcessor_optionalTag_get(this: Int32) +fileprivate func bjs_DataProcessor_optionalTag_get(_ jsObject: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalTag_set") -fileprivate func bjs_DataProcessor_optionalTag_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_DataProcessor_optionalTag_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalCount_get") -fileprivate func bjs_DataProcessor_optionalCount_get(this: Int32) +fileprivate func bjs_DataProcessor_optionalCount_get(_ jsObject: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalCount_set") -fileprivate func bjs_DataProcessor_optionalCount_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_DataProcessor_optionalCount_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_direction_get") -fileprivate func bjs_DataProcessor_direction_get(this: Int32) -> Int32 +fileprivate func bjs_DataProcessor_direction_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_direction_set") -fileprivate func bjs_DataProcessor_direction_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_DataProcessor_direction_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalTheme_get") -fileprivate func bjs_DataProcessor_optionalTheme_get(this: Int32) +fileprivate func bjs_DataProcessor_optionalTheme_get(_ jsObject: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalTheme_set") -fileprivate func bjs_DataProcessor_optionalTheme_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_DataProcessor_optionalTheme_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_httpStatus_get") -fileprivate func bjs_DataProcessor_httpStatus_get(this: Int32) +fileprivate func bjs_DataProcessor_httpStatus_get(_ jsObject: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_httpStatus_set") -fileprivate func bjs_DataProcessor_httpStatus_set(this: Int32, isSome: Int32, value: Int32) +fileprivate func bjs_DataProcessor_httpStatus_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueValue: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_apiResult_get") -fileprivate func bjs_DataProcessor_apiResult_get(this: Int32) -> Int32 +fileprivate func bjs_DataProcessor_apiResult_get(_ jsObject: Int32) -> Int32 @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_apiResult_set") -fileprivate func bjs_DataProcessor_apiResult_set(this: Int32, isSome: Int32, caseId: Int32) +fileprivate func bjs_DataProcessor_apiResult_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValueCaseId: Int32) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_helper_get") -fileprivate func bjs_DataProcessor_helper_get(this: Int32) -> UnsafeMutableRawPointer +fileprivate func bjs_DataProcessor_helper_get(_ jsObject: Int32) -> UnsafeMutableRawPointer @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_helper_set") -fileprivate func bjs_DataProcessor_helper_set(this: Int32, pointer: UnsafeMutableRawPointer) +fileprivate func bjs_DataProcessor_helper_set(_ jsObject: Int32, _ newValue: UnsafeMutableRawPointer) -> Void @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalHelper_get") -fileprivate func bjs_DataProcessor_optionalHelper_get(this: Int32) -> UnsafeMutableRawPointer +fileprivate func bjs_DataProcessor_optionalHelper_get(_ jsObject: Int32) -> UnsafeMutableRawPointer @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessor_optionalHelper_set") -fileprivate func bjs_DataProcessor_optionalHelper_set(this: Int32, isSome: Int32, pointer: UnsafeMutableRawPointer) +fileprivate func bjs_DataProcessor_optionalHelper_set(_ jsObject: Int32, _ newValueIsSome: Int32, _ newValuePointer: UnsafeMutableRawPointer) -> Void extension Direction: _BridgedSwiftCaseEnum { @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 { @@ -1762,7 +1919,7 @@ extension StaticCalculator: _BridgedSwiftCaseEnum { @_expose(wasm, "bjs_StaticCalculator_static_roundtrip") @_cdecl("bjs_StaticCalculator_static_roundtrip") -public func _bjs_StaticCalculator_static_roundtrip(value: Int32) -> Int32 { +public func _bjs_StaticCalculator_static_roundtrip(_ value: Int32) -> Int32 { #if arch(wasm32) let ret = StaticCalculator.roundtrip(_: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -1773,7 +1930,7 @@ public func _bjs_StaticCalculator_static_roundtrip(value: Int32) -> Int32 { @_expose(wasm, "bjs_StaticUtils_Nested_static_roundtrip") @_cdecl("bjs_StaticUtils_Nested_static_roundtrip") -public func _bjs_StaticUtils_Nested_static_roundtrip(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StaticUtils_Nested_static_roundtrip(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) let ret = StaticUtils.Nested.roundtrip(_: String.bridgeJSLiftParameter(valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -1830,7 +1987,7 @@ public func _bjs_StaticPropertyEnum_static_enumProperty_get() -> Void { @_expose(wasm, "bjs_StaticPropertyEnum_static_enumProperty_set") @_cdecl("bjs_StaticPropertyEnum_static_enumProperty_set") -public func _bjs_StaticPropertyEnum_static_enumProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StaticPropertyEnum_static_enumProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) StaticPropertyEnum.enumProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -1862,7 +2019,7 @@ public func _bjs_StaticPropertyEnum_static_enumBool_get() -> Int32 { @_expose(wasm, "bjs_StaticPropertyEnum_static_enumBool_set") @_cdecl("bjs_StaticPropertyEnum_static_enumBool_set") -public func _bjs_StaticPropertyEnum_static_enumBool_set(value: Int32) -> Void { +public func _bjs_StaticPropertyEnum_static_enumBool_set(_ value: Int32) -> Void { #if arch(wasm32) StaticPropertyEnum.enumBool = Bool.bridgeJSLiftParameter(value) #else @@ -1883,7 +2040,7 @@ public func _bjs_StaticPropertyEnum_static_enumVariable_get() -> Int32 { @_expose(wasm, "bjs_StaticPropertyEnum_static_enumVariable_set") @_cdecl("bjs_StaticPropertyEnum_static_enumVariable_set") -public func _bjs_StaticPropertyEnum_static_enumVariable_set(value: Int32) -> Void { +public func _bjs_StaticPropertyEnum_static_enumVariable_set(_ value: Int32) -> Void { #if arch(wasm32) StaticPropertyEnum.enumVariable = Int.bridgeJSLiftParameter(value) #else @@ -1915,7 +2072,7 @@ public func _bjs_StaticPropertyEnum_static_computedReadWrite_get() -> Void { @_expose(wasm, "bjs_StaticPropertyEnum_static_computedReadWrite_set") @_cdecl("bjs_StaticPropertyEnum_static_computedReadWrite_set") -public func _bjs_StaticPropertyEnum_static_computedReadWrite_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StaticPropertyEnum_static_computedReadWrite_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) StaticPropertyEnum.computedReadWrite = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -1936,7 +2093,7 @@ public func _bjs_StaticPropertyNamespace_static_namespaceProperty_get() -> Void @_expose(wasm, "bjs_StaticPropertyNamespace_static_namespaceProperty_set") @_cdecl("bjs_StaticPropertyNamespace_static_namespaceProperty_set") -public func _bjs_StaticPropertyNamespace_static_namespaceProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StaticPropertyNamespace_static_namespaceProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) StaticPropertyNamespace.namespaceProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -1968,7 +2125,7 @@ public func _bjs_StaticPropertyNamespace_NestedProperties_static_nestedProperty_ @_expose(wasm, "bjs_StaticPropertyNamespace_NestedProperties_static_nestedProperty_set") @_cdecl("bjs_StaticPropertyNamespace_NestedProperties_static_nestedProperty_set") -public func _bjs_StaticPropertyNamespace_NestedProperties_static_nestedProperty_set(value: Int32) -> Void { +public func _bjs_StaticPropertyNamespace_NestedProperties_static_nestedProperty_set(_ value: Int32) -> Void { #if arch(wasm32) StaticPropertyNamespace.NestedProperties.nestedProperty = Int.bridgeJSLiftParameter(value) #else @@ -2000,7 +2157,7 @@ public func _bjs_StaticPropertyNamespace_NestedProperties_static_nestedDouble_ge @_expose(wasm, "bjs_StaticPropertyNamespace_NestedProperties_static_nestedDouble_set") @_cdecl("bjs_StaticPropertyNamespace_NestedProperties_static_nestedDouble_set") -public func _bjs_StaticPropertyNamespace_NestedProperties_static_nestedDouble_set(value: Float64) -> Void { +public func _bjs_StaticPropertyNamespace_NestedProperties_static_nestedDouble_set(_ value: Float64) -> Void { #if arch(wasm32) StaticPropertyNamespace.NestedProperties.nestedDouble = Double.bridgeJSLiftParameter(value) #else @@ -2040,7 +2197,7 @@ extension DataPoint: _BridgedSwiftStruct { @_expose(wasm, "bjs_DataPoint_init") @_cdecl("bjs_DataPoint_init") -public func _bjs_DataPoint_init(x: Float64, y: Float64, labelBytes: Int32, labelLength: Int32, optCountIsSome: Int32, optCountValue: Int32, optFlagIsSome: Int32, optFlagValue: Int32) -> Void { +public func _bjs_DataPoint_init(_ x: Float64, _ y: Float64, _ labelBytes: Int32, _ labelLength: Int32, _ optCountIsSome: Int32, _ optCountValue: Int32, _ optFlagIsSome: Int32, _ optFlagValue: Int32) -> Void { #if arch(wasm32) let ret = DataPoint(x: Double.bridgeJSLiftParameter(x), y: Double.bridgeJSLiftParameter(y), label: String.bridgeJSLiftParameter(labelBytes, labelLength), optCount: Optional.bridgeJSLiftParameter(optCountIsSome, optCountValue), optFlag: Optional.bridgeJSLiftParameter(optFlagIsSome, optFlagValue)) return ret.bridgeJSLowerReturn() @@ -2193,7 +2350,7 @@ extension MathOperations: _BridgedSwiftStruct { @_expose(wasm, "bjs_MathOperations_init") @_cdecl("bjs_MathOperations_init") -public func _bjs_MathOperations_init(baseValue: Float64) -> Void { +public func _bjs_MathOperations_init(_ baseValue: Float64) -> Void { #if arch(wasm32) let ret = MathOperations(baseValue: Double.bridgeJSLiftParameter(baseValue)) return ret.bridgeJSLowerReturn() @@ -2204,7 +2361,7 @@ public func _bjs_MathOperations_init(baseValue: Float64) -> Void { @_expose(wasm, "bjs_MathOperations_add") @_cdecl("bjs_MathOperations_add") -public func _bjs_MathOperations_add(a: Float64, b: Float64) -> Float64 { +public func _bjs_MathOperations_add(_ a: Float64, _ b: Float64) -> Float64 { #if arch(wasm32) let ret = MathOperations.bridgeJSLiftParameter().add(a: Double.bridgeJSLiftParameter(a), b: Double.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -2215,7 +2372,7 @@ public func _bjs_MathOperations_add(a: Float64, b: Float64) -> Float64 { @_expose(wasm, "bjs_MathOperations_multiply") @_cdecl("bjs_MathOperations_multiply") -public func _bjs_MathOperations_multiply(a: Float64, b: Float64) -> Float64 { +public func _bjs_MathOperations_multiply(_ a: Float64, _ b: Float64) -> Float64 { #if arch(wasm32) let ret = MathOperations.bridgeJSLiftParameter().multiply(a: Double.bridgeJSLiftParameter(a), b: Double.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -2226,7 +2383,7 @@ public func _bjs_MathOperations_multiply(a: Float64, b: Float64) -> Float64 { @_expose(wasm, "bjs_MathOperations_static_subtract") @_cdecl("bjs_MathOperations_static_subtract") -public func _bjs_MathOperations_static_subtract(a: Float64, b: Float64) -> Float64 { +public func _bjs_MathOperations_static_subtract(_ a: Float64, _ b: Float64) -> Float64 { #if arch(wasm32) let ret = MathOperations.subtract(a: Double.bridgeJSLiftParameter(a), b: Double.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -2264,7 +2421,7 @@ public func _bjs_ConfigStruct_static_defaultConfig_get() -> Void { @_expose(wasm, "bjs_ConfigStruct_static_defaultConfig_set") @_cdecl("bjs_ConfigStruct_static_defaultConfig_set") -public func _bjs_ConfigStruct_static_defaultConfig_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_ConfigStruct_static_defaultConfig_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) ConfigStruct.defaultConfig = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -2296,7 +2453,7 @@ public func _bjs_ConfigStruct_static_timeout_get() -> Float64 { @_expose(wasm, "bjs_ConfigStruct_static_timeout_set") @_cdecl("bjs_ConfigStruct_static_timeout_set") -public func _bjs_ConfigStruct_static_timeout_set(value: Float64) -> Void { +public func _bjs_ConfigStruct_static_timeout_set(_ value: Float64) -> Void { #if arch(wasm32) ConfigStruct.timeout = Double.bridgeJSLiftParameter(value) #else @@ -2327,7 +2484,7 @@ public func _bjs_roundTripVoid() -> Void { @_expose(wasm, "bjs_roundTripInt") @_cdecl("bjs_roundTripInt") -public func _bjs_roundTripInt(v: Int32) -> Int32 { +public func _bjs_roundTripInt(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = roundTripInt(v: Int.bridgeJSLiftParameter(v)) return ret.bridgeJSLowerReturn() @@ -2338,7 +2495,7 @@ public func _bjs_roundTripInt(v: Int32) -> Int32 { @_expose(wasm, "bjs_roundTripFloat") @_cdecl("bjs_roundTripFloat") -public func _bjs_roundTripFloat(v: Float32) -> Float32 { +public func _bjs_roundTripFloat(_ v: Float32) -> Float32 { #if arch(wasm32) let ret = roundTripFloat(v: Float.bridgeJSLiftParameter(v)) return ret.bridgeJSLowerReturn() @@ -2349,7 +2506,7 @@ public func _bjs_roundTripFloat(v: Float32) -> Float32 { @_expose(wasm, "bjs_roundTripDouble") @_cdecl("bjs_roundTripDouble") -public func _bjs_roundTripDouble(v: Float64) -> Float64 { +public func _bjs_roundTripDouble(_ v: Float64) -> Float64 { #if arch(wasm32) let ret = roundTripDouble(v: Double.bridgeJSLiftParameter(v)) return ret.bridgeJSLowerReturn() @@ -2360,7 +2517,7 @@ public func _bjs_roundTripDouble(v: Float64) -> Float64 { @_expose(wasm, "bjs_roundTripBool") @_cdecl("bjs_roundTripBool") -public func _bjs_roundTripBool(v: Int32) -> Int32 { +public func _bjs_roundTripBool(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = roundTripBool(v: Bool.bridgeJSLiftParameter(v)) return ret.bridgeJSLowerReturn() @@ -2371,7 +2528,7 @@ public func _bjs_roundTripBool(v: Int32) -> Int32 { @_expose(wasm, "bjs_roundTripString") @_cdecl("bjs_roundTripString") -public func _bjs_roundTripString(vBytes: Int32, vLength: Int32) -> Void { +public func _bjs_roundTripString(_ vBytes: Int32, _ vLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripString(v: String.bridgeJSLiftParameter(vBytes, vLength)) return ret.bridgeJSLowerReturn() @@ -2382,7 +2539,7 @@ public func _bjs_roundTripString(vBytes: Int32, vLength: Int32) -> Void { @_expose(wasm, "bjs_roundTripSwiftHeapObject") @_cdecl("bjs_roundTripSwiftHeapObject") -public func _bjs_roundTripSwiftHeapObject(v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_roundTripSwiftHeapObject(_ v: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = roundTripSwiftHeapObject(v: Greeter.bridgeJSLiftParameter(v)) return ret.bridgeJSLowerReturn() @@ -2393,7 +2550,7 @@ public func _bjs_roundTripSwiftHeapObject(v: UnsafeMutableRawPointer) -> UnsafeM @_expose(wasm, "bjs_roundTripJSObject") @_cdecl("bjs_roundTripJSObject") -public func _bjs_roundTripJSObject(v: Int32) -> Int32 { +public func _bjs_roundTripJSObject(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = roundTripJSObject(v: JSObject.bridgeJSLiftParameter(v)) return ret.bridgeJSLowerReturn() @@ -2404,7 +2561,7 @@ public func _bjs_roundTripJSObject(v: Int32) -> Int32 { @_expose(wasm, "bjs_throwsSwiftError") @_cdecl("bjs_throwsSwiftError") -public func _bjs_throwsSwiftError(shouldThrow: Int32) -> Void { +public func _bjs_throwsSwiftError(_ shouldThrow: Int32) -> Void { #if arch(wasm32) do { try throwsSwiftError(shouldThrow: Bool.bridgeJSLiftParameter(shouldThrow)) @@ -2616,7 +2773,7 @@ public func _bjs_asyncRoundTripVoid() -> Int32 { @_expose(wasm, "bjs_asyncRoundTripInt") @_cdecl("bjs_asyncRoundTripInt") -public func _bjs_asyncRoundTripInt(v: Int32) -> Int32 { +public func _bjs_asyncRoundTripInt(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripInt(v: Int.bridgeJSLiftParameter(v)).jsValue @@ -2629,7 +2786,7 @@ public func _bjs_asyncRoundTripInt(v: Int32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripFloat") @_cdecl("bjs_asyncRoundTripFloat") -public func _bjs_asyncRoundTripFloat(v: Float32) -> Int32 { +public func _bjs_asyncRoundTripFloat(_ v: Float32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripFloat(v: Float.bridgeJSLiftParameter(v)).jsValue @@ -2642,7 +2799,7 @@ public func _bjs_asyncRoundTripFloat(v: Float32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripDouble") @_cdecl("bjs_asyncRoundTripDouble") -public func _bjs_asyncRoundTripDouble(v: Float64) -> Int32 { +public func _bjs_asyncRoundTripDouble(_ v: Float64) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripDouble(v: Double.bridgeJSLiftParameter(v)).jsValue @@ -2655,7 +2812,7 @@ public func _bjs_asyncRoundTripDouble(v: Float64) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripBool") @_cdecl("bjs_asyncRoundTripBool") -public func _bjs_asyncRoundTripBool(v: Int32) -> Int32 { +public func _bjs_asyncRoundTripBool(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripBool(v: Bool.bridgeJSLiftParameter(v)).jsValue @@ -2668,7 +2825,7 @@ public func _bjs_asyncRoundTripBool(v: Int32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripString") @_cdecl("bjs_asyncRoundTripString") -public func _bjs_asyncRoundTripString(vBytes: Int32, vLength: Int32) -> Int32 { +public func _bjs_asyncRoundTripString(_ vBytes: Int32, _ vLength: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripString(v: String.bridgeJSLiftParameter(vBytes, vLength)).jsValue @@ -2681,7 +2838,7 @@ public func _bjs_asyncRoundTripString(vBytes: Int32, vLength: Int32) -> Int32 { @_expose(wasm, "bjs_asyncRoundTripSwiftHeapObject") @_cdecl("bjs_asyncRoundTripSwiftHeapObject") -public func _bjs_asyncRoundTripSwiftHeapObject(v: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_asyncRoundTripSwiftHeapObject(_ v: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripSwiftHeapObject(v: Greeter.bridgeJSLiftParameter(v)).jsValue @@ -2694,7 +2851,7 @@ public func _bjs_asyncRoundTripSwiftHeapObject(v: UnsafeMutableRawPointer) -> In @_expose(wasm, "bjs_asyncRoundTripJSObject") @_cdecl("bjs_asyncRoundTripJSObject") -public func _bjs_asyncRoundTripJSObject(v: Int32) -> Int32 { +public func _bjs_asyncRoundTripJSObject(_ v: Int32) -> Int32 { #if arch(wasm32) let ret = JSPromise.async { return await asyncRoundTripJSObject(v: JSObject.bridgeJSLiftParameter(v)).jsValue @@ -2707,7 +2864,7 @@ public func _bjs_asyncRoundTripJSObject(v: Int32) -> Int32 { @_expose(wasm, "bjs_takeGreeter") @_cdecl("bjs_takeGreeter") -public func _bjs_takeGreeter(g: UnsafeMutableRawPointer, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_takeGreeter(_ g: UnsafeMutableRawPointer, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) takeGreeter(g: Greeter.bridgeJSLiftParameter(g), name: String.bridgeJSLiftParameter(nameBytes, nameLength)) #else @@ -2728,7 +2885,7 @@ public func _bjs_createCalculator() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_useCalculator") @_cdecl("bjs_useCalculator") -public func _bjs_useCalculator(calc: UnsafeMutableRawPointer, x: Int32, y: Int32) -> Int32 { +public func _bjs_useCalculator(_ calc: UnsafeMutableRawPointer, _ x: Int32, _ y: Int32) -> Int32 { #if arch(wasm32) let ret = useCalculator(calc: Calculator.bridgeJSLiftParameter(calc), x: Int.bridgeJSLiftParameter(x), y: Int.bridgeJSLiftParameter(y)) return ret.bridgeJSLowerReturn() @@ -2761,7 +2918,7 @@ public func _bjs_testCalculatorToJSValue() -> Int32 { @_expose(wasm, "bjs_testSwiftClassAsJSValue") @_cdecl("bjs_testSwiftClassAsJSValue") -public func _bjs_testSwiftClassAsJSValue(greeter: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_testSwiftClassAsJSValue(_ greeter: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = testSwiftClassAsJSValue(greeter: Greeter.bridgeJSLiftParameter(greeter)) return ret.bridgeJSLowerReturn() @@ -2772,7 +2929,7 @@ public func _bjs_testSwiftClassAsJSValue(greeter: UnsafeMutableRawPointer) -> In @_expose(wasm, "bjs_setDirection") @_cdecl("bjs_setDirection") -public func _bjs_setDirection(direction: Int32) -> Int32 { +public func _bjs_setDirection(_ direction: Int32) -> Int32 { #if arch(wasm32) let ret = setDirection(_: Direction.bridgeJSLiftParameter(direction)) return ret.bridgeJSLowerReturn() @@ -2794,7 +2951,7 @@ public func _bjs_getDirection() -> Int32 { @_expose(wasm, "bjs_processDirection") @_cdecl("bjs_processDirection") -public func _bjs_processDirection(input: Int32) -> Int32 { +public func _bjs_processDirection(_ input: Int32) -> Int32 { #if arch(wasm32) let ret = processDirection(_: Direction.bridgeJSLiftParameter(input)) return ret.bridgeJSLowerReturn() @@ -2805,7 +2962,7 @@ public func _bjs_processDirection(input: Int32) -> Int32 { @_expose(wasm, "bjs_setTheme") @_cdecl("bjs_setTheme") -public func _bjs_setTheme(themeBytes: Int32, themeLength: Int32) -> Void { +public func _bjs_setTheme(_ themeBytes: Int32, _ themeLength: Int32) -> Void { #if arch(wasm32) let ret = setTheme(_: Theme.bridgeJSLiftParameter(themeBytes, themeLength)) return ret.bridgeJSLowerReturn() @@ -2827,7 +2984,7 @@ public func _bjs_getTheme() -> Void { @_expose(wasm, "bjs_setHttpStatus") @_cdecl("bjs_setHttpStatus") -public func _bjs_setHttpStatus(status: Int32) -> Int32 { +public func _bjs_setHttpStatus(_ status: Int32) -> Int32 { #if arch(wasm32) let ret = setHttpStatus(_: HttpStatus.bridgeJSLiftParameter(status)) return ret.bridgeJSLowerReturn() @@ -2849,7 +3006,7 @@ public func _bjs_getHttpStatus() -> Int32 { @_expose(wasm, "bjs_processTheme") @_cdecl("bjs_processTheme") -public func _bjs_processTheme(themeBytes: Int32, themeLength: Int32) -> Int32 { +public func _bjs_processTheme(_ themeBytes: Int32, _ themeLength: Int32) -> Int32 { #if arch(wasm32) let ret = processTheme(_: Theme.bridgeJSLiftParameter(themeBytes, themeLength)) return ret.bridgeJSLowerReturn() @@ -2860,7 +3017,7 @@ public func _bjs_processTheme(themeBytes: Int32, themeLength: Int32) -> Int32 { @_expose(wasm, "bjs_setTSDirection") @_cdecl("bjs_setTSDirection") -public func _bjs_setTSDirection(direction: Int32) -> Int32 { +public func _bjs_setTSDirection(_ direction: Int32) -> Int32 { #if arch(wasm32) let ret = setTSDirection(_: TSDirection.bridgeJSLiftParameter(direction)) return ret.bridgeJSLowerReturn() @@ -2882,7 +3039,7 @@ public func _bjs_getTSDirection() -> Int32 { @_expose(wasm, "bjs_setTSTheme") @_cdecl("bjs_setTSTheme") -public func _bjs_setTSTheme(themeBytes: Int32, themeLength: Int32) -> Void { +public func _bjs_setTSTheme(_ themeBytes: Int32, _ themeLength: Int32) -> Void { #if arch(wasm32) let ret = setTSTheme(_: TSTheme.bridgeJSLiftParameter(themeBytes, themeLength)) return ret.bridgeJSLowerReturn() @@ -2904,7 +3061,7 @@ public func _bjs_getTSTheme() -> Void { @_expose(wasm, "bjs_roundtripNetworkingAPIMethod") @_cdecl("bjs_roundtripNetworkingAPIMethod") -public func _bjs_roundtripNetworkingAPIMethod(method: Int32) -> Int32 { +public func _bjs_roundtripNetworkingAPIMethod(_ method: Int32) -> Int32 { #if arch(wasm32) let ret = roundtripNetworkingAPIMethod(_: Networking.API.Method.bridgeJSLiftParameter(method)) return ret.bridgeJSLowerReturn() @@ -2915,7 +3072,7 @@ public func _bjs_roundtripNetworkingAPIMethod(method: Int32) -> Int32 { @_expose(wasm, "bjs_roundtripConfigurationLogLevel") @_cdecl("bjs_roundtripConfigurationLogLevel") -public func _bjs_roundtripConfigurationLogLevel(levelBytes: Int32, levelLength: Int32) -> Void { +public func _bjs_roundtripConfigurationLogLevel(_ levelBytes: Int32, _ levelLength: Int32) -> Void { #if arch(wasm32) let ret = roundtripConfigurationLogLevel(_: Configuration.LogLevel.bridgeJSLiftParameter(levelBytes, levelLength)) return ret.bridgeJSLowerReturn() @@ -2926,7 +3083,7 @@ public func _bjs_roundtripConfigurationLogLevel(levelBytes: Int32, levelLength: @_expose(wasm, "bjs_roundtripConfigurationPort") @_cdecl("bjs_roundtripConfigurationPort") -public func _bjs_roundtripConfigurationPort(port: Int32) -> Int32 { +public func _bjs_roundtripConfigurationPort(_ port: Int32) -> Int32 { #if arch(wasm32) let ret = roundtripConfigurationPort(_: Configuration.Port.bridgeJSLiftParameter(port)) return ret.bridgeJSLowerReturn() @@ -2937,7 +3094,7 @@ public func _bjs_roundtripConfigurationPort(port: Int32) -> Int32 { @_expose(wasm, "bjs_processConfigurationLogLevel") @_cdecl("bjs_processConfigurationLogLevel") -public func _bjs_processConfigurationLogLevel(levelBytes: Int32, levelLength: Int32) -> Int32 { +public func _bjs_processConfigurationLogLevel(_ levelBytes: Int32, _ levelLength: Int32) -> Int32 { #if arch(wasm32) let ret = processConfigurationLogLevel(_: Configuration.LogLevel.bridgeJSLiftParameter(levelBytes, levelLength)) return ret.bridgeJSLowerReturn() @@ -2948,7 +3105,7 @@ public func _bjs_processConfigurationLogLevel(levelBytes: Int32, levelLength: In @_expose(wasm, "bjs_roundtripInternalSupportedMethod") @_cdecl("bjs_roundtripInternalSupportedMethod") -public func _bjs_roundtripInternalSupportedMethod(method: Int32) -> Int32 { +public func _bjs_roundtripInternalSupportedMethod(_ method: Int32) -> Int32 { #if arch(wasm32) let ret = roundtripInternalSupportedMethod(_: Internal.SupportedMethod.bridgeJSLiftParameter(method)) return ret.bridgeJSLowerReturn() @@ -2959,7 +3116,7 @@ public func _bjs_roundtripInternalSupportedMethod(method: Int32) -> Int32 { @_expose(wasm, "bjs_roundtripAPIResult") @_cdecl("bjs_roundtripAPIResult") -public func _bjs_roundtripAPIResult(result: Int32) -> Void { +public func _bjs_roundtripAPIResult(_ result: Int32) -> Void { #if arch(wasm32) let ret = roundtripAPIResult(result: APIResult.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -2970,7 +3127,7 @@ public func _bjs_roundtripAPIResult(result: Int32) -> Void { @_expose(wasm, "bjs_makeAPIResultSuccess") @_cdecl("bjs_makeAPIResultSuccess") -public func _bjs_makeAPIResultSuccess(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_makeAPIResultSuccess(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) let ret = makeAPIResultSuccess(_: String.bridgeJSLiftParameter(valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -2981,7 +3138,7 @@ public func _bjs_makeAPIResultSuccess(valueBytes: Int32, valueLength: Int32) -> @_expose(wasm, "bjs_makeAPIResultFailure") @_cdecl("bjs_makeAPIResultFailure") -public func _bjs_makeAPIResultFailure(value: Int32) -> Void { +public func _bjs_makeAPIResultFailure(_ value: Int32) -> Void { #if arch(wasm32) let ret = makeAPIResultFailure(_: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -3003,7 +3160,7 @@ public func _bjs_makeAPIResultInfo() -> Void { @_expose(wasm, "bjs_makeAPIResultFlag") @_cdecl("bjs_makeAPIResultFlag") -public func _bjs_makeAPIResultFlag(value: Int32) -> Void { +public func _bjs_makeAPIResultFlag(_ value: Int32) -> Void { #if arch(wasm32) let ret = makeAPIResultFlag(_: Bool.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -3014,7 +3171,7 @@ public func _bjs_makeAPIResultFlag(value: Int32) -> Void { @_expose(wasm, "bjs_makeAPIResultRate") @_cdecl("bjs_makeAPIResultRate") -public func _bjs_makeAPIResultRate(value: Float32) -> Void { +public func _bjs_makeAPIResultRate(_ value: Float32) -> Void { #if arch(wasm32) let ret = makeAPIResultRate(_: Float.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -3025,7 +3182,7 @@ public func _bjs_makeAPIResultRate(value: Float32) -> Void { @_expose(wasm, "bjs_makeAPIResultPrecise") @_cdecl("bjs_makeAPIResultPrecise") -public func _bjs_makeAPIResultPrecise(value: Float64) -> Void { +public func _bjs_makeAPIResultPrecise(_ value: Float64) -> Void { #if arch(wasm32) let ret = makeAPIResultPrecise(_: Double.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -3036,7 +3193,7 @@ public func _bjs_makeAPIResultPrecise(value: Float64) -> Void { @_expose(wasm, "bjs_roundtripComplexResult") @_cdecl("bjs_roundtripComplexResult") -public func _bjs_roundtripComplexResult(result: Int32) -> Void { +public func _bjs_roundtripComplexResult(_ result: Int32) -> Void { #if arch(wasm32) let ret = roundtripComplexResult(_: ComplexResult.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -3047,7 +3204,7 @@ public func _bjs_roundtripComplexResult(result: Int32) -> Void { @_expose(wasm, "bjs_makeComplexResultSuccess") @_cdecl("bjs_makeComplexResultSuccess") -public func _bjs_makeComplexResultSuccess(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_makeComplexResultSuccess(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) let ret = makeComplexResultSuccess(_: String.bridgeJSLiftParameter(valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -3058,7 +3215,7 @@ public func _bjs_makeComplexResultSuccess(valueBytes: Int32, valueLength: Int32) @_expose(wasm, "bjs_makeComplexResultError") @_cdecl("bjs_makeComplexResultError") -public func _bjs_makeComplexResultError(messageBytes: Int32, messageLength: Int32, code: Int32) -> Void { +public func _bjs_makeComplexResultError(_ messageBytes: Int32, _ messageLength: Int32, _ code: Int32) -> Void { #if arch(wasm32) let ret = makeComplexResultError(_: String.bridgeJSLiftParameter(messageBytes, messageLength), _: Int.bridgeJSLiftParameter(code)) return ret.bridgeJSLowerReturn() @@ -3069,7 +3226,7 @@ public func _bjs_makeComplexResultError(messageBytes: Int32, messageLength: Int3 @_expose(wasm, "bjs_makeComplexResultLocation") @_cdecl("bjs_makeComplexResultLocation") -public func _bjs_makeComplexResultLocation(lat: Float64, lng: Float64, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_makeComplexResultLocation(_ lat: Float64, _ lng: Float64, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = makeComplexResultLocation(_: Double.bridgeJSLiftParameter(lat), _: Double.bridgeJSLiftParameter(lng), _: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -3080,7 +3237,7 @@ public func _bjs_makeComplexResultLocation(lat: Float64, lng: Float64, nameBytes @_expose(wasm, "bjs_makeComplexResultStatus") @_cdecl("bjs_makeComplexResultStatus") -public func _bjs_makeComplexResultStatus(active: Int32, code: Int32, messageBytes: Int32, messageLength: Int32) -> Void { +public func _bjs_makeComplexResultStatus(_ active: Int32, _ code: Int32, _ messageBytes: Int32, _ messageLength: Int32) -> Void { #if arch(wasm32) let ret = makeComplexResultStatus(_: Bool.bridgeJSLiftParameter(active), _: Int.bridgeJSLiftParameter(code), _: String.bridgeJSLiftParameter(messageBytes, messageLength)) return ret.bridgeJSLowerReturn() @@ -3091,7 +3248,7 @@ public func _bjs_makeComplexResultStatus(active: Int32, code: Int32, messageByte @_expose(wasm, "bjs_makeComplexResultCoordinates") @_cdecl("bjs_makeComplexResultCoordinates") -public func _bjs_makeComplexResultCoordinates(x: Float64, y: Float64, z: Float64) -> Void { +public func _bjs_makeComplexResultCoordinates(_ x: Float64, _ y: Float64, _ z: Float64) -> Void { #if arch(wasm32) let ret = makeComplexResultCoordinates(_: Double.bridgeJSLiftParameter(x), _: Double.bridgeJSLiftParameter(y), _: Double.bridgeJSLiftParameter(z)) return ret.bridgeJSLowerReturn() @@ -3102,7 +3259,7 @@ public func _bjs_makeComplexResultCoordinates(x: Float64, y: Float64, z: Float64 @_expose(wasm, "bjs_makeComplexResultComprehensive") @_cdecl("bjs_makeComplexResultComprehensive") -public func _bjs_makeComplexResultComprehensive(flag1: Int32, flag2: Int32, count1: Int32, count2: Int32, value1: Float64, value2: Float64, text1Bytes: Int32, text1Length: Int32, text2Bytes: Int32, text2Length: Int32, text3Bytes: Int32, text3Length: Int32) -> Void { +public func _bjs_makeComplexResultComprehensive(_ flag1: Int32, _ flag2: Int32, _ count1: Int32, _ count2: Int32, _ value1: Float64, _ value2: Float64, _ text1Bytes: Int32, _ text1Length: Int32, _ text2Bytes: Int32, _ text2Length: Int32, _ text3Bytes: Int32, _ text3Length: Int32) -> Void { #if arch(wasm32) let ret = makeComplexResultComprehensive(_: Bool.bridgeJSLiftParameter(flag1), _: Bool.bridgeJSLiftParameter(flag2), _: Int.bridgeJSLiftParameter(count1), _: Int.bridgeJSLiftParameter(count2), _: Double.bridgeJSLiftParameter(value1), _: Double.bridgeJSLiftParameter(value2), _: String.bridgeJSLiftParameter(text1Bytes, text1Length), _: String.bridgeJSLiftParameter(text2Bytes, text2Length), _: String.bridgeJSLiftParameter(text3Bytes, text3Length)) return ret.bridgeJSLowerReturn() @@ -3124,7 +3281,7 @@ public func _bjs_makeComplexResultInfo() -> Void { @_expose(wasm, "bjs_makeUtilitiesResultSuccess") @_cdecl("bjs_makeUtilitiesResultSuccess") -public func _bjs_makeUtilitiesResultSuccess(messageBytes: Int32, messageLength: Int32) -> Void { +public func _bjs_makeUtilitiesResultSuccess(_ messageBytes: Int32, _ messageLength: Int32) -> Void { #if arch(wasm32) let ret = makeUtilitiesResultSuccess(_: String.bridgeJSLiftParameter(messageBytes, messageLength)) return ret.bridgeJSLowerReturn() @@ -3135,7 +3292,7 @@ public func _bjs_makeUtilitiesResultSuccess(messageBytes: Int32, messageLength: @_expose(wasm, "bjs_makeUtilitiesResultFailure") @_cdecl("bjs_makeUtilitiesResultFailure") -public func _bjs_makeUtilitiesResultFailure(errorBytes: Int32, errorLength: Int32, code: Int32) -> Void { +public func _bjs_makeUtilitiesResultFailure(_ errorBytes: Int32, _ errorLength: Int32, _ code: Int32) -> Void { #if arch(wasm32) let ret = makeUtilitiesResultFailure(_: String.bridgeJSLiftParameter(errorBytes, errorLength), _: Int.bridgeJSLiftParameter(code)) return ret.bridgeJSLowerReturn() @@ -3146,7 +3303,7 @@ public func _bjs_makeUtilitiesResultFailure(errorBytes: Int32, errorLength: Int3 @_expose(wasm, "bjs_makeUtilitiesResultStatus") @_cdecl("bjs_makeUtilitiesResultStatus") -public func _bjs_makeUtilitiesResultStatus(active: Int32, code: Int32, messageBytes: Int32, messageLength: Int32) -> Void { +public func _bjs_makeUtilitiesResultStatus(_ active: Int32, _ code: Int32, _ messageBytes: Int32, _ messageLength: Int32) -> Void { #if arch(wasm32) let ret = makeUtilitiesResultStatus(_: Bool.bridgeJSLiftParameter(active), _: Int.bridgeJSLiftParameter(code), _: String.bridgeJSLiftParameter(messageBytes, messageLength)) return ret.bridgeJSLowerReturn() @@ -3157,7 +3314,7 @@ public func _bjs_makeUtilitiesResultStatus(active: Int32, code: Int32, messageBy @_expose(wasm, "bjs_makeAPINetworkingResultSuccess") @_cdecl("bjs_makeAPINetworkingResultSuccess") -public func _bjs_makeAPINetworkingResultSuccess(messageBytes: Int32, messageLength: Int32) -> Void { +public func _bjs_makeAPINetworkingResultSuccess(_ messageBytes: Int32, _ messageLength: Int32) -> Void { #if arch(wasm32) let ret = makeAPINetworkingResultSuccess(_: String.bridgeJSLiftParameter(messageBytes, messageLength)) return ret.bridgeJSLowerReturn() @@ -3168,7 +3325,7 @@ public func _bjs_makeAPINetworkingResultSuccess(messageBytes: Int32, messageLeng @_expose(wasm, "bjs_makeAPINetworkingResultFailure") @_cdecl("bjs_makeAPINetworkingResultFailure") -public func _bjs_makeAPINetworkingResultFailure(errorBytes: Int32, errorLength: Int32, code: Int32) -> Void { +public func _bjs_makeAPINetworkingResultFailure(_ errorBytes: Int32, _ errorLength: Int32, _ code: Int32) -> Void { #if arch(wasm32) let ret = makeAPINetworkingResultFailure(_: String.bridgeJSLiftParameter(errorBytes, errorLength), _: Int.bridgeJSLiftParameter(code)) return ret.bridgeJSLowerReturn() @@ -3179,7 +3336,7 @@ public func _bjs_makeAPINetworkingResultFailure(errorBytes: Int32, errorLength: @_expose(wasm, "bjs_roundtripUtilitiesResult") @_cdecl("bjs_roundtripUtilitiesResult") -public func _bjs_roundtripUtilitiesResult(result: Int32) -> Void { +public func _bjs_roundtripUtilitiesResult(_ result: Int32) -> Void { #if arch(wasm32) let ret = roundtripUtilitiesResult(_: Utilities.Result.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -3190,7 +3347,7 @@ public func _bjs_roundtripUtilitiesResult(result: Int32) -> Void { @_expose(wasm, "bjs_roundtripAPINetworkingResult") @_cdecl("bjs_roundtripAPINetworkingResult") -public func _bjs_roundtripAPINetworkingResult(result: Int32) -> Void { +public func _bjs_roundtripAPINetworkingResult(_ result: Int32) -> Void { #if arch(wasm32) let ret = roundtripAPINetworkingResult(_: API.NetworkingResult.bridgeJSLiftParameter(result)) return ret.bridgeJSLowerReturn() @@ -3201,7 +3358,7 @@ public func _bjs_roundtripAPINetworkingResult(result: Int32) -> Void { @_expose(wasm, "bjs_roundTripOptionalString") @_cdecl("bjs_roundTripOptionalString") -public func _bjs_roundTripOptionalString(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripOptionalString(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalString(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -3212,7 +3369,7 @@ public func _bjs_roundTripOptionalString(nameIsSome: Int32, nameBytes: Int32, na @_expose(wasm, "bjs_roundTripOptionalInt") @_cdecl("bjs_roundTripOptionalInt") -public func _bjs_roundTripOptionalInt(valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_roundTripOptionalInt(_ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalInt(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -3223,7 +3380,7 @@ public func _bjs_roundTripOptionalInt(valueIsSome: Int32, valueValue: Int32) -> @_expose(wasm, "bjs_roundTripOptionalBool") @_cdecl("bjs_roundTripOptionalBool") -public func _bjs_roundTripOptionalBool(flagIsSome: Int32, flagValue: Int32) -> Void { +public func _bjs_roundTripOptionalBool(_ flagIsSome: Int32, _ flagValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalBool(flag: Optional.bridgeJSLiftParameter(flagIsSome, flagValue)) return ret.bridgeJSLowerReturn() @@ -3234,7 +3391,7 @@ public func _bjs_roundTripOptionalBool(flagIsSome: Int32, flagValue: Int32) -> V @_expose(wasm, "bjs_roundTripOptionalFloat") @_cdecl("bjs_roundTripOptionalFloat") -public func _bjs_roundTripOptionalFloat(numberIsSome: Int32, numberValue: Float32) -> Void { +public func _bjs_roundTripOptionalFloat(_ numberIsSome: Int32, _ numberValue: Float32) -> Void { #if arch(wasm32) let ret = roundTripOptionalFloat(number: Optional.bridgeJSLiftParameter(numberIsSome, numberValue)) return ret.bridgeJSLowerReturn() @@ -3245,7 +3402,7 @@ public func _bjs_roundTripOptionalFloat(numberIsSome: Int32, numberValue: Float3 @_expose(wasm, "bjs_roundTripOptionalDouble") @_cdecl("bjs_roundTripOptionalDouble") -public func _bjs_roundTripOptionalDouble(precisionIsSome: Int32, precisionValue: Float64) -> Void { +public func _bjs_roundTripOptionalDouble(_ precisionIsSome: Int32, _ precisionValue: Float64) -> Void { #if arch(wasm32) let ret = roundTripOptionalDouble(precision: Optional.bridgeJSLiftParameter(precisionIsSome, precisionValue)) return ret.bridgeJSLowerReturn() @@ -3256,7 +3413,7 @@ public func _bjs_roundTripOptionalDouble(precisionIsSome: Int32, precisionValue: @_expose(wasm, "bjs_roundTripOptionalSyntax") @_cdecl("bjs_roundTripOptionalSyntax") -public func _bjs_roundTripOptionalSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripOptionalSyntax(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalSyntax(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -3267,7 +3424,7 @@ public func _bjs_roundTripOptionalSyntax(nameIsSome: Int32, nameBytes: Int32, na @_expose(wasm, "bjs_roundTripOptionalMixSyntax") @_cdecl("bjs_roundTripOptionalMixSyntax") -public func _bjs_roundTripOptionalMixSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripOptionalMixSyntax(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalMixSyntax(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -3278,7 +3435,7 @@ public func _bjs_roundTripOptionalMixSyntax(nameIsSome: Int32, nameBytes: Int32, @_expose(wasm, "bjs_roundTripOptionalSwiftSyntax") @_cdecl("bjs_roundTripOptionalSwiftSyntax") -public func _bjs_roundTripOptionalSwiftSyntax(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_roundTripOptionalSwiftSyntax(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalSwiftSyntax(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -3289,7 +3446,7 @@ public func _bjs_roundTripOptionalSwiftSyntax(nameIsSome: Int32, nameBytes: Int3 @_expose(wasm, "bjs_roundTripOptionalWithSpaces") @_cdecl("bjs_roundTripOptionalWithSpaces") -public func _bjs_roundTripOptionalWithSpaces(valueIsSome: Int32, valueValue: Float64) -> Void { +public func _bjs_roundTripOptionalWithSpaces(_ valueIsSome: Int32, _ valueValue: Float64) -> Void { #if arch(wasm32) let ret = roundTripOptionalWithSpaces(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -3300,7 +3457,7 @@ public func _bjs_roundTripOptionalWithSpaces(valueIsSome: Int32, valueValue: Flo @_expose(wasm, "bjs_roundTripOptionalTypeAlias") @_cdecl("bjs_roundTripOptionalTypeAlias") -public func _bjs_roundTripOptionalTypeAlias(ageIsSome: Int32, ageValue: Int32) -> Void { +public func _bjs_roundTripOptionalTypeAlias(_ ageIsSome: Int32, _ ageValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTypeAlias(age: Optional.bridgeJSLiftParameter(ageIsSome, ageValue)) return ret.bridgeJSLowerReturn() @@ -3311,7 +3468,7 @@ public func _bjs_roundTripOptionalTypeAlias(ageIsSome: Int32, ageValue: Int32) - @_expose(wasm, "bjs_roundTripOptionalStatus") @_cdecl("bjs_roundTripOptionalStatus") -public func _bjs_roundTripOptionalStatus(valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_roundTripOptionalStatus(_ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalStatus(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -3322,7 +3479,7 @@ public func _bjs_roundTripOptionalStatus(valueIsSome: Int32, valueValue: Int32) @_expose(wasm, "bjs_roundTripOptionalTheme") @_cdecl("bjs_roundTripOptionalTheme") -public func _bjs_roundTripOptionalTheme(valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_roundTripOptionalTheme(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTheme(value: Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -3333,7 +3490,7 @@ public func _bjs_roundTripOptionalTheme(valueIsSome: Int32, valueBytes: Int32, v @_expose(wasm, "bjs_roundTripOptionalHttpStatus") @_cdecl("bjs_roundTripOptionalHttpStatus") -public func _bjs_roundTripOptionalHttpStatus(valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_roundTripOptionalHttpStatus(_ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalHttpStatus(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -3344,7 +3501,7 @@ public func _bjs_roundTripOptionalHttpStatus(valueIsSome: Int32, valueValue: Int @_expose(wasm, "bjs_roundTripOptionalTSDirection") @_cdecl("bjs_roundTripOptionalTSDirection") -public func _bjs_roundTripOptionalTSDirection(valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_roundTripOptionalTSDirection(_ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTSDirection(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -3355,7 +3512,7 @@ public func _bjs_roundTripOptionalTSDirection(valueIsSome: Int32, valueValue: In @_expose(wasm, "bjs_roundTripOptionalTSTheme") @_cdecl("bjs_roundTripOptionalTSTheme") -public func _bjs_roundTripOptionalTSTheme(valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_roundTripOptionalTSTheme(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalTSTheme(value: Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength)) return ret.bridgeJSLowerReturn() @@ -3366,7 +3523,7 @@ public func _bjs_roundTripOptionalTSTheme(valueIsSome: Int32, valueBytes: Int32, @_expose(wasm, "bjs_roundTripOptionalNetworkingAPIMethod") @_cdecl("bjs_roundTripOptionalNetworkingAPIMethod") -public func _bjs_roundTripOptionalNetworkingAPIMethod(methodIsSome: Int32, methodValue: Int32) -> Void { +public func _bjs_roundTripOptionalNetworkingAPIMethod(_ methodIsSome: Int32, _ methodValue: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalNetworkingAPIMethod(_: Optional.bridgeJSLiftParameter(methodIsSome, methodValue)) return ret.bridgeJSLowerReturn() @@ -3377,7 +3534,7 @@ public func _bjs_roundTripOptionalNetworkingAPIMethod(methodIsSome: Int32, metho @_expose(wasm, "bjs_roundTripOptionalAPIResult") @_cdecl("bjs_roundTripOptionalAPIResult") -public func _bjs_roundTripOptionalAPIResult(valueIsSome: Int32, valueCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalAPIResult(_ valueIsSome: Int32, _ valueCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalAPIResult(value: Optional.bridgeJSLiftParameter(valueIsSome, valueCaseId)) return ret.bridgeJSLowerReturn() @@ -3388,7 +3545,7 @@ public func _bjs_roundTripOptionalAPIResult(valueIsSome: Int32, valueCaseId: Int @_expose(wasm, "bjs_compareAPIResults") @_cdecl("bjs_compareAPIResults") -public func _bjs_compareAPIResults(r1IsSome: Int32, r1CaseId: Int32, r2IsSome: Int32, r2CaseId: Int32) -> Void { +public func _bjs_compareAPIResults(_ r1IsSome: Int32, _ r1CaseId: Int32, _ r2IsSome: Int32, _ r2CaseId: Int32) -> Void { #if arch(wasm32) let _tmp_r2 = Optional.bridgeJSLiftParameter(r2IsSome, r2CaseId) let _tmp_r1 = Optional.bridgeJSLiftParameter(r1IsSome, r1CaseId) @@ -3401,7 +3558,7 @@ public func _bjs_compareAPIResults(r1IsSome: Int32, r1CaseId: Int32, r2IsSome: I @_expose(wasm, "bjs_roundTripOptionalComplexResult") @_cdecl("bjs_roundTripOptionalComplexResult") -public func _bjs_roundTripOptionalComplexResult(resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalComplexResult(_ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalComplexResult(_: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) return ret.bridgeJSLowerReturn() @@ -3412,7 +3569,7 @@ public func _bjs_roundTripOptionalComplexResult(resultIsSome: Int32, resultCaseI @_expose(wasm, "bjs_roundTripOptionalClass") @_cdecl("bjs_roundTripOptionalClass") -public func _bjs_roundTripOptionalClass(valueIsSome: Int32, valueValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_roundTripOptionalClass(_ valueIsSome: Int32, _ valueValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = roundTripOptionalClass(value: Optional.bridgeJSLiftParameter(valueIsSome, valueValue)) return ret.bridgeJSLowerReturn() @@ -3423,7 +3580,7 @@ public func _bjs_roundTripOptionalClass(valueIsSome: Int32, valueValue: UnsafeMu @_expose(wasm, "bjs_roundTripOptionalAPIOptionalResult") @_cdecl("bjs_roundTripOptionalAPIOptionalResult") -public func _bjs_roundTripOptionalAPIOptionalResult(resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_roundTripOptionalAPIOptionalResult(_ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) let ret = roundTripOptionalAPIOptionalResult(result: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) return ret.bridgeJSLowerReturn() @@ -3434,7 +3591,7 @@ public func _bjs_roundTripOptionalAPIOptionalResult(resultIsSome: Int32, resultC @_expose(wasm, "bjs_createPropertyHolder") @_cdecl("bjs_createPropertyHolder") -public func _bjs_createPropertyHolder(intValue: Int32, floatValue: Float32, doubleValue: Float64, boolValue: Int32, stringValueBytes: Int32, stringValueLength: Int32, jsObject: Int32) -> UnsafeMutableRawPointer { +public func _bjs_createPropertyHolder(_ intValue: Int32, _ floatValue: Float32, _ doubleValue: Float64, _ boolValue: Int32, _ stringValueBytes: Int32, _ stringValueLength: Int32, _ jsObject: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = createPropertyHolder(intValue: Int.bridgeJSLiftParameter(intValue), floatValue: Float.bridgeJSLiftParameter(floatValue), doubleValue: Double.bridgeJSLiftParameter(doubleValue), boolValue: Bool.bridgeJSLiftParameter(boolValue), stringValue: String.bridgeJSLiftParameter(stringValueBytes, stringValueLength), jsObject: JSObject.bridgeJSLiftParameter(jsObject)) return ret.bridgeJSLowerReturn() @@ -3445,7 +3602,7 @@ public func _bjs_createPropertyHolder(intValue: Int32, floatValue: Float32, doub @_expose(wasm, "bjs_testPropertyHolder") @_cdecl("bjs_testPropertyHolder") -public func _bjs_testPropertyHolder(holder: UnsafeMutableRawPointer) -> Void { +public func _bjs_testPropertyHolder(_ holder: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = testPropertyHolder(holder: PropertyHolder.bridgeJSLiftParameter(holder)) return ret.bridgeJSLowerReturn() @@ -3477,7 +3634,7 @@ public func _bjs_getObserverStats() -> Void { @_expose(wasm, "bjs_testStringDefault") @_cdecl("bjs_testStringDefault") -public func _bjs_testStringDefault(messageBytes: Int32, messageLength: Int32) -> Void { +public func _bjs_testStringDefault(_ messageBytes: Int32, _ messageLength: Int32) -> Void { #if arch(wasm32) let ret = testStringDefault(message: String.bridgeJSLiftParameter(messageBytes, messageLength)) return ret.bridgeJSLowerReturn() @@ -3488,7 +3645,7 @@ public func _bjs_testStringDefault(messageBytes: Int32, messageLength: Int32) -> @_expose(wasm, "bjs_testIntDefault") @_cdecl("bjs_testIntDefault") -public func _bjs_testIntDefault(count: Int32) -> Int32 { +public func _bjs_testIntDefault(_ count: Int32) -> Int32 { #if arch(wasm32) let ret = testIntDefault(count: Int.bridgeJSLiftParameter(count)) return ret.bridgeJSLowerReturn() @@ -3499,7 +3656,7 @@ public func _bjs_testIntDefault(count: Int32) -> Int32 { @_expose(wasm, "bjs_testBoolDefault") @_cdecl("bjs_testBoolDefault") -public func _bjs_testBoolDefault(flag: Int32) -> Int32 { +public func _bjs_testBoolDefault(_ flag: Int32) -> Int32 { #if arch(wasm32) let ret = testBoolDefault(flag: Bool.bridgeJSLiftParameter(flag)) return ret.bridgeJSLowerReturn() @@ -3510,7 +3667,7 @@ public func _bjs_testBoolDefault(flag: Int32) -> Int32 { @_expose(wasm, "bjs_testOptionalDefault") @_cdecl("bjs_testOptionalDefault") -public func _bjs_testOptionalDefault(nameIsSome: Int32, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_testOptionalDefault(_ nameIsSome: Int32, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) let ret = testOptionalDefault(name: Optional.bridgeJSLiftParameter(nameIsSome, nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -3521,7 +3678,7 @@ public func _bjs_testOptionalDefault(nameIsSome: Int32, nameBytes: Int32, nameLe @_expose(wasm, "bjs_testMultipleDefaults") @_cdecl("bjs_testMultipleDefaults") -public func _bjs_testMultipleDefaults(titleBytes: Int32, titleLength: Int32, count: Int32, enabled: Int32) -> Void { +public func _bjs_testMultipleDefaults(_ titleBytes: Int32, _ titleLength: Int32, _ count: Int32, _ enabled: Int32) -> Void { #if arch(wasm32) let ret = testMultipleDefaults(title: String.bridgeJSLiftParameter(titleBytes, titleLength), count: Int.bridgeJSLiftParameter(count), enabled: Bool.bridgeJSLiftParameter(enabled)) return ret.bridgeJSLowerReturn() @@ -3532,7 +3689,7 @@ public func _bjs_testMultipleDefaults(titleBytes: Int32, titleLength: Int32, cou @_expose(wasm, "bjs_testSimpleEnumDefault") @_cdecl("bjs_testSimpleEnumDefault") -public func _bjs_testSimpleEnumDefault(status: Int32) -> Int32 { +public func _bjs_testSimpleEnumDefault(_ status: Int32) -> Int32 { #if arch(wasm32) let ret = testSimpleEnumDefault(status: Status.bridgeJSLiftParameter(status)) return ret.bridgeJSLowerReturn() @@ -3543,7 +3700,7 @@ public func _bjs_testSimpleEnumDefault(status: Int32) -> Int32 { @_expose(wasm, "bjs_testDirectionDefault") @_cdecl("bjs_testDirectionDefault") -public func _bjs_testDirectionDefault(direction: Int32) -> Int32 { +public func _bjs_testDirectionDefault(_ direction: Int32) -> Int32 { #if arch(wasm32) let ret = testDirectionDefault(direction: Direction.bridgeJSLiftParameter(direction)) return ret.bridgeJSLowerReturn() @@ -3554,7 +3711,7 @@ public func _bjs_testDirectionDefault(direction: Int32) -> Int32 { @_expose(wasm, "bjs_testRawStringEnumDefault") @_cdecl("bjs_testRawStringEnumDefault") -public func _bjs_testRawStringEnumDefault(themeBytes: Int32, themeLength: Int32) -> Void { +public func _bjs_testRawStringEnumDefault(_ themeBytes: Int32, _ themeLength: Int32) -> Void { #if arch(wasm32) let ret = testRawStringEnumDefault(theme: Theme.bridgeJSLiftParameter(themeBytes, themeLength)) return ret.bridgeJSLowerReturn() @@ -3565,7 +3722,7 @@ public func _bjs_testRawStringEnumDefault(themeBytes: Int32, themeLength: Int32) @_expose(wasm, "bjs_testComplexInit") @_cdecl("bjs_testComplexInit") -public func _bjs_testComplexInit(greeter: UnsafeMutableRawPointer) -> Void { +public func _bjs_testComplexInit(_ greeter: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = testComplexInit(greeter: Greeter.bridgeJSLiftParameter(greeter)) return ret.bridgeJSLowerReturn() @@ -3576,7 +3733,7 @@ public func _bjs_testComplexInit(greeter: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_testEmptyInit") @_cdecl("bjs_testEmptyInit") -public func _bjs_testEmptyInit(object: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_testEmptyInit(_ object: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = testEmptyInit(_: StaticPropertyHolder.bridgeJSLiftParameter(object)) return ret.bridgeJSLowerReturn() @@ -3587,7 +3744,7 @@ public func _bjs_testEmptyInit(object: UnsafeMutableRawPointer) -> UnsafeMutable @_expose(wasm, "bjs_formatName") @_cdecl("bjs_formatName") -public func _bjs_formatName(nameBytes: Int32, nameLength: Int32, transform: Int32) -> Void { +public func _bjs_formatName(_ nameBytes: Int32, _ nameLength: Int32, _ transform: Int32) -> Void { #if arch(wasm32) let ret = formatName(_: String.bridgeJSLiftParameter(nameBytes, nameLength), transform: _BJS_Closure_20BridgeJSRuntimeTestsSS_SS.bridgeJSLift(transform)) return ret.bridgeJSLowerReturn() @@ -3598,7 +3755,7 @@ public func _bjs_formatName(nameBytes: Int32, nameLength: Int32, transform: Int3 @_expose(wasm, "bjs_makeFormatter") @_cdecl("bjs_makeFormatter") -public func _bjs_makeFormatter(prefixBytes: Int32, prefixLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_makeFormatter(_ prefixBytes: Int32, _ prefixLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = makeFormatter(prefix: String.bridgeJSLiftParameter(prefixBytes, prefixLength)) return _BJS_Closure_20BridgeJSRuntimeTestsSS_SS.bridgeJSLower(ret) @@ -3609,7 +3766,7 @@ public func _bjs_makeFormatter(prefixBytes: Int32, prefixLength: Int32) -> Unsaf @_expose(wasm, "bjs_makeAdder") @_cdecl("bjs_makeAdder") -public func _bjs_makeAdder(base: Int32) -> UnsafeMutableRawPointer { +public func _bjs_makeAdder(_ base: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = makeAdder(base: Int.bridgeJSLiftParameter(base)) return _BJS_Closure_20BridgeJSRuntimeTestsSi_Si.bridgeJSLower(ret) @@ -3686,7 +3843,7 @@ public func _bjs_roundTripValidationReport() -> Void { @_expose(wasm, "bjs_updateValidationReport") @_cdecl("bjs_updateValidationReport") -public func _bjs_updateValidationReport(newResultIsSome: Int32, newResultCaseId: Int32) -> Void { +public func _bjs_updateValidationReport(_ newResultIsSome: Int32, _ newResultCaseId: Int32) -> Void { #if arch(wasm32) let _tmp_report = ValidationReport.bridgeJSLiftParameter() let _tmp_newResult = Optional.bridgeJSLiftParameter(newResultIsSome, newResultCaseId) @@ -3710,7 +3867,7 @@ public func _bjs_testContainerWithStruct() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Greeter_init") @_cdecl("bjs_Greeter_init") -public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_init(_ nameBytes: Int32, _ nameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) return ret.bridgeJSLowerReturn() @@ -3721,7 +3878,7 @@ public func _bjs_Greeter_init(nameBytes: Int32, nameLength: Int32) -> UnsafeMuta @_expose(wasm, "bjs_Greeter_greet") @_cdecl("bjs_Greeter_greet") -public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_greet(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).greet() return ret.bridgeJSLowerReturn() @@ -3732,7 +3889,7 @@ public func _bjs_Greeter_greet(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_changeName") @_cdecl("bjs_Greeter_changeName") -public func _bjs_Greeter_changeName(_self: UnsafeMutableRawPointer, nameBytes: Int32, nameLength: Int32) -> Void { +public func _bjs_Greeter_changeName(_ _self: UnsafeMutableRawPointer, _ nameBytes: Int32, _ nameLength: Int32) -> Void { #if arch(wasm32) Greeter.bridgeJSLiftParameter(_self).changeName(name: String.bridgeJSLiftParameter(nameBytes, nameLength)) #else @@ -3742,7 +3899,7 @@ public func _bjs_Greeter_changeName(_self: UnsafeMutableRawPointer, nameBytes: I @_expose(wasm, "bjs_Greeter_greetWith") @_cdecl("bjs_Greeter_greetWith") -public func _bjs_Greeter_greetWith(_self: UnsafeMutableRawPointer, greeter: UnsafeMutableRawPointer, customGreeting: Int32) -> Void { +public func _bjs_Greeter_greetWith(_ _self: UnsafeMutableRawPointer, _ greeter: UnsafeMutableRawPointer, _ customGreeting: Int32) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).greetWith(greeter: Greeter.bridgeJSLiftParameter(greeter), customGreeting: _BJS_Closure_20BridgeJSRuntimeTests7GreeterC_SS.bridgeJSLift(customGreeting)) return ret.bridgeJSLowerReturn() @@ -3753,7 +3910,7 @@ public func _bjs_Greeter_greetWith(_self: UnsafeMutableRawPointer, greeter: Unsa @_expose(wasm, "bjs_Greeter_makeFormatter") @_cdecl("bjs_Greeter_makeFormatter") -public func _bjs_Greeter_makeFormatter(_self: UnsafeMutableRawPointer, suffixBytes: Int32, suffixLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_makeFormatter(_ _self: UnsafeMutableRawPointer, _ suffixBytes: Int32, _ suffixLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).makeFormatter(suffix: String.bridgeJSLiftParameter(suffixBytes, suffixLength)) return _BJS_Closure_20BridgeJSRuntimeTestsSS_SS.bridgeJSLower(ret) @@ -3764,7 +3921,7 @@ public func _bjs_Greeter_makeFormatter(_self: UnsafeMutableRawPointer, suffixByt @_expose(wasm, "bjs_Greeter_static_makeCreator") @_cdecl("bjs_Greeter_static_makeCreator") -public func _bjs_Greeter_static_makeCreator(defaultNameBytes: Int32, defaultNameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_static_makeCreator(_ defaultNameBytes: Int32, _ defaultNameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter.makeCreator(defaultName: String.bridgeJSLiftParameter(defaultNameBytes, defaultNameLength)) return _BJS_Closure_20BridgeJSRuntimeTestsSS_7GreeterC.bridgeJSLower(ret) @@ -3775,7 +3932,7 @@ public func _bjs_Greeter_static_makeCreator(defaultNameBytes: Int32, defaultName @_expose(wasm, "bjs_Greeter_makeCustomGreeter") @_cdecl("bjs_Greeter_makeCustomGreeter") -public func _bjs_Greeter_makeCustomGreeter(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_Greeter_makeCustomGreeter(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).makeCustomGreeter() return _BJS_Closure_20BridgeJSRuntimeTests7GreeterC_SS.bridgeJSLower(ret) @@ -3786,7 +3943,7 @@ public func _bjs_Greeter_makeCustomGreeter(_self: UnsafeMutableRawPointer) -> Un @_expose(wasm, "bjs_Greeter_name_get") @_cdecl("bjs_Greeter_name_get") -public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -3797,7 +3954,7 @@ public func _bjs_Greeter_name_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_name_set") @_cdecl("bjs_Greeter_name_set") -public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_Greeter_name_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) Greeter.bridgeJSLiftParameter(_self).name = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -3807,7 +3964,7 @@ public func _bjs_Greeter_name_set(_self: UnsafeMutableRawPointer, valueBytes: In @_expose(wasm, "bjs_Greeter_prefix_get") @_cdecl("bjs_Greeter_prefix_get") -public func _bjs_Greeter_prefix_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Greeter_prefix_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Greeter.bridgeJSLiftParameter(_self).prefix return ret.bridgeJSLowerReturn() @@ -3818,8 +3975,12 @@ public func _bjs_Greeter_prefix_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Greeter_deinit") @_cdecl("bjs_Greeter_deinit") -public func _bjs_Greeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Greeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -3830,16 +3991,16 @@ extension Greeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_Greeter_wrap") -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Greeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Greeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_Calculator_square") @_cdecl("bjs_Calculator_square") -public func _bjs_Calculator_square(_self: UnsafeMutableRawPointer, value: Int32) -> Int32 { +public func _bjs_Calculator_square(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Int32 { #if arch(wasm32) let ret = Calculator.bridgeJSLiftParameter(_self).square(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -3850,7 +4011,7 @@ public func _bjs_Calculator_square(_self: UnsafeMutableRawPointer, value: Int32) @_expose(wasm, "bjs_Calculator_add") @_cdecl("bjs_Calculator_add") -public func _bjs_Calculator_add(_self: UnsafeMutableRawPointer, a: Int32, b: Int32) -> Int32 { +public func _bjs_Calculator_add(_ _self: UnsafeMutableRawPointer, _ a: Int32, _ b: Int32) -> Int32 { #if arch(wasm32) let ret = Calculator.bridgeJSLiftParameter(_self).add(a: Int.bridgeJSLiftParameter(a), b: Int.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -3861,8 +4022,12 @@ public func _bjs_Calculator_add(_self: UnsafeMutableRawPointer, a: Int32, b: Int @_expose(wasm, "bjs_Calculator_deinit") @_cdecl("bjs_Calculator_deinit") -public func _bjs_Calculator_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Calculator_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Calculator: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -3873,17 +4038,21 @@ extension Calculator: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_Calculator_wrap") -fileprivate func _bjs_Calculator_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Calculator_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Calculator_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Calculator_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_InternalGreeter_deinit") @_cdecl("bjs_InternalGreeter_deinit") -public func _bjs_InternalGreeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_InternalGreeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension InternalGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -3894,17 +4063,21 @@ extension InternalGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_InternalGreeter_wrap") -fileprivate func _bjs_InternalGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_InternalGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_InternalGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_InternalGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_PublicGreeter_deinit") @_cdecl("bjs_PublicGreeter_deinit") -public func _bjs_PublicGreeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PublicGreeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PublicGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -3915,17 +4088,21 @@ extension PublicGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_PublicGreeter_wrap") -fileprivate func _bjs_PublicGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PublicGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PublicGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PublicGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_PackageGreeter_deinit") @_cdecl("bjs_PackageGreeter_deinit") -public func _bjs_PackageGreeter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PackageGreeter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PackageGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -3936,9 +4113,9 @@ extension PackageGreeter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_PackageGreeter_wrap") -fileprivate func _bjs_PackageGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PackageGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PackageGreeter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PackageGreeter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -3956,7 +4133,7 @@ public func _bjs_Converter_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Converter_toString") @_cdecl("bjs_Converter_toString") -public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_Converter_toString(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) let ret = Utils.Converter.bridgeJSLiftParameter(_self).toString(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -3967,8 +4144,12 @@ public func _bjs_Converter_toString(_self: UnsafeMutableRawPointer, value: Int32 @_expose(wasm, "bjs_Converter_deinit") @_cdecl("bjs_Converter_deinit") -public func _bjs_Converter_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Converter_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Utils.Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -3979,9 +4160,9 @@ extension Utils.Converter: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_Converter_wrap") -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Converter_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Converter_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -3999,7 +4180,7 @@ public func _bjs_HTTPServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_HTTPServer_call") @_cdecl("bjs_HTTPServer_call") -public func _bjs_HTTPServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_HTTPServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) Networking.API.HTTPServer.bridgeJSLiftParameter(_self).call(_: Networking.API.Method.bridgeJSLiftParameter(method)) #else @@ -4009,8 +4190,12 @@ public func _bjs_HTTPServer_call(_self: UnsafeMutableRawPointer, method: Int32) @_expose(wasm, "bjs_HTTPServer_deinit") @_cdecl("bjs_HTTPServer_deinit") -public func _bjs_HTTPServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_HTTPServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Networking.API.HTTPServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4021,9 +4206,9 @@ extension Networking.API.HTTPServer: ConvertibleToJSValue, _BridgedSwiftHeapObje #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_HTTPServer_wrap") -fileprivate func _bjs_HTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_HTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_HTTPServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_HTTPServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -4041,7 +4226,7 @@ public func _bjs_TestServer_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_TestServer_call") @_cdecl("bjs_TestServer_call") -public func _bjs_TestServer_call(_self: UnsafeMutableRawPointer, method: Int32) -> Void { +public func _bjs_TestServer_call(_ _self: UnsafeMutableRawPointer, _ method: Int32) -> Void { #if arch(wasm32) Internal.TestServer.bridgeJSLiftParameter(_self).call(_: Internal.SupportedMethod.bridgeJSLiftParameter(method)) #else @@ -4051,8 +4236,12 @@ public func _bjs_TestServer_call(_self: UnsafeMutableRawPointer, method: Int32) @_expose(wasm, "bjs_TestServer_deinit") @_cdecl("bjs_TestServer_deinit") -public func _bjs_TestServer_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_TestServer_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Internal.TestServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4063,16 +4252,16 @@ extension Internal.TestServer: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_TestServer_wrap") -fileprivate func _bjs_TestServer_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_TestServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_TestServer_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_TestServer_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_OptionalPropertyHolder_init") @_cdecl("bjs_OptionalPropertyHolder_init") -public func _bjs_OptionalPropertyHolder_init(optionalNameIsSome: Int32, optionalNameBytes: Int32, optionalNameLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_OptionalPropertyHolder_init(_ optionalNameIsSome: Int32, _ optionalNameBytes: Int32, _ optionalNameLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = OptionalPropertyHolder(optionalName: Optional.bridgeJSLiftParameter(optionalNameIsSome, optionalNameBytes, optionalNameLength)) return ret.bridgeJSLowerReturn() @@ -4083,7 +4272,7 @@ public func _bjs_OptionalPropertyHolder_init(optionalNameIsSome: Int32, optional @_expose(wasm, "bjs_OptionalPropertyHolder_optionalName_get") @_cdecl("bjs_OptionalPropertyHolder_optionalName_get") -public func _bjs_OptionalPropertyHolder_optionalName_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalName_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalName return ret.bridgeJSLowerReturn() @@ -4094,7 +4283,7 @@ public func _bjs_OptionalPropertyHolder_optionalName_get(_self: UnsafeMutableRaw @_expose(wasm, "bjs_OptionalPropertyHolder_optionalName_set") @_cdecl("bjs_OptionalPropertyHolder_optionalName_set") -public func _bjs_OptionalPropertyHolder_optionalName_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_OptionalPropertyHolder_optionalName_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalName = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -4104,7 +4293,7 @@ public func _bjs_OptionalPropertyHolder_optionalName_set(_self: UnsafeMutableRaw @_expose(wasm, "bjs_OptionalPropertyHolder_optionalAge_get") @_cdecl("bjs_OptionalPropertyHolder_optionalAge_get") -public func _bjs_OptionalPropertyHolder_optionalAge_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalAge_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalAge return ret.bridgeJSLowerReturn() @@ -4115,7 +4304,7 @@ public func _bjs_OptionalPropertyHolder_optionalAge_get(_self: UnsafeMutableRawP @_expose(wasm, "bjs_OptionalPropertyHolder_optionalAge_set") @_cdecl("bjs_OptionalPropertyHolder_optionalAge_set") -public func _bjs_OptionalPropertyHolder_optionalAge_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_OptionalPropertyHolder_optionalAge_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalAge = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -4125,7 +4314,7 @@ public func _bjs_OptionalPropertyHolder_optionalAge_set(_self: UnsafeMutableRawP @_expose(wasm, "bjs_OptionalPropertyHolder_optionalGreeter_get") @_cdecl("bjs_OptionalPropertyHolder_optionalGreeter_get") -public func _bjs_OptionalPropertyHolder_optionalGreeter_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalGreeter_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalGreeter return ret.bridgeJSLowerReturn() @@ -4136,7 +4325,7 @@ public func _bjs_OptionalPropertyHolder_optionalGreeter_get(_self: UnsafeMutable @_expose(wasm, "bjs_OptionalPropertyHolder_optionalGreeter_set") @_cdecl("bjs_OptionalPropertyHolder_optionalGreeter_set") -public func _bjs_OptionalPropertyHolder_optionalGreeter_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_OptionalPropertyHolder_optionalGreeter_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) OptionalPropertyHolder.bridgeJSLiftParameter(_self).optionalGreeter = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -4146,8 +4335,12 @@ public func _bjs_OptionalPropertyHolder_optionalGreeter_set(_self: UnsafeMutable @_expose(wasm, "bjs_OptionalPropertyHolder_deinit") @_cdecl("bjs_OptionalPropertyHolder_deinit") -public func _bjs_OptionalPropertyHolder_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_OptionalPropertyHolder_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension OptionalPropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4158,16 +4351,16 @@ extension OptionalPropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_OptionalPropertyHolder_wrap") -fileprivate func _bjs_OptionalPropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_OptionalPropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_OptionalPropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_OptionalPropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_SimplePropertyHolder_init") @_cdecl("bjs_SimplePropertyHolder_init") -public func _bjs_SimplePropertyHolder_init(value: Int32) -> UnsafeMutableRawPointer { +public func _bjs_SimplePropertyHolder_init(_ value: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = SimplePropertyHolder(value: Int.bridgeJSLiftParameter(value)) return ret.bridgeJSLowerReturn() @@ -4178,7 +4371,7 @@ public func _bjs_SimplePropertyHolder_init(value: Int32) -> UnsafeMutableRawPoin @_expose(wasm, "bjs_SimplePropertyHolder_value_get") @_cdecl("bjs_SimplePropertyHolder_value_get") -public func _bjs_SimplePropertyHolder_value_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_SimplePropertyHolder_value_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = SimplePropertyHolder.bridgeJSLiftParameter(_self).value return ret.bridgeJSLowerReturn() @@ -4189,7 +4382,7 @@ public func _bjs_SimplePropertyHolder_value_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_SimplePropertyHolder_value_set") @_cdecl("bjs_SimplePropertyHolder_value_set") -public func _bjs_SimplePropertyHolder_value_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_SimplePropertyHolder_value_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) SimplePropertyHolder.bridgeJSLiftParameter(_self).value = Int.bridgeJSLiftParameter(value) #else @@ -4199,8 +4392,12 @@ public func _bjs_SimplePropertyHolder_value_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_SimplePropertyHolder_deinit") @_cdecl("bjs_SimplePropertyHolder_deinit") -public func _bjs_SimplePropertyHolder_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_SimplePropertyHolder_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension SimplePropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4211,16 +4408,16 @@ extension SimplePropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_SimplePropertyHolder_wrap") -fileprivate func _bjs_SimplePropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_SimplePropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_SimplePropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_SimplePropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_PropertyHolder_init") @_cdecl("bjs_PropertyHolder_init") -public func _bjs_PropertyHolder_init(intValue: Int32, floatValue: Float32, doubleValue: Float64, boolValue: Int32, stringValueBytes: Int32, stringValueLength: Int32, jsObject: Int32, sibling: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_PropertyHolder_init(_ intValue: Int32, _ floatValue: Float32, _ doubleValue: Float64, _ boolValue: Int32, _ stringValueBytes: Int32, _ stringValueLength: Int32, _ jsObject: Int32, _ sibling: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = PropertyHolder(intValue: Int.bridgeJSLiftParameter(intValue), floatValue: Float.bridgeJSLiftParameter(floatValue), doubleValue: Double.bridgeJSLiftParameter(doubleValue), boolValue: Bool.bridgeJSLiftParameter(boolValue), stringValue: String.bridgeJSLiftParameter(stringValueBytes, stringValueLength), jsObject: JSObject.bridgeJSLiftParameter(jsObject), sibling: SimplePropertyHolder.bridgeJSLiftParameter(sibling)) return ret.bridgeJSLowerReturn() @@ -4231,7 +4428,7 @@ public func _bjs_PropertyHolder_init(intValue: Int32, floatValue: Float32, doubl @_expose(wasm, "bjs_PropertyHolder_getAllValues") @_cdecl("bjs_PropertyHolder_getAllValues") -public func _bjs_PropertyHolder_getAllValues(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_getAllValues(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).getAllValues() return ret.bridgeJSLowerReturn() @@ -4242,7 +4439,7 @@ public func _bjs_PropertyHolder_getAllValues(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_intValue_get") @_cdecl("bjs_PropertyHolder_intValue_get") -public func _bjs_PropertyHolder_intValue_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_intValue_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).intValue return ret.bridgeJSLowerReturn() @@ -4253,7 +4450,7 @@ public func _bjs_PropertyHolder_intValue_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_intValue_set") @_cdecl("bjs_PropertyHolder_intValue_set") -public func _bjs_PropertyHolder_intValue_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_intValue_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).intValue = Int.bridgeJSLiftParameter(value) #else @@ -4263,7 +4460,7 @@ public func _bjs_PropertyHolder_intValue_set(_self: UnsafeMutableRawPointer, val @_expose(wasm, "bjs_PropertyHolder_floatValue_get") @_cdecl("bjs_PropertyHolder_floatValue_get") -public func _bjs_PropertyHolder_floatValue_get(_self: UnsafeMutableRawPointer) -> Float32 { +public func _bjs_PropertyHolder_floatValue_get(_ _self: UnsafeMutableRawPointer) -> Float32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).floatValue return ret.bridgeJSLowerReturn() @@ -4274,7 +4471,7 @@ public func _bjs_PropertyHolder_floatValue_get(_self: UnsafeMutableRawPointer) - @_expose(wasm, "bjs_PropertyHolder_floatValue_set") @_cdecl("bjs_PropertyHolder_floatValue_set") -public func _bjs_PropertyHolder_floatValue_set(_self: UnsafeMutableRawPointer, value: Float32) -> Void { +public func _bjs_PropertyHolder_floatValue_set(_ _self: UnsafeMutableRawPointer, _ value: Float32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).floatValue = Float.bridgeJSLiftParameter(value) #else @@ -4284,7 +4481,7 @@ public func _bjs_PropertyHolder_floatValue_set(_self: UnsafeMutableRawPointer, v @_expose(wasm, "bjs_PropertyHolder_doubleValue_get") @_cdecl("bjs_PropertyHolder_doubleValue_get") -public func _bjs_PropertyHolder_doubleValue_get(_self: UnsafeMutableRawPointer) -> Float64 { +public func _bjs_PropertyHolder_doubleValue_get(_ _self: UnsafeMutableRawPointer) -> Float64 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).doubleValue return ret.bridgeJSLowerReturn() @@ -4295,7 +4492,7 @@ public func _bjs_PropertyHolder_doubleValue_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_doubleValue_set") @_cdecl("bjs_PropertyHolder_doubleValue_set") -public func _bjs_PropertyHolder_doubleValue_set(_self: UnsafeMutableRawPointer, value: Float64) -> Void { +public func _bjs_PropertyHolder_doubleValue_set(_ _self: UnsafeMutableRawPointer, _ value: Float64) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).doubleValue = Double.bridgeJSLiftParameter(value) #else @@ -4305,7 +4502,7 @@ public func _bjs_PropertyHolder_doubleValue_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_PropertyHolder_boolValue_get") @_cdecl("bjs_PropertyHolder_boolValue_get") -public func _bjs_PropertyHolder_boolValue_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_boolValue_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).boolValue return ret.bridgeJSLowerReturn() @@ -4316,7 +4513,7 @@ public func _bjs_PropertyHolder_boolValue_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_boolValue_set") @_cdecl("bjs_PropertyHolder_boolValue_set") -public func _bjs_PropertyHolder_boolValue_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_boolValue_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).boolValue = Bool.bridgeJSLiftParameter(value) #else @@ -4326,7 +4523,7 @@ public func _bjs_PropertyHolder_boolValue_set(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_PropertyHolder_stringValue_get") @_cdecl("bjs_PropertyHolder_stringValue_get") -public func _bjs_PropertyHolder_stringValue_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_stringValue_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).stringValue return ret.bridgeJSLowerReturn() @@ -4337,7 +4534,7 @@ public func _bjs_PropertyHolder_stringValue_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_stringValue_set") @_cdecl("bjs_PropertyHolder_stringValue_set") -public func _bjs_PropertyHolder_stringValue_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyHolder_stringValue_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).stringValue = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -4347,7 +4544,7 @@ public func _bjs_PropertyHolder_stringValue_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_PropertyHolder_readonlyInt_get") @_cdecl("bjs_PropertyHolder_readonlyInt_get") -public func _bjs_PropertyHolder_readonlyInt_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_readonlyInt_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyInt return ret.bridgeJSLowerReturn() @@ -4358,7 +4555,7 @@ public func _bjs_PropertyHolder_readonlyInt_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_readonlyFloat_get") @_cdecl("bjs_PropertyHolder_readonlyFloat_get") -public func _bjs_PropertyHolder_readonlyFloat_get(_self: UnsafeMutableRawPointer) -> Float32 { +public func _bjs_PropertyHolder_readonlyFloat_get(_ _self: UnsafeMutableRawPointer) -> Float32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyFloat return ret.bridgeJSLowerReturn() @@ -4369,7 +4566,7 @@ public func _bjs_PropertyHolder_readonlyFloat_get(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_PropertyHolder_readonlyDouble_get") @_cdecl("bjs_PropertyHolder_readonlyDouble_get") -public func _bjs_PropertyHolder_readonlyDouble_get(_self: UnsafeMutableRawPointer) -> Float64 { +public func _bjs_PropertyHolder_readonlyDouble_get(_ _self: UnsafeMutableRawPointer) -> Float64 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyDouble return ret.bridgeJSLowerReturn() @@ -4380,7 +4577,7 @@ public func _bjs_PropertyHolder_readonlyDouble_get(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_PropertyHolder_readonlyBool_get") @_cdecl("bjs_PropertyHolder_readonlyBool_get") -public func _bjs_PropertyHolder_readonlyBool_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_readonlyBool_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyBool return ret.bridgeJSLowerReturn() @@ -4391,7 +4588,7 @@ public func _bjs_PropertyHolder_readonlyBool_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_PropertyHolder_readonlyString_get") @_cdecl("bjs_PropertyHolder_readonlyString_get") -public func _bjs_PropertyHolder_readonlyString_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_readonlyString_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).readonlyString return ret.bridgeJSLowerReturn() @@ -4402,7 +4599,7 @@ public func _bjs_PropertyHolder_readonlyString_get(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_PropertyHolder_jsObject_get") @_cdecl("bjs_PropertyHolder_jsObject_get") -public func _bjs_PropertyHolder_jsObject_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_jsObject_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).jsObject return ret.bridgeJSLowerReturn() @@ -4413,7 +4610,7 @@ public func _bjs_PropertyHolder_jsObject_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_jsObject_set") @_cdecl("bjs_PropertyHolder_jsObject_set") -public func _bjs_PropertyHolder_jsObject_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_jsObject_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).jsObject = JSObject.bridgeJSLiftParameter(value) #else @@ -4423,7 +4620,7 @@ public func _bjs_PropertyHolder_jsObject_set(_self: UnsafeMutableRawPointer, val @_expose(wasm, "bjs_PropertyHolder_sibling_get") @_cdecl("bjs_PropertyHolder_sibling_get") -public func _bjs_PropertyHolder_sibling_get(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_PropertyHolder_sibling_get(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).sibling return ret.bridgeJSLowerReturn() @@ -4434,7 +4631,7 @@ public func _bjs_PropertyHolder_sibling_get(_self: UnsafeMutableRawPointer) -> U @_expose(wasm, "bjs_PropertyHolder_sibling_set") @_cdecl("bjs_PropertyHolder_sibling_set") -public func _bjs_PropertyHolder_sibling_set(_self: UnsafeMutableRawPointer, value: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_sibling_set(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).sibling = SimplePropertyHolder.bridgeJSLiftParameter(value) #else @@ -4444,7 +4641,7 @@ public func _bjs_PropertyHolder_sibling_set(_self: UnsafeMutableRawPointer, valu @_expose(wasm, "bjs_PropertyHolder_lazyValue_get") @_cdecl("bjs_PropertyHolder_lazyValue_get") -public func _bjs_PropertyHolder_lazyValue_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_lazyValue_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).lazyValue return ret.bridgeJSLowerReturn() @@ -4455,7 +4652,7 @@ public func _bjs_PropertyHolder_lazyValue_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_PropertyHolder_lazyValue_set") @_cdecl("bjs_PropertyHolder_lazyValue_set") -public func _bjs_PropertyHolder_lazyValue_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyHolder_lazyValue_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).lazyValue = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -4465,7 +4662,7 @@ public func _bjs_PropertyHolder_lazyValue_set(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_PropertyHolder_computedReadonly_get") @_cdecl("bjs_PropertyHolder_computedReadonly_get") -public func _bjs_PropertyHolder_computedReadonly_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_computedReadonly_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).computedReadonly return ret.bridgeJSLowerReturn() @@ -4476,7 +4673,7 @@ public func _bjs_PropertyHolder_computedReadonly_get(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_PropertyHolder_computedReadWrite_get") @_cdecl("bjs_PropertyHolder_computedReadWrite_get") -public func _bjs_PropertyHolder_computedReadWrite_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_PropertyHolder_computedReadWrite_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).computedReadWrite return ret.bridgeJSLowerReturn() @@ -4487,7 +4684,7 @@ public func _bjs_PropertyHolder_computedReadWrite_get(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_PropertyHolder_computedReadWrite_set") @_cdecl("bjs_PropertyHolder_computedReadWrite_set") -public func _bjs_PropertyHolder_computedReadWrite_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_PropertyHolder_computedReadWrite_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).computedReadWrite = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -4497,7 +4694,7 @@ public func _bjs_PropertyHolder_computedReadWrite_set(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_PropertyHolder_observedProperty_get") @_cdecl("bjs_PropertyHolder_observedProperty_get") -public func _bjs_PropertyHolder_observedProperty_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_PropertyHolder_observedProperty_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = PropertyHolder.bridgeJSLiftParameter(_self).observedProperty return ret.bridgeJSLowerReturn() @@ -4508,7 +4705,7 @@ public func _bjs_PropertyHolder_observedProperty_get(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_PropertyHolder_observedProperty_set") @_cdecl("bjs_PropertyHolder_observedProperty_set") -public func _bjs_PropertyHolder_observedProperty_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_PropertyHolder_observedProperty_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) PropertyHolder.bridgeJSLiftParameter(_self).observedProperty = Int.bridgeJSLiftParameter(value) #else @@ -4518,8 +4715,12 @@ public func _bjs_PropertyHolder_observedProperty_set(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_PropertyHolder_deinit") @_cdecl("bjs_PropertyHolder_deinit") -public func _bjs_PropertyHolder_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_PropertyHolder_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension PropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4530,16 +4731,16 @@ extension PropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_PropertyHolder_wrap") -fileprivate func _bjs_PropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_PropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_PropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_PropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_MathUtils_static_add") @_cdecl("bjs_MathUtils_static_add") -public func _bjs_MathUtils_static_add(a: Int32, b: Int32) -> Int32 { +public func _bjs_MathUtils_static_add(_ a: Int32, _ b: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.add(a: Int.bridgeJSLiftParameter(a), b: Int.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -4550,7 +4751,7 @@ public func _bjs_MathUtils_static_add(a: Int32, b: Int32) -> Int32 { @_expose(wasm, "bjs_MathUtils_static_substract") @_cdecl("bjs_MathUtils_static_substract") -public func _bjs_MathUtils_static_substract(a: Int32, b: Int32) -> Int32 { +public func _bjs_MathUtils_static_substract(_ a: Int32, _ b: Int32) -> Int32 { #if arch(wasm32) let ret = MathUtils.substract(a: Int.bridgeJSLiftParameter(a), b: Int.bridgeJSLiftParameter(b)) return ret.bridgeJSLowerReturn() @@ -4561,8 +4762,12 @@ public func _bjs_MathUtils_static_substract(a: Int32, b: Int32) -> Int32 { @_expose(wasm, "bjs_MathUtils_deinit") @_cdecl("bjs_MathUtils_deinit") -public func _bjs_MathUtils_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_MathUtils_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension MathUtils: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4573,16 +4778,16 @@ extension MathUtils: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_MathUtils_wrap") -fileprivate func _bjs_MathUtils_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_MathUtils_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_MathUtils_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_MathUtils_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_ConstructorDefaults_init") @_cdecl("bjs_ConstructorDefaults_init") -public func _bjs_ConstructorDefaults_init(nameBytes: Int32, nameLength: Int32, count: Int32, enabled: Int32, status: Int32, tagIsSome: Int32, tagBytes: Int32, tagLength: Int32) -> UnsafeMutableRawPointer { +public func _bjs_ConstructorDefaults_init(_ nameBytes: Int32, _ nameLength: Int32, _ count: Int32, _ enabled: Int32, _ status: Int32, _ tagIsSome: Int32, _ tagBytes: Int32, _ tagLength: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = ConstructorDefaults(name: String.bridgeJSLiftParameter(nameBytes, nameLength), count: Int.bridgeJSLiftParameter(count), enabled: Bool.bridgeJSLiftParameter(enabled), status: Status.bridgeJSLiftParameter(status), tag: Optional.bridgeJSLiftParameter(tagIsSome, tagBytes, tagLength)) return ret.bridgeJSLowerReturn() @@ -4593,7 +4798,7 @@ public func _bjs_ConstructorDefaults_init(nameBytes: Int32, nameLength: Int32, c @_expose(wasm, "bjs_ConstructorDefaults_describe") @_cdecl("bjs_ConstructorDefaults_describe") -public func _bjs_ConstructorDefaults_describe(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ConstructorDefaults_describe(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).describe() return ret.bridgeJSLowerReturn() @@ -4604,7 +4809,7 @@ public func _bjs_ConstructorDefaults_describe(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_ConstructorDefaults_name_get") @_cdecl("bjs_ConstructorDefaults_name_get") -public func _bjs_ConstructorDefaults_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ConstructorDefaults_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -4615,7 +4820,7 @@ public func _bjs_ConstructorDefaults_name_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_ConstructorDefaults_name_set") @_cdecl("bjs_ConstructorDefaults_name_set") -public func _bjs_ConstructorDefaults_name_set(_self: UnsafeMutableRawPointer, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_ConstructorDefaults_name_set(_ _self: UnsafeMutableRawPointer, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).name = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -4625,7 +4830,7 @@ public func _bjs_ConstructorDefaults_name_set(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_ConstructorDefaults_count_get") @_cdecl("bjs_ConstructorDefaults_count_get") -public func _bjs_ConstructorDefaults_count_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_ConstructorDefaults_count_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).count return ret.bridgeJSLowerReturn() @@ -4636,7 +4841,7 @@ public func _bjs_ConstructorDefaults_count_get(_self: UnsafeMutableRawPointer) - @_expose(wasm, "bjs_ConstructorDefaults_count_set") @_cdecl("bjs_ConstructorDefaults_count_set") -public func _bjs_ConstructorDefaults_count_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_ConstructorDefaults_count_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).count = Int.bridgeJSLiftParameter(value) #else @@ -4646,7 +4851,7 @@ public func _bjs_ConstructorDefaults_count_set(_self: UnsafeMutableRawPointer, v @_expose(wasm, "bjs_ConstructorDefaults_enabled_get") @_cdecl("bjs_ConstructorDefaults_enabled_get") -public func _bjs_ConstructorDefaults_enabled_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_ConstructorDefaults_enabled_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).enabled return ret.bridgeJSLowerReturn() @@ -4657,7 +4862,7 @@ public func _bjs_ConstructorDefaults_enabled_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_ConstructorDefaults_enabled_set") @_cdecl("bjs_ConstructorDefaults_enabled_set") -public func _bjs_ConstructorDefaults_enabled_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_ConstructorDefaults_enabled_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).enabled = Bool.bridgeJSLiftParameter(value) #else @@ -4667,7 +4872,7 @@ public func _bjs_ConstructorDefaults_enabled_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_ConstructorDefaults_status_get") @_cdecl("bjs_ConstructorDefaults_status_get") -public func _bjs_ConstructorDefaults_status_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_ConstructorDefaults_status_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).status return ret.bridgeJSLowerReturn() @@ -4678,7 +4883,7 @@ public func _bjs_ConstructorDefaults_status_get(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_ConstructorDefaults_status_set") @_cdecl("bjs_ConstructorDefaults_status_set") -public func _bjs_ConstructorDefaults_status_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_ConstructorDefaults_status_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).status = Status.bridgeJSLiftParameter(value) #else @@ -4688,7 +4893,7 @@ public func _bjs_ConstructorDefaults_status_set(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_ConstructorDefaults_tag_get") @_cdecl("bjs_ConstructorDefaults_tag_get") -public func _bjs_ConstructorDefaults_tag_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_ConstructorDefaults_tag_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ConstructorDefaults.bridgeJSLiftParameter(_self).tag return ret.bridgeJSLowerReturn() @@ -4699,7 +4904,7 @@ public func _bjs_ConstructorDefaults_tag_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_ConstructorDefaults_tag_set") @_cdecl("bjs_ConstructorDefaults_tag_set") -public func _bjs_ConstructorDefaults_tag_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_ConstructorDefaults_tag_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) ConstructorDefaults.bridgeJSLiftParameter(_self).tag = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -4709,8 +4914,12 @@ public func _bjs_ConstructorDefaults_tag_set(_self: UnsafeMutableRawPointer, val @_expose(wasm, "bjs_ConstructorDefaults_deinit") @_cdecl("bjs_ConstructorDefaults_deinit") -public func _bjs_ConstructorDefaults_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_ConstructorDefaults_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension ConstructorDefaults: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4721,9 +4930,9 @@ extension ConstructorDefaults: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_ConstructorDefaults_wrap") -fileprivate func _bjs_ConstructorDefaults_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_ConstructorDefaults_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_ConstructorDefaults_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_ConstructorDefaults_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -4763,7 +4972,7 @@ public func _bjs_StaticPropertyHolder_static_staticVariable_get() -> Int32 { @_expose(wasm, "bjs_StaticPropertyHolder_static_staticVariable_set") @_cdecl("bjs_StaticPropertyHolder_static_staticVariable_set") -public func _bjs_StaticPropertyHolder_static_staticVariable_set(value: Int32) -> Void { +public func _bjs_StaticPropertyHolder_static_staticVariable_set(_ value: Int32) -> Void { #if arch(wasm32) StaticPropertyHolder.staticVariable = Int.bridgeJSLiftParameter(value) #else @@ -4784,7 +4993,7 @@ public func _bjs_StaticPropertyHolder_static_staticString_get() -> Void { @_expose(wasm, "bjs_StaticPropertyHolder_static_staticString_set") @_cdecl("bjs_StaticPropertyHolder_static_staticString_set") -public func _bjs_StaticPropertyHolder_static_staticString_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StaticPropertyHolder_static_staticString_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) StaticPropertyHolder.staticString = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -4805,7 +5014,7 @@ public func _bjs_StaticPropertyHolder_static_staticBool_get() -> Int32 { @_expose(wasm, "bjs_StaticPropertyHolder_static_staticBool_set") @_cdecl("bjs_StaticPropertyHolder_static_staticBool_set") -public func _bjs_StaticPropertyHolder_static_staticBool_set(value: Int32) -> Void { +public func _bjs_StaticPropertyHolder_static_staticBool_set(_ value: Int32) -> Void { #if arch(wasm32) StaticPropertyHolder.staticBool = Bool.bridgeJSLiftParameter(value) #else @@ -4826,7 +5035,7 @@ public func _bjs_StaticPropertyHolder_static_staticFloat_get() -> Float32 { @_expose(wasm, "bjs_StaticPropertyHolder_static_staticFloat_set") @_cdecl("bjs_StaticPropertyHolder_static_staticFloat_set") -public func _bjs_StaticPropertyHolder_static_staticFloat_set(value: Float32) -> Void { +public func _bjs_StaticPropertyHolder_static_staticFloat_set(_ value: Float32) -> Void { #if arch(wasm32) StaticPropertyHolder.staticFloat = Float.bridgeJSLiftParameter(value) #else @@ -4847,7 +5056,7 @@ public func _bjs_StaticPropertyHolder_static_staticDouble_get() -> Float64 { @_expose(wasm, "bjs_StaticPropertyHolder_static_staticDouble_set") @_cdecl("bjs_StaticPropertyHolder_static_staticDouble_set") -public func _bjs_StaticPropertyHolder_static_staticDouble_set(value: Float64) -> Void { +public func _bjs_StaticPropertyHolder_static_staticDouble_set(_ value: Float64) -> Void { #if arch(wasm32) StaticPropertyHolder.staticDouble = Double.bridgeJSLiftParameter(value) #else @@ -4868,7 +5077,7 @@ public func _bjs_StaticPropertyHolder_static_computedProperty_get() -> Void { @_expose(wasm, "bjs_StaticPropertyHolder_static_computedProperty_set") @_cdecl("bjs_StaticPropertyHolder_static_computedProperty_set") -public func _bjs_StaticPropertyHolder_static_computedProperty_set(valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StaticPropertyHolder_static_computedProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) StaticPropertyHolder.computedProperty = String.bridgeJSLiftParameter(valueBytes, valueLength) #else @@ -4900,7 +5109,7 @@ public func _bjs_StaticPropertyHolder_static_optionalString_get() -> Void { @_expose(wasm, "bjs_StaticPropertyHolder_static_optionalString_set") @_cdecl("bjs_StaticPropertyHolder_static_optionalString_set") -public func _bjs_StaticPropertyHolder_static_optionalString_set(valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_StaticPropertyHolder_static_optionalString_set(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) StaticPropertyHolder.optionalString = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -4921,7 +5130,7 @@ public func _bjs_StaticPropertyHolder_static_optionalInt_get() -> Void { @_expose(wasm, "bjs_StaticPropertyHolder_static_optionalInt_set") @_cdecl("bjs_StaticPropertyHolder_static_optionalInt_set") -public func _bjs_StaticPropertyHolder_static_optionalInt_set(valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_StaticPropertyHolder_static_optionalInt_set(_ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) StaticPropertyHolder.optionalInt = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -4942,7 +5151,7 @@ public func _bjs_StaticPropertyHolder_static_jsObjectProperty_get() -> Int32 { @_expose(wasm, "bjs_StaticPropertyHolder_static_jsObjectProperty_set") @_cdecl("bjs_StaticPropertyHolder_static_jsObjectProperty_set") -public func _bjs_StaticPropertyHolder_static_jsObjectProperty_set(value: Int32) -> Void { +public func _bjs_StaticPropertyHolder_static_jsObjectProperty_set(_ value: Int32) -> Void { #if arch(wasm32) StaticPropertyHolder.jsObjectProperty = JSObject.bridgeJSLiftParameter(value) #else @@ -4952,8 +5161,12 @@ public func _bjs_StaticPropertyHolder_static_jsObjectProperty_set(value: Int32) @_expose(wasm, "bjs_StaticPropertyHolder_deinit") @_cdecl("bjs_StaticPropertyHolder_deinit") -public func _bjs_StaticPropertyHolder_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_StaticPropertyHolder_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension StaticPropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -4964,16 +5177,16 @@ extension StaticPropertyHolder: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_StaticPropertyHolder_wrap") -fileprivate func _bjs_StaticPropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_StaticPropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_StaticPropertyHolder_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_StaticPropertyHolder_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_DataProcessorManager_init") @_cdecl("bjs_DataProcessorManager_init") -public func _bjs_DataProcessorManager_init(processor: Int32) -> UnsafeMutableRawPointer { +public func _bjs_DataProcessorManager_init(_ processor: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = DataProcessorManager(processor: AnyDataProcessor.bridgeJSLiftParameter(processor)) return ret.bridgeJSLowerReturn() @@ -4984,7 +5197,7 @@ public func _bjs_DataProcessorManager_init(processor: Int32) -> UnsafeMutableRaw @_expose(wasm, "bjs_DataProcessorManager_incrementByAmount") @_cdecl("bjs_DataProcessorManager_incrementByAmount") -public func _bjs_DataProcessorManager_incrementByAmount(_self: UnsafeMutableRawPointer, amount: Int32) -> Void { +public func _bjs_DataProcessorManager_incrementByAmount(_ _self: UnsafeMutableRawPointer, _ amount: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).incrementByAmount(_: Int.bridgeJSLiftParameter(amount)) #else @@ -4994,7 +5207,7 @@ public func _bjs_DataProcessorManager_incrementByAmount(_self: UnsafeMutableRawP @_expose(wasm, "bjs_DataProcessorManager_setProcessorLabel") @_cdecl("bjs_DataProcessorManager_setProcessorLabel") -public func _bjs_DataProcessorManager_setProcessorLabel(_self: UnsafeMutableRawPointer, prefixBytes: Int32, prefixLength: Int32, suffixBytes: Int32, suffixLength: Int32) -> Void { +public func _bjs_DataProcessorManager_setProcessorLabel(_ _self: UnsafeMutableRawPointer, _ prefixBytes: Int32, _ prefixLength: Int32, _ suffixBytes: Int32, _ suffixLength: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).setProcessorLabel(_: String.bridgeJSLiftParameter(prefixBytes, prefixLength), _: String.bridgeJSLiftParameter(suffixBytes, suffixLength)) #else @@ -5004,7 +5217,7 @@ public func _bjs_DataProcessorManager_setProcessorLabel(_self: UnsafeMutableRawP @_expose(wasm, "bjs_DataProcessorManager_isProcessorEven") @_cdecl("bjs_DataProcessorManager_isProcessorEven") -public func _bjs_DataProcessorManager_isProcessorEven(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_DataProcessorManager_isProcessorEven(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).isProcessorEven() return ret.bridgeJSLowerReturn() @@ -5015,7 +5228,7 @@ public func _bjs_DataProcessorManager_isProcessorEven(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_DataProcessorManager_getProcessorLabel") @_cdecl("bjs_DataProcessorManager_getProcessorLabel") -public func _bjs_DataProcessorManager_getProcessorLabel(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getProcessorLabel(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getProcessorLabel() return ret.bridgeJSLowerReturn() @@ -5026,7 +5239,7 @@ public func _bjs_DataProcessorManager_getProcessorLabel(_self: UnsafeMutableRawP @_expose(wasm, "bjs_DataProcessorManager_getCurrentValue") @_cdecl("bjs_DataProcessorManager_getCurrentValue") -public func _bjs_DataProcessorManager_getCurrentValue(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_DataProcessorManager_getCurrentValue(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getCurrentValue() return ret.bridgeJSLowerReturn() @@ -5037,7 +5250,7 @@ public func _bjs_DataProcessorManager_getCurrentValue(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_DataProcessorManager_incrementBoth") @_cdecl("bjs_DataProcessorManager_incrementBoth") -public func _bjs_DataProcessorManager_incrementBoth(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_incrementBoth(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).incrementBoth() #else @@ -5047,7 +5260,7 @@ public func _bjs_DataProcessorManager_incrementBoth(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_DataProcessorManager_getBackupValue") @_cdecl("bjs_DataProcessorManager_getBackupValue") -public func _bjs_DataProcessorManager_getBackupValue(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getBackupValue(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getBackupValue() return ret.bridgeJSLowerReturn() @@ -5058,7 +5271,7 @@ public func _bjs_DataProcessorManager_getBackupValue(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_DataProcessorManager_hasBackup") @_cdecl("bjs_DataProcessorManager_hasBackup") -public func _bjs_DataProcessorManager_hasBackup(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_DataProcessorManager_hasBackup(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).hasBackup() return ret.bridgeJSLowerReturn() @@ -5069,7 +5282,7 @@ public func _bjs_DataProcessorManager_hasBackup(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_DataProcessorManager_getProcessorOptionalTag") @_cdecl("bjs_DataProcessorManager_getProcessorOptionalTag") -public func _bjs_DataProcessorManager_getProcessorOptionalTag(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getProcessorOptionalTag(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getProcessorOptionalTag() return ret.bridgeJSLowerReturn() @@ -5080,7 +5293,7 @@ public func _bjs_DataProcessorManager_getProcessorOptionalTag(_self: UnsafeMutab @_expose(wasm, "bjs_DataProcessorManager_setProcessorOptionalTag") @_cdecl("bjs_DataProcessorManager_setProcessorOptionalTag") -public func _bjs_DataProcessorManager_setProcessorOptionalTag(_self: UnsafeMutableRawPointer, tagIsSome: Int32, tagBytes: Int32, tagLength: Int32) -> Void { +public func _bjs_DataProcessorManager_setProcessorOptionalTag(_ _self: UnsafeMutableRawPointer, _ tagIsSome: Int32, _ tagBytes: Int32, _ tagLength: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).setProcessorOptionalTag(_: Optional.bridgeJSLiftParameter(tagIsSome, tagBytes, tagLength)) #else @@ -5090,7 +5303,7 @@ public func _bjs_DataProcessorManager_setProcessorOptionalTag(_self: UnsafeMutab @_expose(wasm, "bjs_DataProcessorManager_getProcessorOptionalCount") @_cdecl("bjs_DataProcessorManager_getProcessorOptionalCount") -public func _bjs_DataProcessorManager_getProcessorOptionalCount(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getProcessorOptionalCount(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getProcessorOptionalCount() return ret.bridgeJSLowerReturn() @@ -5101,7 +5314,7 @@ public func _bjs_DataProcessorManager_getProcessorOptionalCount(_self: UnsafeMut @_expose(wasm, "bjs_DataProcessorManager_setProcessorOptionalCount") @_cdecl("bjs_DataProcessorManager_setProcessorOptionalCount") -public func _bjs_DataProcessorManager_setProcessorOptionalCount(_self: UnsafeMutableRawPointer, countIsSome: Int32, countValue: Int32) -> Void { +public func _bjs_DataProcessorManager_setProcessorOptionalCount(_ _self: UnsafeMutableRawPointer, _ countIsSome: Int32, _ countValue: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).setProcessorOptionalCount(_: Optional.bridgeJSLiftParameter(countIsSome, countValue)) #else @@ -5111,7 +5324,7 @@ public func _bjs_DataProcessorManager_setProcessorOptionalCount(_self: UnsafeMut @_expose(wasm, "bjs_DataProcessorManager_getProcessorDirection") @_cdecl("bjs_DataProcessorManager_getProcessorDirection") -public func _bjs_DataProcessorManager_getProcessorDirection(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getProcessorDirection(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getProcessorDirection() return ret.bridgeJSLowerReturn() @@ -5122,7 +5335,7 @@ public func _bjs_DataProcessorManager_getProcessorDirection(_self: UnsafeMutable @_expose(wasm, "bjs_DataProcessorManager_setProcessorDirection") @_cdecl("bjs_DataProcessorManager_setProcessorDirection") -public func _bjs_DataProcessorManager_setProcessorDirection(_self: UnsafeMutableRawPointer, directionIsSome: Int32, directionValue: Int32) -> Void { +public func _bjs_DataProcessorManager_setProcessorDirection(_ _self: UnsafeMutableRawPointer, _ directionIsSome: Int32, _ directionValue: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).setProcessorDirection(_: Optional.bridgeJSLiftParameter(directionIsSome, directionValue)) #else @@ -5132,7 +5345,7 @@ public func _bjs_DataProcessorManager_setProcessorDirection(_self: UnsafeMutable @_expose(wasm, "bjs_DataProcessorManager_getProcessorTheme") @_cdecl("bjs_DataProcessorManager_getProcessorTheme") -public func _bjs_DataProcessorManager_getProcessorTheme(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getProcessorTheme(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getProcessorTheme() return ret.bridgeJSLowerReturn() @@ -5143,7 +5356,7 @@ public func _bjs_DataProcessorManager_getProcessorTheme(_self: UnsafeMutableRawP @_expose(wasm, "bjs_DataProcessorManager_setProcessorTheme") @_cdecl("bjs_DataProcessorManager_setProcessorTheme") -public func _bjs_DataProcessorManager_setProcessorTheme(_self: UnsafeMutableRawPointer, themeIsSome: Int32, themeBytes: Int32, themeLength: Int32) -> Void { +public func _bjs_DataProcessorManager_setProcessorTheme(_ _self: UnsafeMutableRawPointer, _ themeIsSome: Int32, _ themeBytes: Int32, _ themeLength: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).setProcessorTheme(_: Optional.bridgeJSLiftParameter(themeIsSome, themeBytes, themeLength)) #else @@ -5153,7 +5366,7 @@ public func _bjs_DataProcessorManager_setProcessorTheme(_self: UnsafeMutableRawP @_expose(wasm, "bjs_DataProcessorManager_getProcessorHttpStatus") @_cdecl("bjs_DataProcessorManager_getProcessorHttpStatus") -public func _bjs_DataProcessorManager_getProcessorHttpStatus(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getProcessorHttpStatus(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getProcessorHttpStatus() return ret.bridgeJSLowerReturn() @@ -5164,7 +5377,7 @@ public func _bjs_DataProcessorManager_getProcessorHttpStatus(_self: UnsafeMutabl @_expose(wasm, "bjs_DataProcessorManager_setProcessorHttpStatus") @_cdecl("bjs_DataProcessorManager_setProcessorHttpStatus") -public func _bjs_DataProcessorManager_setProcessorHttpStatus(_self: UnsafeMutableRawPointer, statusIsSome: Int32, statusValue: Int32) -> Void { +public func _bjs_DataProcessorManager_setProcessorHttpStatus(_ _self: UnsafeMutableRawPointer, _ statusIsSome: Int32, _ statusValue: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).setProcessorHttpStatus(_: Optional.bridgeJSLiftParameter(statusIsSome, statusValue)) #else @@ -5174,7 +5387,7 @@ public func _bjs_DataProcessorManager_setProcessorHttpStatus(_self: UnsafeMutabl @_expose(wasm, "bjs_DataProcessorManager_getProcessorAPIResult") @_cdecl("bjs_DataProcessorManager_getProcessorAPIResult") -public func _bjs_DataProcessorManager_getProcessorAPIResult(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_getProcessorAPIResult(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).getProcessorAPIResult() return ret.bridgeJSLowerReturn() @@ -5185,7 +5398,7 @@ public func _bjs_DataProcessorManager_getProcessorAPIResult(_self: UnsafeMutable @_expose(wasm, "bjs_DataProcessorManager_setProcessorAPIResult") @_cdecl("bjs_DataProcessorManager_setProcessorAPIResult") -public func _bjs_DataProcessorManager_setProcessorAPIResult(_self: UnsafeMutableRawPointer, apiResultIsSome: Int32, apiResultCaseId: Int32) -> Void { +public func _bjs_DataProcessorManager_setProcessorAPIResult(_ _self: UnsafeMutableRawPointer, _ apiResultIsSome: Int32, _ apiResultCaseId: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).setProcessorAPIResult(_: Optional.bridgeJSLiftParameter(apiResultIsSome, apiResultCaseId)) #else @@ -5195,7 +5408,7 @@ public func _bjs_DataProcessorManager_setProcessorAPIResult(_self: UnsafeMutable @_expose(wasm, "bjs_DataProcessorManager_processor_get") @_cdecl("bjs_DataProcessorManager_processor_get") -public func _bjs_DataProcessorManager_processor_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_DataProcessorManager_processor_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).processor as! AnyDataProcessor return ret.bridgeJSLowerReturn() @@ -5206,7 +5419,7 @@ public func _bjs_DataProcessorManager_processor_get(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_DataProcessorManager_processor_set") @_cdecl("bjs_DataProcessorManager_processor_set") -public func _bjs_DataProcessorManager_processor_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_DataProcessorManager_processor_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).processor = AnyDataProcessor.bridgeJSLiftParameter(value) #else @@ -5216,7 +5429,7 @@ public func _bjs_DataProcessorManager_processor_set(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_DataProcessorManager_backupProcessor_get") @_cdecl("bjs_DataProcessorManager_backupProcessor_get") -public func _bjs_DataProcessorManager_backupProcessor_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_DataProcessorManager_backupProcessor_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = DataProcessorManager.bridgeJSLiftParameter(_self).backupProcessor.flatMap { $0 as? AnyDataProcessor @@ -5229,7 +5442,7 @@ public func _bjs_DataProcessorManager_backupProcessor_get(_self: UnsafeMutableRa @_expose(wasm, "bjs_DataProcessorManager_backupProcessor_set") @_cdecl("bjs_DataProcessorManager_backupProcessor_set") -public func _bjs_DataProcessorManager_backupProcessor_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_DataProcessorManager_backupProcessor_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) DataProcessorManager.bridgeJSLiftParameter(_self).backupProcessor = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -5239,8 +5452,12 @@ public func _bjs_DataProcessorManager_backupProcessor_set(_self: UnsafeMutableRa @_expose(wasm, "bjs_DataProcessorManager_deinit") @_cdecl("bjs_DataProcessorManager_deinit") -public func _bjs_DataProcessorManager_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_DataProcessorManager_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension DataProcessorManager: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -5251,9 +5468,9 @@ extension DataProcessorManager: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_DataProcessorManager_wrap") -fileprivate func _bjs_DataProcessorManager_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_DataProcessorManager_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_DataProcessorManager_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_DataProcessorManager_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @@ -5271,7 +5488,7 @@ public func _bjs_SwiftDataProcessor_init() -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_SwiftDataProcessor_increment") @_cdecl("bjs_SwiftDataProcessor_increment") -public func _bjs_SwiftDataProcessor_increment(_self: UnsafeMutableRawPointer, amount: Int32) -> Void { +public func _bjs_SwiftDataProcessor_increment(_ _self: UnsafeMutableRawPointer, _ amount: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).increment(by: Int.bridgeJSLiftParameter(amount)) #else @@ -5281,7 +5498,7 @@ public func _bjs_SwiftDataProcessor_increment(_self: UnsafeMutableRawPointer, am @_expose(wasm, "bjs_SwiftDataProcessor_getValue") @_cdecl("bjs_SwiftDataProcessor_getValue") -public func _bjs_SwiftDataProcessor_getValue(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_SwiftDataProcessor_getValue(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).getValue() return ret.bridgeJSLowerReturn() @@ -5292,7 +5509,7 @@ public func _bjs_SwiftDataProcessor_getValue(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_SwiftDataProcessor_setLabelElements") @_cdecl("bjs_SwiftDataProcessor_setLabelElements") -public func _bjs_SwiftDataProcessor_setLabelElements(_self: UnsafeMutableRawPointer, labelPrefixBytes: Int32, labelPrefixLength: Int32, labelSuffixBytes: Int32, labelSuffixLength: Int32) -> Void { +public func _bjs_SwiftDataProcessor_setLabelElements(_ _self: UnsafeMutableRawPointer, _ labelPrefixBytes: Int32, _ labelPrefixLength: Int32, _ labelSuffixBytes: Int32, _ labelSuffixLength: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).setLabelElements(_: String.bridgeJSLiftParameter(labelPrefixBytes, labelPrefixLength), _: String.bridgeJSLiftParameter(labelSuffixBytes, labelSuffixLength)) #else @@ -5302,7 +5519,7 @@ public func _bjs_SwiftDataProcessor_setLabelElements(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_SwiftDataProcessor_getLabel") @_cdecl("bjs_SwiftDataProcessor_getLabel") -public func _bjs_SwiftDataProcessor_getLabel(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_getLabel(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).getLabel() return ret.bridgeJSLowerReturn() @@ -5313,7 +5530,7 @@ public func _bjs_SwiftDataProcessor_getLabel(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_SwiftDataProcessor_isEven") @_cdecl("bjs_SwiftDataProcessor_isEven") -public func _bjs_SwiftDataProcessor_isEven(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_SwiftDataProcessor_isEven(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).isEven() return ret.bridgeJSLowerReturn() @@ -5324,7 +5541,7 @@ public func _bjs_SwiftDataProcessor_isEven(_self: UnsafeMutableRawPointer) -> In @_expose(wasm, "bjs_SwiftDataProcessor_processGreeter") @_cdecl("bjs_SwiftDataProcessor_processGreeter") -public func _bjs_SwiftDataProcessor_processGreeter(_self: UnsafeMutableRawPointer, greeter: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_processGreeter(_ _self: UnsafeMutableRawPointer, _ greeter: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).processGreeter(_: Greeter.bridgeJSLiftParameter(greeter)) return ret.bridgeJSLowerReturn() @@ -5335,7 +5552,7 @@ public func _bjs_SwiftDataProcessor_processGreeter(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_SwiftDataProcessor_createGreeter") @_cdecl("bjs_SwiftDataProcessor_createGreeter") -public func _bjs_SwiftDataProcessor_createGreeter(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_SwiftDataProcessor_createGreeter(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).createGreeter() return ret.bridgeJSLowerReturn() @@ -5346,7 +5563,7 @@ public func _bjs_SwiftDataProcessor_createGreeter(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_SwiftDataProcessor_processOptionalGreeter") @_cdecl("bjs_SwiftDataProcessor_processOptionalGreeter") -public func _bjs_SwiftDataProcessor_processOptionalGreeter(_self: UnsafeMutableRawPointer, greeterIsSome: Int32, greeterValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_processOptionalGreeter(_ _self: UnsafeMutableRawPointer, _ greeterIsSome: Int32, _ greeterValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).processOptionalGreeter(_: Optional.bridgeJSLiftParameter(greeterIsSome, greeterValue)) return ret.bridgeJSLowerReturn() @@ -5357,7 +5574,7 @@ public func _bjs_SwiftDataProcessor_processOptionalGreeter(_self: UnsafeMutableR @_expose(wasm, "bjs_SwiftDataProcessor_createOptionalGreeter") @_cdecl("bjs_SwiftDataProcessor_createOptionalGreeter") -public func _bjs_SwiftDataProcessor_createOptionalGreeter(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_createOptionalGreeter(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).createOptionalGreeter() return ret.bridgeJSLowerReturn() @@ -5368,7 +5585,7 @@ public func _bjs_SwiftDataProcessor_createOptionalGreeter(_self: UnsafeMutableRa @_expose(wasm, "bjs_SwiftDataProcessor_handleAPIResult") @_cdecl("bjs_SwiftDataProcessor_handleAPIResult") -public func _bjs_SwiftDataProcessor_handleAPIResult(_self: UnsafeMutableRawPointer, resultIsSome: Int32, resultCaseId: Int32) -> Void { +public func _bjs_SwiftDataProcessor_handleAPIResult(_ _self: UnsafeMutableRawPointer, _ resultIsSome: Int32, _ resultCaseId: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).handleAPIResult(_: Optional.bridgeJSLiftParameter(resultIsSome, resultCaseId)) #else @@ -5378,7 +5595,7 @@ public func _bjs_SwiftDataProcessor_handleAPIResult(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_SwiftDataProcessor_getAPIResult") @_cdecl("bjs_SwiftDataProcessor_getAPIResult") -public func _bjs_SwiftDataProcessor_getAPIResult(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_getAPIResult(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).getAPIResult() return ret.bridgeJSLowerReturn() @@ -5389,7 +5606,7 @@ public func _bjs_SwiftDataProcessor_getAPIResult(_self: UnsafeMutableRawPointer) @_expose(wasm, "bjs_SwiftDataProcessor_count_get") @_cdecl("bjs_SwiftDataProcessor_count_get") -public func _bjs_SwiftDataProcessor_count_get(_self: UnsafeMutableRawPointer) -> Int32 { +public func _bjs_SwiftDataProcessor_count_get(_ _self: UnsafeMutableRawPointer) -> Int32 { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).count return ret.bridgeJSLowerReturn() @@ -5400,7 +5617,7 @@ public func _bjs_SwiftDataProcessor_count_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_SwiftDataProcessor_count_set") @_cdecl("bjs_SwiftDataProcessor_count_set") -public func _bjs_SwiftDataProcessor_count_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_SwiftDataProcessor_count_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).count = Int.bridgeJSLiftParameter(value) #else @@ -5410,7 +5627,7 @@ public func _bjs_SwiftDataProcessor_count_set(_self: UnsafeMutableRawPointer, va @_expose(wasm, "bjs_SwiftDataProcessor_name_get") @_cdecl("bjs_SwiftDataProcessor_name_get") -public func _bjs_SwiftDataProcessor_name_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_name_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).name return ret.bridgeJSLowerReturn() @@ -5421,7 +5638,7 @@ public func _bjs_SwiftDataProcessor_name_get(_self: UnsafeMutableRawPointer) -> @_expose(wasm, "bjs_SwiftDataProcessor_optionalTag_get") @_cdecl("bjs_SwiftDataProcessor_optionalTag_get") -public func _bjs_SwiftDataProcessor_optionalTag_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_optionalTag_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalTag return ret.bridgeJSLowerReturn() @@ -5432,7 +5649,7 @@ public func _bjs_SwiftDataProcessor_optionalTag_get(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_SwiftDataProcessor_optionalTag_set") @_cdecl("bjs_SwiftDataProcessor_optionalTag_set") -public func _bjs_SwiftDataProcessor_optionalTag_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_SwiftDataProcessor_optionalTag_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalTag = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -5442,7 +5659,7 @@ public func _bjs_SwiftDataProcessor_optionalTag_set(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_SwiftDataProcessor_optionalCount_get") @_cdecl("bjs_SwiftDataProcessor_optionalCount_get") -public func _bjs_SwiftDataProcessor_optionalCount_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_optionalCount_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalCount return ret.bridgeJSLowerReturn() @@ -5453,7 +5670,7 @@ public func _bjs_SwiftDataProcessor_optionalCount_get(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_SwiftDataProcessor_optionalCount_set") @_cdecl("bjs_SwiftDataProcessor_optionalCount_set") -public func _bjs_SwiftDataProcessor_optionalCount_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_SwiftDataProcessor_optionalCount_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalCount = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -5463,7 +5680,7 @@ public func _bjs_SwiftDataProcessor_optionalCount_set(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_SwiftDataProcessor_direction_get") @_cdecl("bjs_SwiftDataProcessor_direction_get") -public func _bjs_SwiftDataProcessor_direction_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_direction_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).direction return ret.bridgeJSLowerReturn() @@ -5474,7 +5691,7 @@ public func _bjs_SwiftDataProcessor_direction_get(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_SwiftDataProcessor_direction_set") @_cdecl("bjs_SwiftDataProcessor_direction_set") -public func _bjs_SwiftDataProcessor_direction_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_SwiftDataProcessor_direction_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).direction = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -5484,7 +5701,7 @@ public func _bjs_SwiftDataProcessor_direction_set(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_SwiftDataProcessor_optionalTheme_get") @_cdecl("bjs_SwiftDataProcessor_optionalTheme_get") -public func _bjs_SwiftDataProcessor_optionalTheme_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_optionalTheme_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalTheme return ret.bridgeJSLowerReturn() @@ -5495,7 +5712,7 @@ public func _bjs_SwiftDataProcessor_optionalTheme_get(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_SwiftDataProcessor_optionalTheme_set") @_cdecl("bjs_SwiftDataProcessor_optionalTheme_set") -public func _bjs_SwiftDataProcessor_optionalTheme_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueBytes: Int32, valueLength: Int32) -> Void { +public func _bjs_SwiftDataProcessor_optionalTheme_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalTheme = Optional.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength) #else @@ -5505,7 +5722,7 @@ public func _bjs_SwiftDataProcessor_optionalTheme_set(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_SwiftDataProcessor_httpStatus_get") @_cdecl("bjs_SwiftDataProcessor_httpStatus_get") -public func _bjs_SwiftDataProcessor_httpStatus_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_httpStatus_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).httpStatus return ret.bridgeJSLowerReturn() @@ -5516,7 +5733,7 @@ public func _bjs_SwiftDataProcessor_httpStatus_get(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_SwiftDataProcessor_httpStatus_set") @_cdecl("bjs_SwiftDataProcessor_httpStatus_set") -public func _bjs_SwiftDataProcessor_httpStatus_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: Int32) -> Void { +public func _bjs_SwiftDataProcessor_httpStatus_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).httpStatus = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -5526,7 +5743,7 @@ public func _bjs_SwiftDataProcessor_httpStatus_set(_self: UnsafeMutableRawPointe @_expose(wasm, "bjs_SwiftDataProcessor_apiResult_get") @_cdecl("bjs_SwiftDataProcessor_apiResult_get") -public func _bjs_SwiftDataProcessor_apiResult_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_apiResult_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).apiResult return ret.bridgeJSLowerReturn() @@ -5537,7 +5754,7 @@ public func _bjs_SwiftDataProcessor_apiResult_get(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_SwiftDataProcessor_apiResult_set") @_cdecl("bjs_SwiftDataProcessor_apiResult_set") -public func _bjs_SwiftDataProcessor_apiResult_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueCaseId: Int32) -> Void { +public func _bjs_SwiftDataProcessor_apiResult_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueCaseId: Int32) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).apiResult = Optional.bridgeJSLiftParameter(valueIsSome, valueCaseId) #else @@ -5547,7 +5764,7 @@ public func _bjs_SwiftDataProcessor_apiResult_set(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_SwiftDataProcessor_helper_get") @_cdecl("bjs_SwiftDataProcessor_helper_get") -public func _bjs_SwiftDataProcessor_helper_get(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_SwiftDataProcessor_helper_get(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).helper return ret.bridgeJSLowerReturn() @@ -5558,7 +5775,7 @@ public func _bjs_SwiftDataProcessor_helper_get(_self: UnsafeMutableRawPointer) - @_expose(wasm, "bjs_SwiftDataProcessor_helper_set") @_cdecl("bjs_SwiftDataProcessor_helper_set") -public func _bjs_SwiftDataProcessor_helper_set(_self: UnsafeMutableRawPointer, value: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_helper_set(_ _self: UnsafeMutableRawPointer, _ value: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).helper = Greeter.bridgeJSLiftParameter(value) #else @@ -5568,7 +5785,7 @@ public func _bjs_SwiftDataProcessor_helper_set(_self: UnsafeMutableRawPointer, v @_expose(wasm, "bjs_SwiftDataProcessor_optionalHelper_get") @_cdecl("bjs_SwiftDataProcessor_optionalHelper_get") -public func _bjs_SwiftDataProcessor_optionalHelper_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_optionalHelper_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalHelper return ret.bridgeJSLowerReturn() @@ -5579,7 +5796,7 @@ public func _bjs_SwiftDataProcessor_optionalHelper_get(_self: UnsafeMutableRawPo @_expose(wasm, "bjs_SwiftDataProcessor_optionalHelper_set") @_cdecl("bjs_SwiftDataProcessor_optionalHelper_set") -public func _bjs_SwiftDataProcessor_optionalHelper_set(_self: UnsafeMutableRawPointer, valueIsSome: Int32, valueValue: UnsafeMutableRawPointer) -> Void { +public func _bjs_SwiftDataProcessor_optionalHelper_set(_ _self: UnsafeMutableRawPointer, _ valueIsSome: Int32, _ valueValue: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) SwiftDataProcessor.bridgeJSLiftParameter(_self).optionalHelper = Optional.bridgeJSLiftParameter(valueIsSome, valueValue) #else @@ -5589,8 +5806,12 @@ public func _bjs_SwiftDataProcessor_optionalHelper_set(_self: UnsafeMutableRawPo @_expose(wasm, "bjs_SwiftDataProcessor_deinit") @_cdecl("bjs_SwiftDataProcessor_deinit") -public func _bjs_SwiftDataProcessor_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_SwiftDataProcessor_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension SwiftDataProcessor: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -5601,16 +5822,16 @@ extension SwiftDataProcessor: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_SwiftDataProcessor_wrap") -fileprivate func _bjs_SwiftDataProcessor_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_SwiftDataProcessor_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_SwiftDataProcessor_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_SwiftDataProcessor_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_TextProcessor_init") @_cdecl("bjs_TextProcessor_init") -public func _bjs_TextProcessor_init(transform: Int32) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_init(_ transform: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor(transform: _BJS_Closure_20BridgeJSRuntimeTestsSS_SS.bridgeJSLift(transform)) return ret.bridgeJSLowerReturn() @@ -5621,7 +5842,7 @@ public func _bjs_TextProcessor_init(transform: Int32) -> UnsafeMutableRawPointer @_expose(wasm, "bjs_TextProcessor_process") @_cdecl("bjs_TextProcessor_process") -public func _bjs_TextProcessor_process(_self: UnsafeMutableRawPointer, textBytes: Int32, textLength: Int32) -> Void { +public func _bjs_TextProcessor_process(_ _self: UnsafeMutableRawPointer, _ textBytes: Int32, _ textLength: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).process(_: String.bridgeJSLiftParameter(textBytes, textLength)) return ret.bridgeJSLowerReturn() @@ -5632,7 +5853,7 @@ public func _bjs_TextProcessor_process(_self: UnsafeMutableRawPointer, textBytes @_expose(wasm, "bjs_TextProcessor_processWithCustom") @_cdecl("bjs_TextProcessor_processWithCustom") -public func _bjs_TextProcessor_processWithCustom(_self: UnsafeMutableRawPointer, textBytes: Int32, textLength: Int32, customTransform: Int32) -> Void { +public func _bjs_TextProcessor_processWithCustom(_ _self: UnsafeMutableRawPointer, _ textBytes: Int32, _ textLength: Int32, _ customTransform: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processWithCustom(_: String.bridgeJSLiftParameter(textBytes, textLength), customTransform: _BJS_Closure_20BridgeJSRuntimeTestsSiSSSd_SS.bridgeJSLift(customTransform)) return ret.bridgeJSLowerReturn() @@ -5643,7 +5864,7 @@ public func _bjs_TextProcessor_processWithCustom(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TextProcessor_getTransform") @_cdecl("bjs_TextProcessor_getTransform") -public func _bjs_TextProcessor_getTransform(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_getTransform(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).getTransform() return _BJS_Closure_20BridgeJSRuntimeTestsSS_SS.bridgeJSLower(ret) @@ -5654,7 +5875,7 @@ public func _bjs_TextProcessor_getTransform(_self: UnsafeMutableRawPointer) -> U @_expose(wasm, "bjs_TextProcessor_processOptionalString") @_cdecl("bjs_TextProcessor_processOptionalString") -public func _bjs_TextProcessor_processOptionalString(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processOptionalString(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processOptionalString(_: _BJS_Closure_20BridgeJSRuntimeTestsSqSS_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5665,7 +5886,7 @@ public func _bjs_TextProcessor_processOptionalString(_self: UnsafeMutableRawPoin @_expose(wasm, "bjs_TextProcessor_processOptionalInt") @_cdecl("bjs_TextProcessor_processOptionalInt") -public func _bjs_TextProcessor_processOptionalInt(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processOptionalInt(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processOptionalInt(_: _BJS_Closure_20BridgeJSRuntimeTestsSqSi_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5676,7 +5897,7 @@ public func _bjs_TextProcessor_processOptionalInt(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_TextProcessor_processOptionalGreeter") @_cdecl("bjs_TextProcessor_processOptionalGreeter") -public func _bjs_TextProcessor_processOptionalGreeter(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processOptionalGreeter(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processOptionalGreeter(_: _BJS_Closure_20BridgeJSRuntimeTestsSq7GreeterC_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5687,7 +5908,7 @@ public func _bjs_TextProcessor_processOptionalGreeter(_self: UnsafeMutableRawPoi @_expose(wasm, "bjs_TextProcessor_makeOptionalStringFormatter") @_cdecl("bjs_TextProcessor_makeOptionalStringFormatter") -public func _bjs_TextProcessor_makeOptionalStringFormatter(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_makeOptionalStringFormatter(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).makeOptionalStringFormatter() return _BJS_Closure_20BridgeJSRuntimeTestsSqSS_SS.bridgeJSLower(ret) @@ -5698,7 +5919,7 @@ public func _bjs_TextProcessor_makeOptionalStringFormatter(_self: UnsafeMutableR @_expose(wasm, "bjs_TextProcessor_makeOptionalGreeterCreator") @_cdecl("bjs_TextProcessor_makeOptionalGreeterCreator") -public func _bjs_TextProcessor_makeOptionalGreeterCreator(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_makeOptionalGreeterCreator(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).makeOptionalGreeterCreator() return _BJS_Closure_20BridgeJSRuntimeTestsy_Sq7GreeterC.bridgeJSLower(ret) @@ -5709,7 +5930,7 @@ public func _bjs_TextProcessor_makeOptionalGreeterCreator(_self: UnsafeMutableRa @_expose(wasm, "bjs_TextProcessor_processDirection") @_cdecl("bjs_TextProcessor_processDirection") -public func _bjs_TextProcessor_processDirection(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processDirection(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processDirection(_: _BJS_Closure_20BridgeJSRuntimeTests9DirectionO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5720,7 +5941,7 @@ public func _bjs_TextProcessor_processDirection(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TextProcessor_processTheme") @_cdecl("bjs_TextProcessor_processTheme") -public func _bjs_TextProcessor_processTheme(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processTheme(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processTheme(_: _BJS_Closure_20BridgeJSRuntimeTests5ThemeO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5731,7 +5952,7 @@ public func _bjs_TextProcessor_processTheme(_self: UnsafeMutableRawPointer, call @_expose(wasm, "bjs_TextProcessor_processHttpStatus") @_cdecl("bjs_TextProcessor_processHttpStatus") -public func _bjs_TextProcessor_processHttpStatus(_self: UnsafeMutableRawPointer, callback: Int32) -> Int32 { +public func _bjs_TextProcessor_processHttpStatus(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Int32 { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processHttpStatus(_: _BJS_Closure_20BridgeJSRuntimeTests10HttpStatusO_Si.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5742,7 +5963,7 @@ public func _bjs_TextProcessor_processHttpStatus(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TextProcessor_processAPIResult") @_cdecl("bjs_TextProcessor_processAPIResult") -public func _bjs_TextProcessor_processAPIResult(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processAPIResult(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processAPIResult(_: _BJS_Closure_20BridgeJSRuntimeTests9APIResultO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5753,7 +5974,7 @@ public func _bjs_TextProcessor_processAPIResult(_self: UnsafeMutableRawPointer, @_expose(wasm, "bjs_TextProcessor_makeDirectionChecker") @_cdecl("bjs_TextProcessor_makeDirectionChecker") -public func _bjs_TextProcessor_makeDirectionChecker(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_makeDirectionChecker(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).makeDirectionChecker() return _BJS_Closure_20BridgeJSRuntimeTests9DirectionO_Sb.bridgeJSLower(ret) @@ -5764,7 +5985,7 @@ public func _bjs_TextProcessor_makeDirectionChecker(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_TextProcessor_makeThemeValidator") @_cdecl("bjs_TextProcessor_makeThemeValidator") -public func _bjs_TextProcessor_makeThemeValidator(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_makeThemeValidator(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).makeThemeValidator() return _BJS_Closure_20BridgeJSRuntimeTests5ThemeO_Sb.bridgeJSLower(ret) @@ -5775,7 +5996,7 @@ public func _bjs_TextProcessor_makeThemeValidator(_self: UnsafeMutableRawPointer @_expose(wasm, "bjs_TextProcessor_makeStatusCodeExtractor") @_cdecl("bjs_TextProcessor_makeStatusCodeExtractor") -public func _bjs_TextProcessor_makeStatusCodeExtractor(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_makeStatusCodeExtractor(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).makeStatusCodeExtractor() return _BJS_Closure_20BridgeJSRuntimeTests10HttpStatusO_Si.bridgeJSLower(ret) @@ -5786,7 +6007,7 @@ public func _bjs_TextProcessor_makeStatusCodeExtractor(_self: UnsafeMutableRawPo @_expose(wasm, "bjs_TextProcessor_makeAPIResultHandler") @_cdecl("bjs_TextProcessor_makeAPIResultHandler") -public func _bjs_TextProcessor_makeAPIResultHandler(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_makeAPIResultHandler(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).makeAPIResultHandler() return _BJS_Closure_20BridgeJSRuntimeTests9APIResultO_SS.bridgeJSLower(ret) @@ -5797,7 +6018,7 @@ public func _bjs_TextProcessor_makeAPIResultHandler(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_TextProcessor_processOptionalDirection") @_cdecl("bjs_TextProcessor_processOptionalDirection") -public func _bjs_TextProcessor_processOptionalDirection(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processOptionalDirection(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processOptionalDirection(_: _BJS_Closure_20BridgeJSRuntimeTestsSq9DirectionO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5808,7 +6029,7 @@ public func _bjs_TextProcessor_processOptionalDirection(_self: UnsafeMutableRawP @_expose(wasm, "bjs_TextProcessor_processOptionalTheme") @_cdecl("bjs_TextProcessor_processOptionalTheme") -public func _bjs_TextProcessor_processOptionalTheme(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processOptionalTheme(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processOptionalTheme(_: _BJS_Closure_20BridgeJSRuntimeTestsSq5ThemeO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5819,7 +6040,7 @@ public func _bjs_TextProcessor_processOptionalTheme(_self: UnsafeMutableRawPoint @_expose(wasm, "bjs_TextProcessor_processOptionalAPIResult") @_cdecl("bjs_TextProcessor_processOptionalAPIResult") -public func _bjs_TextProcessor_processOptionalAPIResult(_self: UnsafeMutableRawPointer, callback: Int32) -> Void { +public func _bjs_TextProcessor_processOptionalAPIResult(_ _self: UnsafeMutableRawPointer, _ callback: Int32) -> Void { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).processOptionalAPIResult(_: _BJS_Closure_20BridgeJSRuntimeTestsSq9APIResultO_SS.bridgeJSLift(callback)) return ret.bridgeJSLowerReturn() @@ -5830,7 +6051,7 @@ public func _bjs_TextProcessor_processOptionalAPIResult(_self: UnsafeMutableRawP @_expose(wasm, "bjs_TextProcessor_makeOptionalDirectionFormatter") @_cdecl("bjs_TextProcessor_makeOptionalDirectionFormatter") -public func _bjs_TextProcessor_makeOptionalDirectionFormatter(_self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { +public func _bjs_TextProcessor_makeOptionalDirectionFormatter(_ _self: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = TextProcessor.bridgeJSLiftParameter(_self).makeOptionalDirectionFormatter() return _BJS_Closure_20BridgeJSRuntimeTestsSq9DirectionO_SS.bridgeJSLower(ret) @@ -5841,8 +6062,12 @@ public func _bjs_TextProcessor_makeOptionalDirectionFormatter(_self: UnsafeMutab @_expose(wasm, "bjs_TextProcessor_deinit") @_cdecl("bjs_TextProcessor_deinit") -public func _bjs_TextProcessor_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_TextProcessor_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension TextProcessor: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -5853,16 +6078,16 @@ extension TextProcessor: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_TextProcessor_wrap") -fileprivate func _bjs_TextProcessor_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_TextProcessor_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_TextProcessor_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_TextProcessor_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif @_expose(wasm, "bjs_Container_init") @_cdecl("bjs_Container_init") -public func _bjs_Container_init(config: Int32) -> UnsafeMutableRawPointer { +public func _bjs_Container_init(_ config: Int32) -> UnsafeMutableRawPointer { #if arch(wasm32) let _tmp_config = Optional.bridgeJSLiftParameter(config) let _tmp_location = DataPoint.bridgeJSLiftParameter() @@ -5875,7 +6100,7 @@ public func _bjs_Container_init(config: Int32) -> UnsafeMutableRawPointer { @_expose(wasm, "bjs_Container_location_get") @_cdecl("bjs_Container_location_get") -public func _bjs_Container_location_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Container_location_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Container.bridgeJSLiftParameter(_self).location return ret.bridgeJSLowerReturn() @@ -5886,7 +6111,7 @@ public func _bjs_Container_location_get(_self: UnsafeMutableRawPointer) -> Void @_expose(wasm, "bjs_Container_location_set") @_cdecl("bjs_Container_location_set") -public func _bjs_Container_location_set(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Container_location_set(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) Container.bridgeJSLiftParameter(_self).location = DataPoint.bridgeJSLiftParameter() #else @@ -5896,7 +6121,7 @@ public func _bjs_Container_location_set(_self: UnsafeMutableRawPointer) -> Void @_expose(wasm, "bjs_Container_config_get") @_cdecl("bjs_Container_config_get") -public func _bjs_Container_config_get(_self: UnsafeMutableRawPointer) -> Void { +public func _bjs_Container_config_get(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = Container.bridgeJSLiftParameter(_self).config return ret.bridgeJSLowerReturn() @@ -5907,7 +6132,7 @@ public func _bjs_Container_config_get(_self: UnsafeMutableRawPointer) -> Void { @_expose(wasm, "bjs_Container_config_set") @_cdecl("bjs_Container_config_set") -public func _bjs_Container_config_set(_self: UnsafeMutableRawPointer, value: Int32) -> Void { +public func _bjs_Container_config_set(_ _self: UnsafeMutableRawPointer, _ value: Int32) -> Void { #if arch(wasm32) Container.bridgeJSLiftParameter(_self).config = Optional.bridgeJSLiftParameter(value) #else @@ -5917,8 +6142,12 @@ public func _bjs_Container_config_set(_self: UnsafeMutableRawPointer, value: Int @_expose(wasm, "bjs_Container_deinit") @_cdecl("bjs_Container_deinit") -public func _bjs_Container_deinit(pointer: UnsafeMutableRawPointer) { +public func _bjs_Container_deinit(_ pointer: UnsafeMutableRawPointer) -> Void { + #if arch(wasm32) Unmanaged.fromOpaque(pointer).release() + #else + fatalError("Only available on WebAssembly") + #endif } extension Container: ConvertibleToJSValue, _BridgedSwiftHeapObject { @@ -5929,9 +6158,9 @@ extension Container: ConvertibleToJSValue, _BridgedSwiftHeapObject { #if arch(wasm32) @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_Container_wrap") -fileprivate func _bjs_Container_wrap(_: UnsafeMutableRawPointer) -> Int32 +fileprivate func _bjs_Container_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 #else -fileprivate func _bjs_Container_wrap(_: UnsafeMutableRawPointer) -> Int32 { +fileprivate func _bjs_Container_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 { fatalError("Only available on WebAssembly") } #endif \ No newline at end of file