diff --git a/Benchmarks/Sources/Generated/BridgeJS.swift b/Benchmarks/Sources/Generated/BridgeJS.swift index 569eb2ea..86f4c87d 100644 --- a/Benchmarks/Sources/Generated/BridgeJS.swift +++ b/Benchmarks/Sources/Generated/BridgeJS.swift @@ -11,15 +11,15 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) case 3: - return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_param_f32())) + return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_f32())) case 4: - return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) case 5: return .info default: @@ -38,10 +38,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } return Int32(0) case .failure(let param0): - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) return Int32(1) case .flag(let param0): - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) return Int32(2) case .rate(let param0): _swift_js_push_f32(param0) @@ -74,10 +74,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } case .failure(let param0): _swift_js_push_tag(Int32(1)) - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) case .flag(let param0): _swift_js_push_tag(Int32(2)) - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) case .rate(let param0): _swift_js_push_tag(Int32(3)) _swift_js_push_f32(param0) @@ -94,17 +94,17 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> ComplexResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .error(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .error(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .location(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .location(Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 3: - return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 4: - return .coordinates(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + return .coordinates(Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64())) case 5: - return .comprehensive(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .comprehensive(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 6: return .info default: @@ -127,7 +127,7 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) return Int32(1) case .location(let param0, let param1, let param2): _swift_js_push_f64(param0) @@ -138,8 +138,8 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { } return Int32(2) case .status(let param0, let param1, let param2): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -151,10 +151,10 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_f64(param2) return Int32(4) case .comprehensive(let param0, let param1, let param2, let param3, let param4, let param5, let param6, let param7, let param8): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(param1 ? 1 : 0) - _swift_js_push_int(Int32(param2)) - _swift_js_push_int(Int32(param3)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(param1 ? 1 : 0) + _swift_js_push_i32(Int32(param2)) + _swift_js_push_i32(Int32(param3)) _swift_js_push_f64(param4) _swift_js_push_f64(param5) var __bjs_param6 = param6 @@ -199,7 +199,7 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) case .location(let param0, let param1, let param2): _swift_js_push_tag(Int32(2)) _swift_js_push_f64(param0) @@ -210,8 +210,8 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { } case .status(let param0, let param1, let param2): _swift_js_push_tag(Int32(3)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -223,10 +223,10 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_f64(param2) case .comprehensive(let param0, let param1, let param2, let param3, let param4, let param5, let param6, let param7, let param8): _swift_js_push_tag(Int32(5)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(param1 ? 1 : 0) - _swift_js_push_int(Int32(param2)) - _swift_js_push_int(Int32(param3)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(param1 ? 1 : 0) + _swift_js_push_i32(Int32(param2)) + _swift_js_push_i32(Int32(param3)) _swift_js_push_f64(param4) _swift_js_push_f64(param5) var __bjs_param6 = param6 @@ -249,11 +249,11 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { extension SimpleStruct: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> SimpleStruct { - let precise = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) - let rate = Float.bridgeJSLiftParameter(_swift_js_pop_param_f32()) - let flag = Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let count = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let name = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let precise = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) + let rate = Float.bridgeJSLiftParameter(_swift_js_pop_f32()) + let flag = Bool.bridgeJSLiftParameter(_swift_js_pop_i32()) + let count = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let name = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return SimpleStruct(name: name, count: count, flag: flag, rate: rate, precise: precise) } @@ -262,8 +262,8 @@ extension SimpleStruct: _BridgedSwiftStruct { __bjs_name.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.count)) - _swift_js_push_int(self.flag ? 1 : 0) + _swift_js_push_i32(Int32(self.count)) + _swift_js_push_i32(self.flag ? 1 : 0) _swift_js_push_f32(self.rate) _swift_js_push_f64(self.precise) } @@ -303,9 +303,9 @@ fileprivate func _bjs_struct_lift_SimpleStruct() -> Int32 { extension Address: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Address { - let zipCode = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let city = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let street = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let zipCode = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let city = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let street = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Address(street: street, city: city, zipCode: zipCode) } @@ -318,7 +318,7 @@ extension Address: _BridgedSwiftStruct { __bjs_city.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.zipCode)) + _swift_js_push_i32(Int32(self.zipCode)) } init(unsafelyCopying jsObject: JSObject) { @@ -356,10 +356,10 @@ fileprivate func _bjs_struct_lift_Address() -> Int32 { extension Person: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Person { - let email = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let email = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32()) let address = Address.bridgeJSLiftParameter() - let age = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let name = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let age = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let name = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Person(name: name, age: age, address: address, email: email) } @@ -368,7 +368,7 @@ extension Person: _BridgedSwiftStruct { __bjs_name.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.age)) + _swift_js_push_i32(Int32(self.age)) self.address.bridgeJSLowerReturn() let __bjs_isSome_email = self.email != nil if let __bjs_unwrapped_email = self.email { @@ -377,7 +377,7 @@ extension Person: _BridgedSwiftStruct { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_email ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_email ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -415,22 +415,22 @@ fileprivate func _bjs_struct_lift_Person() -> Int32 { extension ComplexStruct: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> ComplexStruct { - let metadata = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let tags = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let score = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) - let active = Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let title = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let id = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let metadata = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let tags = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let score = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) + let active = Bool.bridgeJSLiftParameter(_swift_js_pop_i32()) + let title = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let id = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return ComplexStruct(id: id, title: title, active: active, score: score, tags: tags, metadata: metadata) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.id)) + _swift_js_push_i32(Int32(self.id)) var __bjs_title = self.title __bjs_title.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(self.active ? 1 : 0) + _swift_js_push_i32(self.active ? 1 : 0) _swift_js_push_f64(self.score) var __bjs_tags = self.tags __bjs_tags.withUTF8 { ptr in @@ -477,8 +477,8 @@ fileprivate func _bjs_struct_lift_ComplexStruct() -> Int32 { extension Point: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Point { - let y = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) - let x = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) + let y = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) + let x = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) return Point(x: x, y: y) } @@ -1488,11 +1488,11 @@ public func _bjs_ArrayRoundtrip_init() -> UnsafeMutableRawPointer { public func _bjs_ArrayRoundtrip_takeIntArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takeIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -1508,8 +1508,8 @@ public func _bjs_ArrayRoundtrip_makeIntArray(_ _self: UnsafeMutableRawPointer) - #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).makeIntArray() for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1520,18 +1520,18 @@ public func _bjs_ArrayRoundtrip_makeIntArray(_ _self: UnsafeMutableRawPointer) - public func _bjs_ArrayRoundtrip_roundtripIntArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1543,8 +1543,8 @@ public func _bjs_ArrayRoundtrip_makeIntArrayLarge(_ _self: UnsafeMutableRawPoint #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).makeIntArrayLarge() for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1555,11 +1555,11 @@ public func _bjs_ArrayRoundtrip_makeIntArrayLarge(_ _self: UnsafeMutableRawPoint public func _bjs_ArrayRoundtrip_takeDoubleArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takeDoubleArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Double] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) } __result.reverse() return __result @@ -1576,7 +1576,7 @@ public func _bjs_ArrayRoundtrip_makeDoubleArray(_ _self: UnsafeMutableRawPointer let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).makeDoubleArray() for __bjs_elem_ret in ret { _swift_js_push_f64(__bjs_elem_ret)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1587,18 +1587,18 @@ public func _bjs_ArrayRoundtrip_makeDoubleArray(_ _self: UnsafeMutableRawPointer public func _bjs_ArrayRoundtrip_roundtripDoubleArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripDoubleArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Double] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_f64(__bjs_elem_ret)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1609,11 +1609,11 @@ public func _bjs_ArrayRoundtrip_roundtripDoubleArray(_ _self: UnsafeMutableRawPo public func _bjs_ArrayRoundtrip_takeStringArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takeStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -1633,7 +1633,7 @@ public func _bjs_ArrayRoundtrip_makeStringArray(_ _self: UnsafeMutableRawPointer __bjs_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1644,11 +1644,11 @@ public func _bjs_ArrayRoundtrip_makeStringArray(_ _self: UnsafeMutableRawPointer public func _bjs_ArrayRoundtrip_roundtripStringArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -1658,7 +1658,7 @@ public func _bjs_ArrayRoundtrip_roundtripStringArray(_ _self: UnsafeMutableRawPo __bjs_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1669,7 +1669,7 @@ public func _bjs_ArrayRoundtrip_roundtripStringArray(_ _self: UnsafeMutableRawPo public func _bjs_ArrayRoundtrip_takePointArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takePointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Point] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -1690,7 +1690,7 @@ public func _bjs_ArrayRoundtrip_makePointArray(_ _self: UnsafeMutableRawPointer) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).makePointArray() for __bjs_elem_ret in ret { __bjs_elem_ret.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1701,7 +1701,7 @@ public func _bjs_ArrayRoundtrip_makePointArray(_ _self: UnsafeMutableRawPointer) public func _bjs_ArrayRoundtrip_roundtripPointArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Point] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -1712,7 +1712,7 @@ public func _bjs_ArrayRoundtrip_roundtripPointArray(_ _self: UnsafeMutableRawPoi }()) for __bjs_elem_ret in ret { __bjs_elem_ret.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1725,7 +1725,7 @@ public func _bjs_ArrayRoundtrip_makePointArrayLarge(_ _self: UnsafeMutableRawPoi let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).makePointArrayLarge() for __bjs_elem_ret in ret { __bjs_elem_ret.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1736,16 +1736,16 @@ public func _bjs_ArrayRoundtrip_makePointArrayLarge(_ _self: UnsafeMutableRawPoi public func _bjs_ArrayRoundtrip_takeNestedIntArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takeNestedIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Int]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -1766,9 +1766,9 @@ public func _bjs_ArrayRoundtrip_makeNestedIntArray(_ _self: UnsafeMutableRawPoin let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).makeNestedIntArray() for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_elem_ret_elem))} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret_elem))} + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1779,16 +1779,16 @@ public func _bjs_ArrayRoundtrip_makeNestedIntArray(_ _self: UnsafeMutableRawPoin public func _bjs_ArrayRoundtrip_roundtripNestedIntArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripNestedIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Int]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -1799,9 +1799,9 @@ public func _bjs_ArrayRoundtrip_roundtripNestedIntArray(_ _self: UnsafeMutableRa }()) for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_elem_ret_elem))} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret_elem))} + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1812,12 +1812,12 @@ public func _bjs_ArrayRoundtrip_roundtripNestedIntArray(_ _self: UnsafeMutableRa public func _bjs_ArrayRoundtrip_takeNestedPointArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takeNestedPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Point]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Point] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -1843,8 +1843,8 @@ public func _bjs_ArrayRoundtrip_makeNestedPointArray(_ _self: UnsafeMutableRawPo for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { __bjs_elem_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1855,12 +1855,12 @@ public func _bjs_ArrayRoundtrip_makeNestedPointArray(_ _self: UnsafeMutableRawPo public func _bjs_ArrayRoundtrip_roundtripNestedPointArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripNestedPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Point]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Point] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -1876,8 +1876,8 @@ public func _bjs_ArrayRoundtrip_roundtripNestedPointArray(_ _self: UnsafeMutable for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { __bjs_elem_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1888,11 +1888,11 @@ public func _bjs_ArrayRoundtrip_roundtripNestedPointArray(_ _self: UnsafeMutable public func _bjs_ArrayRoundtrip_takeOptionalIntArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takeOptionalIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -1910,9 +1910,9 @@ public func _bjs_ArrayRoundtrip_makeOptionalIntArray(_ _self: UnsafeMutableRawPo for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_unwrapped_ret_elem))} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_unwrapped_ret_elem))} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1923,11 +1923,11 @@ public func _bjs_ArrayRoundtrip_makeOptionalIntArray(_ _self: UnsafeMutableRawPo public func _bjs_ArrayRoundtrip_roundtripOptionalIntArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripOptionalIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -1935,9 +1935,9 @@ public func _bjs_ArrayRoundtrip_roundtripOptionalIntArray(_ _self: UnsafeMutable for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_unwrapped_ret_elem))} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_unwrapped_ret_elem))} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1948,11 +1948,11 @@ public func _bjs_ArrayRoundtrip_roundtripOptionalIntArray(_ _self: UnsafeMutable public func _bjs_ArrayRoundtrip_takeOptionalPointArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) ArrayRoundtrip.bridgeJSLiftParameter(_self).takeOptionalPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -1971,8 +1971,8 @@ public func _bjs_ArrayRoundtrip_makeOptionalPointArray(_ _self: UnsafeMutableRaw let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { __bjs_unwrapped_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -1983,11 +1983,11 @@ public func _bjs_ArrayRoundtrip_makeOptionalPointArray(_ _self: UnsafeMutableRaw public func _bjs_ArrayRoundtrip_roundtripOptionalPointArray(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) let ret = ArrayRoundtrip.bridgeJSLiftParameter(_self).roundtripOptionalPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -1996,8 +1996,8 @@ public func _bjs_ArrayRoundtrip_roundtripOptionalPointArray(_ _self: UnsafeMutab let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { __bjs_unwrapped_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -2012,11 +2012,11 @@ public func _bjs_ArrayRoundtrip_takeOptionalArray(_ _self: UnsafeMutableRawPoint return Optional<[Int]>.none } else { return { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -2036,9 +2036,9 @@ public func _bjs_ArrayRoundtrip_makeOptionalArraySome(_ _self: UnsafeMutableRawP let __bjs_isSome_ret = ret != nil if let __bjs_unwrapped_ret = ret { for __bjs_elem_ret in __bjs_unwrapped_ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(__bjs_unwrapped_ret.count))} - _swift_js_push_int(__bjs_isSome_ret ? 1 : 0) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(__bjs_unwrapped_ret.count))} + _swift_js_push_i32(__bjs_isSome_ret ? 1 : 0) #else fatalError("Only available on WebAssembly") #endif @@ -2052,9 +2052,9 @@ public func _bjs_ArrayRoundtrip_makeOptionalArrayNone(_ _self: UnsafeMutableRawP let __bjs_isSome_ret = ret != nil if let __bjs_unwrapped_ret = ret { for __bjs_elem_ret in __bjs_unwrapped_ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(__bjs_unwrapped_ret.count))} - _swift_js_push_int(__bjs_isSome_ret ? 1 : 0) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(__bjs_unwrapped_ret.count))} + _swift_js_push_i32(__bjs_isSome_ret ? 1 : 0) #else fatalError("Only available on WebAssembly") #endif @@ -2069,11 +2069,11 @@ public func _bjs_ArrayRoundtrip_roundtripOptionalArray(_ _self: UnsafeMutableRaw return Optional<[Int]>.none } else { return { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -2083,9 +2083,9 @@ public func _bjs_ArrayRoundtrip_roundtripOptionalArray(_ _self: UnsafeMutableRaw let __bjs_isSome_ret = ret != nil if let __bjs_unwrapped_ret = ret { for __bjs_elem_ret in __bjs_unwrapped_ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(__bjs_unwrapped_ret.count))} - _swift_js_push_int(__bjs_isSome_ret ? 1 : 0) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(__bjs_unwrapped_ret.count))} + _swift_js_push_i32(__bjs_isSome_ret ? 1 : 0) #else fatalError("Only available on WebAssembly") #endif diff --git a/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift b/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift index dd28397d..d7d5c820 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift @@ -799,41 +799,41 @@ struct StackCodegen { func liftExpression(for type: BridgeType) -> ExprSyntax { switch type { case .string: - return "String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + return "String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" case .int, .uint: - return "Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "Int.bridgeJSLiftParameter(_swift_js_pop_i32())" case .bool: - return "Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "Bool.bridgeJSLiftParameter(_swift_js_pop_i32())" case .float: - return "Float.bridgeJSLiftParameter(_swift_js_pop_param_f32())" + return "Float.bridgeJSLiftParameter(_swift_js_pop_f32())" case .double: - return "Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())" + return "Double.bridgeJSLiftParameter(_swift_js_pop_f64())" case .jsObject: - return "JSObject.bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "JSObject.bridgeJSLiftParameter(_swift_js_pop_i32())" case .swiftHeapObject(let className): - return "\(raw: className).bridgeJSLiftParameter(_swift_js_pop_param_pointer())" + return "\(raw: className).bridgeJSLiftParameter(_swift_js_pop_pointer())" case .unsafePointer: - return "\(raw: type.swiftType).bridgeJSLiftParameter(_swift_js_pop_param_pointer())" + return "\(raw: type.swiftType).bridgeJSLiftParameter(_swift_js_pop_pointer())" case .swiftProtocol(let protocolName): // Protocols use their Any wrapper type for lifting let wrapperName = "Any\(protocolName)" - return "\(raw: wrapperName).bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "\(raw: wrapperName).bridgeJSLiftParameter(_swift_js_pop_i32())" case .caseEnum(let enumName): - return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_i32())" case .rawValueEnum(let enumName, let rawType): switch rawType { case .string: return - "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" case .float: - return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_param_f32())" + return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_f32())" case .double: - return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_param_f64())" + return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_f64())" case .bool, .int, .int32, .int64, .uint, .uint32, .uint64: - return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_i32())" } case .associatedValueEnum(let enumName): - return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "\(raw: enumName).bridgeJSLiftParameter(_swift_js_pop_i32())" case .swiftStruct(let structName): return "\(raw: structName).bridgeJSLiftParameter()" case .optional(let wrappedType): @@ -845,7 +845,7 @@ struct StackCodegen { // Namespace enums are not passed as values return "()" case .closure: - return "JSObject.bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "JSObject.bridgeJSLiftParameter(_swift_js_pop_i32())" case .array(let elementType): return liftArrayExpression(elementType: elementType) } @@ -856,7 +856,7 @@ struct StackCodegen { let swiftTypeName = elementType.swiftType return """ { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [\(raw: swiftTypeName)] = [] __result.reserveCapacity(__count) for _ in 0..<__count { @@ -872,49 +872,49 @@ struct StackCodegen { switch wrappedType { case .string: return - "Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + "Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())" case .int, .uint: - return "Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + return "Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" case .bool: - return "Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + return "Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" case .float: - return "Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_f32())" + return "Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_f32())" case .double: - return "Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_f64())" + return "Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_f64())" case .caseEnum(let enumName): return - "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" case .rawValueEnum(let enumName, let rawType): switch rawType { case .string: return - "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())" case .float: return - "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_f32())" + "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_f32())" case .double: return - "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_f64())" + "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_f64())" case .bool, .int, .int32, .int64, .uint, .uint32, .uint64: return - "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" } case .swiftStruct(let nestedName): - return "Optional<\(raw: nestedName)>.bridgeJSLiftParameter(_swift_js_pop_param_int32())" + return "Optional<\(raw: nestedName)>.bridgeJSLiftParameter(_swift_js_pop_i32())" case .swiftHeapObject(let className): return - "Optional<\(raw: className)>.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_pointer())" + "Optional<\(raw: className)>.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_pointer())" case .associatedValueEnum(let enumName): return - "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + "Optional<\(raw: enumName)>.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" case .jsObject: - return "Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + return "Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" case .array(let elementType): let arrayLift = liftArrayExpression(elementType: elementType) let swiftTypeName = elementType.swiftType return """ { - let __isSome = _swift_js_pop_param_int32() + let __isSome = _swift_js_pop_i32() if __isSome == 0 { return Optional<[\(raw: swiftTypeName)]>.none } else { @@ -924,7 +924,7 @@ struct StackCodegen { """ default: // Fallback for other optional types - return "Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())" + return "Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())" } } @@ -946,24 +946,24 @@ struct StackCodegen { "__bjs_\(raw: varPrefix).withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }", ] case .int, .uint: - return ["_swift_js_push_int(Int32(\(raw: accessor)))"] + return ["_swift_js_push_i32(Int32(\(raw: accessor)))"] case .bool: - return ["_swift_js_push_int(\(raw: accessor) ? 1 : 0)"] + return ["_swift_js_push_i32(\(raw: accessor) ? 1 : 0)"] case .float: return ["_swift_js_push_f32(\(raw: accessor))"] case .double: return ["_swift_js_push_f64(\(raw: accessor))"] case .jsObject: - return ["_swift_js_push_int(\(raw: accessor).bridgeJSLowerReturn())"] + return ["_swift_js_push_i32(\(raw: accessor).bridgeJSLowerReturn())"] case .swiftHeapObject: return ["_swift_js_push_pointer(\(raw: accessor).bridgeJSLowerReturn())"] case .unsafePointer: return ["_swift_js_push_pointer(\(raw: accessor).bridgeJSLowerReturn())"] case .swiftProtocol(let protocolName): let wrapperName = "Any\(protocolName)" - return ["_swift_js_push_int((\(raw: accessor) as! \(raw: wrapperName)).bridgeJSLowerReturn())"] + return ["_swift_js_push_i32((\(raw: accessor) as! \(raw: wrapperName)).bridgeJSLowerReturn())"] case .caseEnum: - return ["_swift_js_push_int(Int32(\(raw: accessor).bridgeJSLowerParameter()))"] + return ["_swift_js_push_i32(Int32(\(raw: accessor).bridgeJSLowerParameter()))"] case .rawValueEnum(_, let rawType): switch rawType { case .string: @@ -976,7 +976,7 @@ struct StackCodegen { case .double: return ["_swift_js_push_f64(\(raw: accessor).bridgeJSLowerParameter())"] default: - return ["_swift_js_push_int(Int32(\(raw: accessor).bridgeJSLowerParameter()))"] + return ["_swift_js_push_i32(Int32(\(raw: accessor).bridgeJSLowerParameter()))"] } case .associatedValueEnum: return ["\(raw: accessor).bridgeJSLowerReturn()"] @@ -1014,7 +1014,7 @@ struct StackCodegen { } statements.append("}") - statements.append("_swift_js_push_array_length(Int32(\(raw: accessor).count))") + statements.append("_swift_js_push_i32(Int32(\(raw: accessor).count))") return statements } @@ -1037,7 +1037,7 @@ struct StackCodegen { } statements.append("}") - statements.append("_swift_js_push_int(__bjs_isSome_\(raw: varPrefix) ? 1 : 0)") + statements.append("_swift_js_push_i32(__bjs_isSome_\(raw: varPrefix) ? 1 : 0)") return statements } @@ -1053,15 +1053,15 @@ struct StackCodegen { "__bjs_str_\(raw: varPrefix).withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }", ] case .int, .uint: - return ["_swift_js_push_int(Int32(\(raw: unwrappedVar)))"] + return ["_swift_js_push_i32(Int32(\(raw: unwrappedVar)))"] case .bool: - return ["_swift_js_push_int(\(raw: unwrappedVar) ? 1 : 0)"] + return ["_swift_js_push_i32(\(raw: unwrappedVar) ? 1 : 0)"] case .float: return ["_swift_js_push_f32(\(raw: unwrappedVar))"] case .double: return ["_swift_js_push_f64(\(raw: unwrappedVar))"] case .caseEnum: - return ["_swift_js_push_int(\(raw: unwrappedVar).bridgeJSLowerParameter())"] + return ["_swift_js_push_i32(\(raw: unwrappedVar).bridgeJSLowerParameter())"] case .rawValueEnum(_, let rawType): switch rawType { case .string: @@ -1074,16 +1074,16 @@ struct StackCodegen { case .double: return ["_swift_js_push_f64(\(raw: unwrappedVar).bridgeJSLowerParameter())"] default: - return ["_swift_js_push_int(\(raw: unwrappedVar).bridgeJSLowerParameter())"] + return ["_swift_js_push_i32(\(raw: unwrappedVar).bridgeJSLowerParameter())"] } case .swiftStruct: return ["\(raw: unwrappedVar).bridgeJSLowerReturn()"] case .swiftHeapObject: return ["_swift_js_push_pointer(\(raw: unwrappedVar).bridgeJSLowerReturn())"] case .associatedValueEnum: - return ["_swift_js_push_int(\(raw: unwrappedVar).bridgeJSLowerParameter())"] + return ["_swift_js_push_i32(\(raw: unwrappedVar).bridgeJSLowerParameter())"] case .jsObject: - return ["_swift_js_push_int(\(raw: unwrappedVar).bridgeJSLowerReturn())"] + return ["_swift_js_push_i32(\(raw: unwrappedVar).bridgeJSLowerReturn())"] case .array(let elementType): return lowerArrayStatements(elementType: elementType, accessor: unwrappedVar, varPrefix: varPrefix) default: diff --git a/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift b/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift index 4e2c9f86..60b55cd4 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift @@ -256,8 +256,6 @@ public struct BridgeJSLink { "let \(JSGlueVariableScope.reservedTmpRetPointers) = [];", "let \(JSGlueVariableScope.reservedTmpParamPointers) = [];", "let \(JSGlueVariableScope.reservedTmpStructCleanups) = [];", - "let \(JSGlueVariableScope.reservedTmpRetArrayLengths) = [];", - "let \(JSGlueVariableScope.reservedTmpParamArrayLengths) = [];", "const \(JSGlueVariableScope.reservedEnumHelpers) = {};", "const \(JSGlueVariableScope.reservedStructHelpers) = {};", "", @@ -392,7 +390,7 @@ public struct BridgeJSLink { printer.write("\(JSGlueVariableScope.reservedTmpRetTag) = tag;") } printer.write("}") - printer.write("bjs[\"swift_js_push_int\"] = function(v) {") + printer.write("bjs[\"swift_js_push_i32\"] = function(v) {") printer.indent { printer.write("\(JSGlueVariableScope.reservedTmpRetInts).push(v | 0);") } @@ -416,17 +414,17 @@ public struct BridgeJSLink { printer.write("\(JSGlueVariableScope.reservedTmpRetStrings).push(value);") } printer.write("}") - printer.write("bjs[\"swift_js_pop_param_int32\"] = function() {") + printer.write("bjs[\"swift_js_pop_i32\"] = function() {") printer.indent { printer.write("return \(JSGlueVariableScope.reservedTmpParamInts).pop();") } printer.write("}") - printer.write("bjs[\"swift_js_pop_param_f32\"] = function() {") + printer.write("bjs[\"swift_js_pop_f32\"] = function() {") printer.indent { printer.write("return \(JSGlueVariableScope.reservedTmpParamF32s).pop();") } printer.write("}") - printer.write("bjs[\"swift_js_pop_param_f64\"] = function() {") + printer.write("bjs[\"swift_js_pop_f64\"] = function() {") printer.indent { printer.write("return \(JSGlueVariableScope.reservedTmpParamF64s).pop();") } @@ -436,21 +434,11 @@ public struct BridgeJSLink { printer.write("\(JSGlueVariableScope.reservedTmpRetPointers).push(pointer);") } printer.write("}") - printer.write("bjs[\"swift_js_pop_param_pointer\"] = function() {") + printer.write("bjs[\"swift_js_pop_pointer\"] = function() {") printer.indent { printer.write("return \(JSGlueVariableScope.reservedTmpParamPointers).pop();") } printer.write("}") - printer.write("bjs[\"swift_js_push_array_length\"] = function(len) {") - printer.indent { - printer.write("\(JSGlueVariableScope.reservedTmpRetArrayLengths).push(len | 0);") - } - printer.write("}") - printer.write("bjs[\"swift_js_pop_param_array_length\"] = function() {") - printer.indent { - printer.write("return \(JSGlueVariableScope.reservedTmpParamArrayLengths).pop();") - } - printer.write("}") printer.write("bjs[\"swift_js_struct_cleanup\"] = function(cleanupId) {") printer.indent { printer.write("if (cleanupId === 0) { return; }") diff --git a/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift b/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift index cf091930..28f756a4 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift @@ -31,8 +31,6 @@ final class JSGlueVariableScope { static let reservedTmpRetPointers = "tmpRetPointers" static let reservedTmpParamPointers = "tmpParamPointers" static let reservedTmpStructCleanups = "tmpStructCleanups" - static let reservedTmpRetArrayLengths = "tmpRetArrayLengths" - static let reservedTmpParamArrayLengths = "tmpParamArrayLengths" static let reservedEnumHelpers = "enumHelpers" static let reservedStructHelpers = "structHelpers" @@ -62,8 +60,6 @@ final class JSGlueVariableScope { reservedTmpRetPointers, reservedTmpParamPointers, reservedTmpStructCleanups, - reservedTmpRetArrayLengths, - reservedTmpParamArrayLengths, reservedEnumHelpers, reservedStructHelpers, ] @@ -2172,7 +2168,7 @@ struct IntrinsicJSFragment: Sendable { } } printer.write("}") - printer.write("\(JSGlueVariableScope.reservedTmpParamArrayLengths).push(\(arr).length);") + printer.write("\(JSGlueVariableScope.reservedTmpParamInts).push(\(arr).length);") cleanupCode.write("for (const cleanup of \(cleanupArrayVar)) { cleanup(); }") return [] } @@ -2188,7 +2184,7 @@ struct IntrinsicJSFragment: Sendable { let lenVar = scope.variable("arrayLen") let iVar = scope.variable("i") - printer.write("const \(lenVar) = \(JSGlueVariableScope.reservedTmpRetArrayLengths).pop();") + printer.write("const \(lenVar) = \(JSGlueVariableScope.reservedTmpRetInts).pop();") printer.write("const \(resultVar) = [];") printer.write("for (let \(iVar) = 0; \(iVar) < \(lenVar); \(iVar)++) {") printer.indent { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayParameter.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayParameter.Import.js index e0b1c056..8add18b9 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayParameter.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayParameter.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.Export.js index 9416bb54..7388f415 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.Export.js @@ -42,8 +42,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -101,7 +99,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -115,27 +113,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; @@ -302,9 +294,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processIntArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const int = tmpRetInts.pop(); @@ -325,9 +317,9 @@ export async function createInstantiator(options, swift) { swift.memory.release(id); }); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processStringArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const string = tmpRetStrings.pop(); @@ -342,9 +334,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamF64s.push(elem); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processDoubleArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const f64 = tmpRetF64s.pop(); @@ -359,9 +351,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamInts.push(elem ? 1 : 0); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processBoolArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const bool = tmpRetInts.pop() !== 0; @@ -379,9 +371,9 @@ export async function createInstantiator(options, swift) { if (cleanup) { cleanup(); } }); } - tmpParamArrayLengths.push(points.length); + tmpParamInts.push(points.length); instance.exports.bjs_processPointArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const struct = structHelpers.Point.lift(tmpRetStrings, tmpRetInts, tmpRetF32s, tmpRetF64s, tmpRetPointers); @@ -396,9 +388,9 @@ export async function createInstantiator(options, swift) { for (const elem of directions) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(directions.length); + tmpParamInts.push(directions.length); instance.exports.bjs_processDirectionArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const caseId = tmpRetInts.pop(); @@ -413,9 +405,9 @@ export async function createInstantiator(options, swift) { for (const elem of statuses) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(statuses.length); + tmpParamInts.push(statuses.length); instance.exports.bjs_processStatusArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const rawValue = tmpRetInts.pop(); @@ -430,7 +422,7 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); const ret = instance.exports.bjs_sumIntArray(); for (const cleanup of arrayCleanups) { cleanup(); } return ret; @@ -443,7 +435,7 @@ export async function createInstantiator(options, swift) { if (cleanup) { cleanup(); } }); } - tmpParamArrayLengths.push(points.length); + tmpParamInts.push(points.length); const matchingBytes = textEncoder.encode(matching); const matchingId = swift.memory.retain(matchingBytes); instance.exports.bjs_findFirstPoint(matchingId, matchingBytes.length); @@ -457,9 +449,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamPointers.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processUnsafeRawPointerArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const pointer = tmpRetPointers.pop(); @@ -474,9 +466,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamPointers.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processUnsafeMutableRawPointerArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const pointer = tmpRetPointers.pop(); @@ -491,9 +483,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamPointers.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processOpaquePointerArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const pointer = tmpRetPointers.pop(); @@ -514,9 +506,9 @@ export async function createInstantiator(options, swift) { } tmpParamInts.push(isSome); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processOptionalIntArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const isSome1 = tmpRetInts.pop(); @@ -549,9 +541,9 @@ export async function createInstantiator(options, swift) { } tmpParamInts.push(isSome); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processOptionalStringArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const isSome1 = tmpRetInts.pop(); @@ -576,14 +568,14 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); valuesCleanups.push(() => { for (const cleanup of arrayCleanups) { cleanup(); } }); } instance.exports.bjs_processOptionalArray(+isSome); const isSome1 = tmpRetInts.pop(); let optResult; if (isSome1) { - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const int = tmpRetInts.pop(); @@ -608,9 +600,9 @@ export async function createInstantiator(options, swift) { } tmpParamInts.push(isSome); } - tmpParamArrayLengths.push(points.length); + tmpParamInts.push(points.length); instance.exports.bjs_processOptionalPointArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const isSome1 = tmpRetInts.pop(); @@ -638,9 +630,9 @@ export async function createInstantiator(options, swift) { } tmpParamInts.push(isSome); } - tmpParamArrayLengths.push(directions.length); + tmpParamInts.push(directions.length); instance.exports.bjs_processOptionalDirectionArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const isSome1 = tmpRetInts.pop(); @@ -668,9 +660,9 @@ export async function createInstantiator(options, swift) { } tmpParamInts.push(isSome); } - tmpParamArrayLengths.push(statuses.length); + tmpParamInts.push(statuses.length); instance.exports.bjs_processOptionalStatusArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const isSome1 = tmpRetInts.pop(); @@ -694,17 +686,17 @@ export async function createInstantiator(options, swift) { for (const elem1 of elem) { tmpParamInts.push((elem1 | 0)); } - tmpParamArrayLengths.push(elem.length); + tmpParamInts.push(elem.length); arrayCleanups.push(() => { for (const cleanup of arrayCleanups1) { cleanup(); } }); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processNestedIntArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { - const arrayLen1 = tmpRetArrayLengths.pop(); + const arrayLen1 = tmpRetInts.pop(); const arrayResult1 = []; for (let i1 = 0; i1 < arrayLen1; i1++) { const int = tmpRetInts.pop(); @@ -730,17 +722,17 @@ export async function createInstantiator(options, swift) { swift.memory.release(id); }); } - tmpParamArrayLengths.push(elem.length); + tmpParamInts.push(elem.length); arrayCleanups.push(() => { for (const cleanup of arrayCleanups1) { cleanup(); } }); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_processNestedStringArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { - const arrayLen1 = tmpRetArrayLengths.pop(); + const arrayLen1 = tmpRetInts.pop(); const arrayResult1 = []; for (let i1 = 0; i1 < arrayLen1; i1++) { const string = tmpRetStrings.pop(); @@ -763,17 +755,17 @@ export async function createInstantiator(options, swift) { if (cleanup) { cleanup(); } }); } - tmpParamArrayLengths.push(elem.length); + tmpParamInts.push(elem.length); arrayCleanups.push(() => { for (const cleanup of arrayCleanups1) { cleanup(); } }); } - tmpParamArrayLengths.push(points.length); + tmpParamInts.push(points.length); instance.exports.bjs_processNestedPointArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { - const arrayLen1 = tmpRetArrayLengths.pop(); + const arrayLen1 = tmpRetInts.pop(); const arrayResult1 = []; for (let i1 = 0; i1 < arrayLen1; i1++) { const struct = structHelpers.Point.lift(tmpRetStrings, tmpRetInts, tmpRetF32s, tmpRetF64s, tmpRetPointers); @@ -791,9 +783,9 @@ export async function createInstantiator(options, swift) { for (const elem of items) { tmpParamPointers.push(elem.pointer); } - tmpParamArrayLengths.push(items.length); + tmpParamInts.push(items.length); instance.exports.bjs_processItemArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const ptr = tmpRetPointers.pop(); @@ -811,17 +803,17 @@ export async function createInstantiator(options, swift) { for (const elem1 of elem) { tmpParamPointers.push(elem1.pointer); } - tmpParamArrayLengths.push(elem.length); + tmpParamInts.push(elem.length); arrayCleanups.push(() => { for (const cleanup of arrayCleanups1) { cleanup(); } }); } - tmpParamArrayLengths.push(items.length); + tmpParamInts.push(items.length); instance.exports.bjs_processNestedItemArray(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { - const arrayLen1 = tmpRetArrayLengths.pop(); + const arrayLen1 = tmpRetInts.pop(); const arrayResult1 = []; for (let i1 = 0; i1 < arrayLen1; i1++) { const ptr = tmpRetPointers.pop(); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Export.js index cffc92db..4015b626 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Import.js index 9259ae32..981cecbe 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.Export.js index dd0f2af2..97827256 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.Export.js @@ -35,8 +35,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -127,7 +125,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -141,27 +139,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; @@ -566,9 +558,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_testIntArrayDefault(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const int = tmpRetInts.pop(); @@ -589,9 +581,9 @@ export async function createInstantiator(options, swift) { swift.memory.release(id); }); } - tmpParamArrayLengths.push(names.length); + tmpParamInts.push(names.length); instance.exports.bjs_testStringArrayDefault(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const string = tmpRetStrings.pop(); @@ -606,9 +598,9 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamF64s.push(elem); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_testDoubleArrayDefault(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const f64 = tmpRetF64s.pop(); @@ -623,9 +615,9 @@ export async function createInstantiator(options, swift) { for (const elem of flags) { tmpParamInts.push(elem ? 1 : 0); } - tmpParamArrayLengths.push(flags.length); + tmpParamInts.push(flags.length); instance.exports.bjs_testBoolArrayDefault(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const bool = tmpRetInts.pop() !== 0; @@ -640,9 +632,9 @@ export async function createInstantiator(options, swift) { for (const elem of items) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(items.length); + tmpParamInts.push(items.length); instance.exports.bjs_testEmptyArrayDefault(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const int = tmpRetInts.pop(); @@ -659,7 +651,7 @@ export async function createInstantiator(options, swift) { for (const elem of values) { tmpParamInts.push((elem | 0)); } - tmpParamArrayLengths.push(values.length); + tmpParamInts.push(values.length); instance.exports.bjs_testMixedWithArrayDefault(nameId, nameBytes.length, enabled); const ret = tmpRetString; tmpRetString = undefined; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.Export.js index c22bd2b1..2d8dbc0c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.Export.js @@ -504,8 +504,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -549,7 +547,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -563,27 +561,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.Export.js index 1adfe67b..89a0f089 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.Export.js @@ -53,8 +53,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -98,7 +96,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -112,27 +110,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Export.js index ceb2b2fd..b0114887 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Export.js @@ -54,8 +54,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -99,7 +97,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -113,27 +111,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.Export.js index 94e886cb..77c327e8 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.Export.js @@ -73,8 +73,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -118,7 +116,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -132,27 +130,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.Export.js index 896b925f..c1865adf 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.Export.js @@ -104,8 +104,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -149,7 +147,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -163,27 +161,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.ImportMacros.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.ImportMacros.js index d0d035a3..b3b80947 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.ImportMacros.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.ImportMacros.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.ImportMacros.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.ImportMacros.js index 6a596991..35a3d76e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.ImportMacros.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.ImportMacros.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.Export.js index ba902449..094c2241 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Interface.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Interface.Import.js index 2dd3e0ce..1d25a295 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Interface.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Interface.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.Import.js index 220b91e9..83343622 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.Export.js index fd05b088..f079de1d 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.Export.js index 69c674b5..2c43b91e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.Export.js index 33013eae..4b8ce8a6 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MultipleImportedTypes.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MultipleImportedTypes.Import.js index 08f8ab83..f8cfd736 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MultipleImportedTypes.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MultipleImportedTypes.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Export.js index bd48815c..ae7bf745 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.Export.js index 26ba1bba..671868ea 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.Export.js index 64340972..2c08e3d9 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Export.js index 8e14c6c7..0a92510f 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Import.js index a06cc497..fe6c3ae0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Export.js index f187fa8f..836a82f2 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Import.js index a19f3c0a..e3263af0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.Export.js index 5699a3e3..fc13a471 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.Export.js index 4fd02029..24c02750 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.Export.js @@ -93,8 +93,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -138,7 +136,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -152,27 +150,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; @@ -703,7 +695,7 @@ export async function createInstantiator(options, swift) { const objId = swift.memory.retain(elem); tmpParamInts.push(objId); } - tmpParamArrayLengths.push(delegates.length); + tmpParamInts.push(delegates.length); const ret = instance.exports.bjs_DelegateManager_init(); for (const cleanup of arrayCleanups) { cleanup(); } return DelegateManager.__construct(ret); @@ -713,7 +705,7 @@ export async function createInstantiator(options, swift) { } get delegates() { instance.exports.bjs_DelegateManager_delegates_get(this.pointer); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const objId = tmpRetInts.pop(); @@ -730,7 +722,7 @@ export async function createInstantiator(options, swift) { const objId = swift.memory.retain(elem); tmpParamInts.push(objId); } - tmpParamArrayLengths.push(value.length); + tmpParamInts.push(value.length); instance.exports.bjs_DelegateManager_delegates_set(this.pointer); for (const cleanup of arrayCleanups) { cleanup(); } } @@ -745,9 +737,9 @@ export async function createInstantiator(options, swift) { const objId = swift.memory.retain(elem); tmpParamInts.push(objId); } - tmpParamArrayLengths.push(delegates.length); + tmpParamInts.push(delegates.length); instance.exports.bjs_processDelegates(); - const arrayLen = tmpRetArrayLengths.pop(); + const arrayLen = tmpRetInts.pop(); const arrayResult = []; for (let i = 0; i < arrayLen; i++) { const objId1 = tmpRetInts.pop(); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ReExportFrom.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ReExportFrom.Import.js index 1cdc061e..94e22ffc 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ReExportFrom.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ReExportFrom.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Export.js index 4d8b282f..8b5a5431 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Export.js @@ -80,8 +80,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -125,7 +123,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -139,27 +137,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.Export.js index 5e712ef8..e7bebfe6 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.Export.js @@ -80,8 +80,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -125,7 +123,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -139,27 +137,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Export.js index 40c09140..ee127ed0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Export.js @@ -34,8 +34,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -79,7 +77,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -93,27 +91,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.Export.js index f5e30215..9806fc63 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.Export.js @@ -34,8 +34,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -79,7 +77,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -93,27 +91,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringEnum.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringEnum.Import.js index e634e414..373b433b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringEnum.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringEnum.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Export.js index 3155c661..021adcba 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Import.js index 7c3999c8..718f776c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Export.js index d0fd0eb1..479b313d 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Import.js index dc5b94a1..bb527806 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.Export.js index 6fb8849f..d04cd650 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.Export.js index d32c5a27..40378d04 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.Export.js @@ -131,8 +131,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -176,7 +174,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -190,27 +188,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.ImportMacros.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.ImportMacros.js index 51d52e0e..9ab218df 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.ImportMacros.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.ImportMacros.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.Export.js index 5e528e7b..a3d60d0b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.Export.js @@ -34,8 +34,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -268,7 +266,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -282,27 +280,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.ImportMacros.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.ImportMacros.js index 8683a87f..f4e7e61e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.ImportMacros.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.ImportMacros.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -89,7 +87,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -103,27 +101,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TS2SkeletonLike.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TS2SkeletonLike.Import.js index 5ff21f22..45c27311 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TS2SkeletonLike.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TS2SkeletonLike.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.Export.js index 664794d4..5a492295 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeAlias.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeAlias.Import.js index 0aa603d8..406d7f0f 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeAlias.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeAlias.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeScriptClass.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeScriptClass.Import.js index f442cd88..d8391905 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeScriptClass.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/TypeScriptClass.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.Export.js index 95602db7..2ac28b7e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -94,7 +92,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -108,27 +106,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Export.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Export.js index 67eb8bc8..8a2fabca 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Export.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Export.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -74,7 +72,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -88,27 +86,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Import.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Import.js index 915f6436..2944bcf5 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Import.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.Import.js @@ -29,8 +29,6 @@ export async function createInstantiator(options, swift) { let tmpRetPointers = []; let tmpParamPointers = []; let tmpStructCleanups = []; - let tmpRetArrayLengths = []; - let tmpParamArrayLengths = []; const enumHelpers = {}; const structHelpers = {}; @@ -75,7 +73,7 @@ export async function createInstantiator(options, swift) { bjs["swift_js_push_tag"] = function(tag) { tmpRetTag = tag; } - bjs["swift_js_push_int"] = function(v) { + bjs["swift_js_push_i32"] = function(v) { tmpRetInts.push(v | 0); } bjs["swift_js_push_f32"] = function(v) { @@ -89,27 +87,21 @@ export async function createInstantiator(options, swift) { const value = textDecoder.decode(bytes); tmpRetStrings.push(value); } - bjs["swift_js_pop_param_int32"] = function() { + bjs["swift_js_pop_i32"] = function() { return tmpParamInts.pop(); } - bjs["swift_js_pop_param_f32"] = function() { + bjs["swift_js_pop_f32"] = function() { return tmpParamF32s.pop(); } - bjs["swift_js_pop_param_f64"] = function() { + bjs["swift_js_pop_f64"] = function() { return tmpParamF64s.pop(); } bjs["swift_js_push_pointer"] = function(pointer) { tmpRetPointers.push(pointer); } - bjs["swift_js_pop_param_pointer"] = function() { + bjs["swift_js_pop_pointer"] = function() { return tmpParamPointers.pop(); } - bjs["swift_js_push_array_length"] = function(len) { - tmpRetArrayLengths.push(len | 0); - } - bjs["swift_js_pop_param_array_length"] = function() { - return tmpParamArrayLengths.pop(); - } bjs["swift_js_struct_cleanup"] = function(cleanupId) { if (cleanupId === 0) { return; } const index = (cleanupId | 0) - 1; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/ArrayTypes.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/ArrayTypes.swift index 8142d690..711694c9 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/ArrayTypes.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/ArrayTypes.swift @@ -46,8 +46,8 @@ extension Status: _BridgedSwiftEnumNoPayload { extension Point: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Point { - let y = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) - let x = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) + let y = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) + let x = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) return Point(x: x, y: y) } @@ -94,18 +94,18 @@ fileprivate func _bjs_struct_lift_Point() -> Int32 { public func _bjs_processIntArray() -> Void { #if arch(wasm32) let ret = processIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -116,11 +116,11 @@ public func _bjs_processIntArray() -> Void { public func _bjs_processStringArray() -> Void { #if arch(wasm32) let ret = processStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -130,7 +130,7 @@ public func _bjs_processStringArray() -> Void { __bjs_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -141,18 +141,18 @@ public func _bjs_processStringArray() -> Void { public func _bjs_processDoubleArray() -> Void { #if arch(wasm32) let ret = processDoubleArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Double] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_f64(__bjs_elem_ret)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -163,18 +163,18 @@ public func _bjs_processDoubleArray() -> Void { public func _bjs_processBoolArray() -> Void { #if arch(wasm32) let ret = processBoolArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Bool] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(__bjs_elem_ret ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_elem_ret ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -185,7 +185,7 @@ public func _bjs_processBoolArray() -> Void { public func _bjs_processPointArray() -> Void { #if arch(wasm32) let ret = processPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Point] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -196,7 +196,7 @@ public func _bjs_processPointArray() -> Void { }()) for __bjs_elem_ret in ret { __bjs_elem_ret.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -207,18 +207,18 @@ public func _bjs_processPointArray() -> Void { public func _bjs_processDirectionArray() -> Void { #if arch(wasm32) let ret = processDirectionArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Direction] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Direction.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Direction.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -229,18 +229,18 @@ public func _bjs_processDirectionArray() -> Void { public func _bjs_processStatusArray() -> Void { #if arch(wasm32) let ret = processStatusArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Status] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Status.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Status.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -251,11 +251,11 @@ public func _bjs_processStatusArray() -> Void { public func _bjs_sumIntArray() -> Int32 { #if arch(wasm32) let ret = sumIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -271,7 +271,7 @@ public func _bjs_sumIntArray() -> Int32 { public func _bjs_findFirstPoint(_ matchingBytes: Int32, _ matchingLength: Int32) -> Void { #if arch(wasm32) let ret = findFirstPoint(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Point] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -291,18 +291,18 @@ public func _bjs_findFirstPoint(_ matchingBytes: Int32, _ matchingLength: Int32) public func _bjs_processUnsafeRawPointerArray() -> Void { #if arch(wasm32) let ret = processUnsafeRawPointerArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [UnsafeRawPointer] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -313,18 +313,18 @@ public func _bjs_processUnsafeRawPointerArray() -> Void { public func _bjs_processUnsafeMutableRawPointerArray() -> Void { #if arch(wasm32) let ret = processUnsafeMutableRawPointerArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [UnsafeMutableRawPointer] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -335,18 +335,18 @@ public func _bjs_processUnsafeMutableRawPointerArray() -> Void { public func _bjs_processOpaquePointerArray() -> Void { #if arch(wasm32) let ret = processOpaquePointerArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [OpaquePointer] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -357,11 +357,11 @@ public func _bjs_processOpaquePointerArray() -> Void { public func _bjs_processOptionalIntArray() -> Void { #if arch(wasm32) let ret = processOptionalIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -369,9 +369,9 @@ public func _bjs_processOptionalIntArray() -> Void { for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_unwrapped_ret_elem))} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_unwrapped_ret_elem))} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -382,11 +382,11 @@ public func _bjs_processOptionalIntArray() -> Void { public func _bjs_processOptionalStringArray() -> Void { #if arch(wasm32) let ret = processOptionalStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -398,8 +398,8 @@ public func _bjs_processOptionalStringArray() -> Void { __bjs_str_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -414,11 +414,11 @@ public func _bjs_processOptionalArray(_ values: Int32) -> Void { return Optional<[Int]>.none } else { return { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -428,9 +428,9 @@ public func _bjs_processOptionalArray(_ values: Int32) -> Void { let __bjs_isSome_ret = ret != nil if let __bjs_unwrapped_ret = ret { for __bjs_elem_ret in __bjs_unwrapped_ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(__bjs_unwrapped_ret.count))} - _swift_js_push_int(__bjs_isSome_ret ? 1 : 0) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(__bjs_unwrapped_ret.count))} + _swift_js_push_i32(__bjs_isSome_ret ? 1 : 0) #else fatalError("Only available on WebAssembly") #endif @@ -441,11 +441,11 @@ public func _bjs_processOptionalArray(_ values: Int32) -> Void { public func _bjs_processOptionalPointArray() -> Void { #if arch(wasm32) let ret = processOptionalPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -454,8 +454,8 @@ public func _bjs_processOptionalPointArray() -> Void { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { __bjs_unwrapped_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -466,11 +466,11 @@ public func _bjs_processOptionalPointArray() -> Void { public func _bjs_processOptionalDirectionArray() -> Void { #if arch(wasm32) let ret = processOptionalDirectionArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -478,9 +478,9 @@ public func _bjs_processOptionalDirectionArray() -> Void { for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -491,11 +491,11 @@ public func _bjs_processOptionalDirectionArray() -> Void { public func _bjs_processOptionalStatusArray() -> Void { #if arch(wasm32) let ret = processOptionalStatusArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -503,9 +503,9 @@ public func _bjs_processOptionalStatusArray() -> Void { for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -516,16 +516,16 @@ public func _bjs_processOptionalStatusArray() -> Void { public func _bjs_processNestedIntArray() -> Void { #if arch(wasm32) let ret = processNestedIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Int]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -536,9 +536,9 @@ public func _bjs_processNestedIntArray() -> Void { }()) for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_elem_ret_elem))} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret_elem))} + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -549,16 +549,16 @@ public func _bjs_processNestedIntArray() -> Void { public func _bjs_processNestedStringArray() -> Void { #if arch(wasm32) let ret = processNestedStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[String]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -573,8 +573,8 @@ public func _bjs_processNestedStringArray() -> Void { __bjs_ret_elem_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -585,12 +585,12 @@ public func _bjs_processNestedStringArray() -> Void { public func _bjs_processNestedPointArray() -> Void { #if arch(wasm32) let ret = processNestedPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Point]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Point] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -606,8 +606,8 @@ public func _bjs_processNestedPointArray() -> Void { for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { __bjs_elem_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -618,18 +618,18 @@ public func _bjs_processNestedPointArray() -> Void { public func _bjs_processItemArray() -> Void { #if arch(wasm32) let ret = processItemArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Item] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Item.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(Item.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -640,16 +640,16 @@ public func _bjs_processItemArray() -> Void { public func _bjs_processNestedItemArray() -> Void { #if arch(wasm32) let ret = processNestedItemArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Item]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Item] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Item.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(Item.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result @@ -661,8 +661,8 @@ public func _bjs_processNestedItemArray() -> Void { for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { _swift_js_push_pointer(__bjs_elem_ret_elem.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift index 7803860a..5232bdd5 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/DefaultParameters.swift @@ -39,9 +39,9 @@ extension Status: _BridgedSwiftCaseEnum { extension Config: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Config { - let enabled = Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let value = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let name = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let enabled = Bool.bridgeJSLiftParameter(_swift_js_pop_i32()) + let value = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let name = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Config(name: name, value: value, enabled: enabled) } @@ -50,8 +50,8 @@ extension Config: _BridgedSwiftStruct { __bjs_name.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.value)) - _swift_js_push_int(self.enabled ? 1 : 0) + _swift_js_push_i32(Int32(self.value)) + _swift_js_push_i32(self.enabled ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -89,7 +89,7 @@ fileprivate func _bjs_struct_lift_Config() -> Int32 { extension MathOperations: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> MathOperations { - let baseValue = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) + let baseValue = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) return MathOperations(baseValue: baseValue) } @@ -322,18 +322,18 @@ public func _bjs_testOptionalStructWithValueDefault(_ point: Int32) -> Void { public func _bjs_testIntArrayDefault() -> Void { #if arch(wasm32) let ret = testIntArrayDefault(values: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -344,11 +344,11 @@ public func _bjs_testIntArrayDefault() -> Void { public func _bjs_testStringArrayDefault() -> Void { #if arch(wasm32) let ret = testStringArrayDefault(names: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -358,7 +358,7 @@ public func _bjs_testStringArrayDefault() -> Void { __bjs_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -369,18 +369,18 @@ public func _bjs_testStringArrayDefault() -> Void { public func _bjs_testDoubleArrayDefault() -> Void { #if arch(wasm32) let ret = testDoubleArrayDefault(values: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Double] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_f64(__bjs_elem_ret)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -391,18 +391,18 @@ public func _bjs_testDoubleArrayDefault() -> Void { public func _bjs_testBoolArrayDefault() -> Void { #if arch(wasm32) let ret = testBoolArrayDefault(flags: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Bool] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(__bjs_elem_ret ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_elem_ret ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -413,18 +413,18 @@ public func _bjs_testBoolArrayDefault() -> Void { public func _bjs_testEmptyArrayDefault() -> Void { #if arch(wasm32) let ret = testEmptyArrayDefault(items: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -435,11 +435,11 @@ public func _bjs_testEmptyArrayDefault() -> Void { public func _bjs_testMixedWithArrayDefault(_ nameBytes: Int32, _ nameLength: Int32, _ enabled: Int32) -> Void { #if arch(wasm32) let ret = testMixedWithArrayDefault(name: String.bridgeJSLiftParameter(nameBytes, nameLength), values: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift index 13239108..e35da2f7 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/EnumAssociatedValue.swift @@ -2,15 +2,15 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) case 3: - return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_param_f32())) + return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_f32())) case 4: - return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) case 5: return .info default: @@ -29,10 +29,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } return Int32(0) case .failure(let param0): - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) return Int32(1) case .flag(let param0): - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) return Int32(2) case .rate(let param0): _swift_js_push_f32(param0) @@ -65,10 +65,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } case .failure(let param0): _swift_js_push_tag(Int32(1)) - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) case .flag(let param0): _swift_js_push_tag(Int32(2)) - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) case .rate(let param0): _swift_js_push_tag(Int32(3)) _swift_js_push_f32(param0) @@ -85,15 +85,15 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> ComplexResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .error(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .error(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 3: - return .coordinates(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + return .coordinates(Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64())) case 4: - return .comprehensive(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .comprehensive(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 5: return .info default: @@ -116,11 +116,11 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) return Int32(1) case .status(let param0, let param1, let param2): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -132,10 +132,10 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_f64(param2) return Int32(3) case .comprehensive(let param0, let param1, let param2, let param3, let param4, let param5, let param6, let param7, let param8): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(param1 ? 1 : 0) - _swift_js_push_int(Int32(param2)) - _swift_js_push_int(Int32(param3)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(param1 ? 1 : 0) + _swift_js_push_i32(Int32(param2)) + _swift_js_push_i32(Int32(param3)) _swift_js_push_f64(param4) _swift_js_push_f64(param5) var __bjs_param6 = param6 @@ -180,11 +180,11 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) case .status(let param0, let param1, let param2): _swift_js_push_tag(Int32(2)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -196,10 +196,10 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_f64(param2) case .comprehensive(let param0, let param1, let param2, let param3, let param4, let param5, let param6, let param7, let param8): _swift_js_push_tag(Int32(4)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(param1 ? 1 : 0) - _swift_js_push_int(Int32(param2)) - _swift_js_push_int(Int32(param3)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(param1 ? 1 : 0) + _swift_js_push_i32(Int32(param2)) + _swift_js_push_i32(Int32(param3)) _swift_js_push_f64(param4) _swift_js_push_f64(param5) var __bjs_param6 = param6 @@ -224,11 +224,11 @@ extension Utilities.Result: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> Utilities.Result { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) default: fatalError("Unknown Utilities.Result case ID: \(caseId)") } @@ -249,11 +249,11 @@ extension Utilities.Result: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) return Int32(1) case .status(let param0, let param1, let param2): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -286,11 +286,11 @@ extension Utilities.Result: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) case .status(let param0, let param1, let param2): _swift_js_push_tag(Int32(2)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -303,9 +303,9 @@ extension NetworkingResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> NetworkingResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32())) default: fatalError("Unknown NetworkingResult case ID: \(caseId)") } @@ -326,7 +326,7 @@ extension NetworkingResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) return Int32(1) } } @@ -355,7 +355,7 @@ extension NetworkingResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) } } } @@ -364,11 +364,11 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIOptionalResult { switch caseId { case 0: - return .success(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .failure(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 2: - return .status(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .status(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())) default: fatalError("Unknown APIOptionalResult case ID: \(caseId)") } @@ -386,31 +386,31 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) return Int32(0) case .failure(let param0, let param1): let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(Int32(__bjs_unwrapped_param0)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param0)) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(__bjs_unwrapped_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param1 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) return Int32(1) case .status(let param0, let param1, let param2): let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(__bjs_unwrapped_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param0 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(Int32(__bjs_unwrapped_param1)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param1)) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) let __bjs_isSome_param2 = param2 != nil if let __bjs_unwrapped_param2 = param2 { var __bjs_str_param2 = __bjs_unwrapped_param2 @@ -418,7 +418,7 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param2 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param2 ? 1 : 0) return Int32(2) } } @@ -444,31 +444,31 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) case .failure(let param0, let param1): _swift_js_push_tag(Int32(1)) let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(Int32(__bjs_unwrapped_param0)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param0)) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(__bjs_unwrapped_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param1 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) case .status(let param0, let param1, let param2): _swift_js_push_tag(Int32(2)) let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(__bjs_unwrapped_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param0 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(Int32(__bjs_unwrapped_param1)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param1)) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) let __bjs_isSome_param2 = param2 != nil if let __bjs_unwrapped_param2 = param2 { var __bjs_str_param2 = __bjs_unwrapped_param2 @@ -476,7 +476,7 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param2 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param2 ? 1 : 0) } } } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift index 7592f296..0558e2a1 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/Protocol.swift @@ -366,9 +366,9 @@ extension Result: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> Result { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) default: fatalError("Unknown Result case ID: \(caseId)") } @@ -385,7 +385,7 @@ extension Result: _BridgedSwiftAssociatedValueEnum { } return Int32(0) case .failure(let param0): - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) return Int32(1) } } @@ -410,7 +410,7 @@ extension Result: _BridgedSwiftAssociatedValueEnum { } case .failure(let param0): _swift_js_push_tag(Int32(1)) - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) } } } @@ -423,18 +423,18 @@ extension Priority: _BridgedSwiftEnumNoPayload { public func _bjs_processDelegates() -> Void { #if arch(wasm32) let ret = processDelegates(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [AnyMyViewControllerDelegate] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(AnyMyViewControllerDelegate.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(AnyMyViewControllerDelegate.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int((__bjs_elem_ret as! AnyMyViewControllerDelegate).bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32((__bjs_elem_ret as! AnyMyViewControllerDelegate).bridgeJSLowerReturn())} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -654,11 +654,11 @@ fileprivate func _bjs_MyViewController_wrap(_ pointer: UnsafeMutableRawPointer) public func _bjs_DelegateManager_init() -> UnsafeMutableRawPointer { #if arch(wasm32) let ret = DelegateManager(delegates: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [AnyMyViewControllerDelegate] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(AnyMyViewControllerDelegate.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(AnyMyViewControllerDelegate.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -685,8 +685,8 @@ public func _bjs_DelegateManager_delegates_get(_ _self: UnsafeMutableRawPointer) #if arch(wasm32) let ret = DelegateManager.bridgeJSLiftParameter(_self).delegates for __bjs_elem_ret in ret { - _swift_js_push_int((__bjs_elem_ret as! AnyMyViewControllerDelegate).bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32((__bjs_elem_ret as! AnyMyViewControllerDelegate).bridgeJSLowerReturn())} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -697,11 +697,11 @@ public func _bjs_DelegateManager_delegates_get(_ _self: UnsafeMutableRawPointer) public func _bjs_DelegateManager_delegates_set(_ _self: UnsafeMutableRawPointer) -> Void { #if arch(wasm32) DelegateManager.bridgeJSLiftParameter(_self).delegates = { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [AnyMyViewControllerDelegate] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(AnyMyViewControllerDelegate.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(AnyMyViewControllerDelegate.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift index 8a5b5606..378eff8b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.Global.swift @@ -48,9 +48,9 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) default: fatalError("Unknown APIResult case ID: \(caseId)") } @@ -67,7 +67,7 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } return Int32(0) case .failure(let param0): - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) return Int32(1) } } @@ -92,7 +92,7 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } case .failure(let param0): _swift_js_push_tag(Int32(1)) - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) } } } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift index 8a5b5606..378eff8b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/StaticFunctions.swift @@ -48,9 +48,9 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) default: fatalError("Unknown APIResult case ID: \(caseId)") } @@ -67,7 +67,7 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } return Int32(0) case .failure(let param0): - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) return Int32(1) } } @@ -92,7 +92,7 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } case .failure(let param0): _swift_js_push_tag(Int32(1)) - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) } } } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift index 7d0ae15d..415aa54f 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftClosure.swift @@ -677,15 +677,15 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) case 3: - return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_param_f32())) + return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_f32())) case 4: - return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) case 5: return .info default: @@ -704,10 +704,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } return Int32(0) case .failure(let param0): - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) return Int32(1) case .flag(let param0): - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) return Int32(2) case .rate(let param0): _swift_js_push_f32(param0) @@ -740,10 +740,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } case .failure(let param0): _swift_js_push_tag(Int32(1)) - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) case .flag(let param0): _swift_js_push_tag(Int32(2)) - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) case .rate(let param0): _swift_js_push_tag(Int32(3)) _swift_js_push_f32(param0) diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift index ca164c1b..af442897 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/SwiftStruct.swift @@ -3,11 +3,11 @@ extension Precision: _BridgedSwiftEnumNoPayload { extension DataPoint: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> DataPoint { - let optFlag = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let optCount = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let label = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let y = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) - let x = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) + let optFlag = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let optCount = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let label = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let y = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) + let x = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) return DataPoint(x: x, y: y, label: label, optCount: optCount, optFlag: optFlag) } @@ -20,14 +20,14 @@ extension DataPoint: _BridgedSwiftStruct { } let __bjs_isSome_optCount = self.optCount != nil if let __bjs_unwrapped_optCount = self.optCount { - _swift_js_push_int(Int32(__bjs_unwrapped_optCount)) + _swift_js_push_i32(Int32(__bjs_unwrapped_optCount)) } - _swift_js_push_int(__bjs_isSome_optCount ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_optCount ? 1 : 0) let __bjs_isSome_optFlag = self.optFlag != nil if let __bjs_unwrapped_optFlag = self.optFlag { - _swift_js_push_int(__bjs_unwrapped_optFlag ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_optFlag ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_optFlag ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_optFlag ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -76,9 +76,9 @@ public func _bjs_DataPoint_init(_ x: Float64, _ y: Float64, _ labelBytes: Int32, extension Address: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Address { - let zipCode = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let city = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let street = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let zipCode = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let city = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let street = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Address(street: street, city: city, zipCode: zipCode) } @@ -93,9 +93,9 @@ extension Address: _BridgedSwiftStruct { } let __bjs_isSome_zipCode = self.zipCode != nil if let __bjs_unwrapped_zipCode = self.zipCode { - _swift_js_push_int(Int32(__bjs_unwrapped_zipCode)) + _swift_js_push_i32(Int32(__bjs_unwrapped_zipCode)) } - _swift_js_push_int(__bjs_isSome_zipCode ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_zipCode ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -133,10 +133,10 @@ fileprivate func _bjs_struct_lift_Address() -> Int32 { extension Person: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Person { - let email = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let email = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32()) let address = Address.bridgeJSLiftParameter() - let age = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let name = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let age = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let name = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Person(name: name, age: age, address: address, email: email) } @@ -145,7 +145,7 @@ extension Person: _BridgedSwiftStruct { __bjs_name.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.age)) + _swift_js_push_i32(Int32(self.age)) self.address.bridgeJSLowerReturn() let __bjs_isSome_email = self.email != nil if let __bjs_unwrapped_email = self.email { @@ -154,7 +154,7 @@ extension Person: _BridgedSwiftStruct { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_email ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_email ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -192,13 +192,13 @@ fileprivate func _bjs_struct_lift_Person() -> Int32 { extension Session: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Session { - let owner = Greeter.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let id = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let owner = Greeter.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let id = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return Session(id: id, owner: owner) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.id)) + _swift_js_push_i32(Int32(self.id)) _swift_js_push_pointer(self.owner.bridgeJSLowerReturn()) } @@ -237,9 +237,9 @@ fileprivate func _bjs_struct_lift_Session() -> Int32 { extension Measurement: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Measurement { - let optionalPrecision = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_f32()) - let precision = Precision.bridgeJSLiftParameter(_swift_js_pop_param_f32()) - let value = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) + let optionalPrecision = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_f32()) + let precision = Precision.bridgeJSLiftParameter(_swift_js_pop_f32()) + let value = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) return Measurement(value: value, precision: precision, optionalPrecision: optionalPrecision) } @@ -250,7 +250,7 @@ extension Measurement: _BridgedSwiftStruct { if let __bjs_unwrapped_optionalPrecision = self.optionalPrecision { _swift_js_push_f32(__bjs_unwrapped_optionalPrecision.bridgeJSLowerParameter()) } - _swift_js_push_int(__bjs_isSome_optionalPrecision ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_optionalPrecision ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/UnsafePointer.swift b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/UnsafePointer.swift index 3ef3b993..4c368908 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/UnsafePointer.swift +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ExportSwiftTests/UnsafePointer.swift @@ -1,10 +1,10 @@ extension PointerFields: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> PointerFields { - let mutPtr = UnsafeMutablePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let ptr = UnsafePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let opaque = OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let mutRaw = UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let raw = UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) + let mutPtr = UnsafeMutablePointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let ptr = UnsafePointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let opaque = OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let mutRaw = UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let raw = UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) return PointerFields(raw: raw, mutRaw: mutRaw, opaque: opaque, ptr: ptr, mutPtr: mutPtr) } diff --git a/Plugins/PackageToJS/Templates/instantiate.js b/Plugins/PackageToJS/Templates/instantiate.js index 1ab35de3..54a7212c 100644 --- a/Plugins/PackageToJS/Templates/instantiate.js +++ b/Plugins/PackageToJS/Templates/instantiate.js @@ -40,13 +40,13 @@ async function createInstantiator(options, swift) { swift_js_retain: unexpectedBjsCall, swift_js_release: unexpectedBjsCall, swift_js_push_tag: unexpectedBjsCall, - swift_js_push_int: unexpectedBjsCall, + swift_js_push_i32: unexpectedBjsCall, swift_js_push_f32: unexpectedBjsCall, swift_js_push_f64: unexpectedBjsCall, swift_js_push_string: unexpectedBjsCall, - swift_js_pop_param_int32: unexpectedBjsCall, - swift_js_pop_param_f32: unexpectedBjsCall, - swift_js_pop_param_f64: unexpectedBjsCall, + swift_js_pop_i32: unexpectedBjsCall, + swift_js_pop_f32: unexpectedBjsCall, + swift_js_pop_f64: unexpectedBjsCall, swift_js_return_optional_bool: unexpectedBjsCall, swift_js_return_optional_int: unexpectedBjsCall, swift_js_return_optional_string: unexpectedBjsCall, diff --git a/Sources/JavaScriptKit/BridgeJSIntrinsics.swift b/Sources/JavaScriptKit/BridgeJSIntrinsics.swift index dcdb8f6d..1e7893c8 100644 --- a/Sources/JavaScriptKit/BridgeJSIntrinsics.swift +++ b/Sources/JavaScriptKit/BridgeJSIntrinsics.swift @@ -425,10 +425,10 @@ where Self: RawRepresentable, RawValue: _BridgedSwiftTypeLoweredIntoSingleWasmCo #endif #if arch(wasm32) -@_extern(wasm, module: "bjs", name: "swift_js_push_int") -@_spi(BridgeJS) public func _swift_js_push_int(_ value: Int32) +@_extern(wasm, module: "bjs", name: "swift_js_push_i32") +@_spi(BridgeJS) public func _swift_js_push_i32(_ value: Int32) #else -@_spi(BridgeJS) public func _swift_js_push_int(_ value: Int32) { +@_spi(BridgeJS) public func _swift_js_push_i32(_ value: Int32) { _onlyAvailableOnWasm() } #endif @@ -452,48 +452,28 @@ where Self: RawRepresentable, RawValue: _BridgedSwiftTypeLoweredIntoSingleWasmCo #endif #if arch(wasm32) -@_extern(wasm, module: "bjs", name: "swift_js_pop_param_int32") -@_spi(BridgeJS) public func _swift_js_pop_param_int32() -> Int32 +@_extern(wasm, module: "bjs", name: "swift_js_pop_i32") +@_spi(BridgeJS) public func _swift_js_pop_i32() -> Int32 #else -@_spi(BridgeJS) public func _swift_js_pop_param_int32() -> Int32 { +@_spi(BridgeJS) public func _swift_js_pop_i32() -> Int32 { _onlyAvailableOnWasm() } #endif #if arch(wasm32) -@_extern(wasm, module: "bjs", name: "swift_js_pop_param_f32") -@_spi(BridgeJS) public func _swift_js_pop_param_f32() -> Float32 +@_extern(wasm, module: "bjs", name: "swift_js_pop_f32") +@_spi(BridgeJS) public func _swift_js_pop_f32() -> Float32 #else -@_spi(BridgeJS) public func _swift_js_pop_param_f32() -> Float32 { +@_spi(BridgeJS) public func _swift_js_pop_f32() -> Float32 { _onlyAvailableOnWasm() } #endif #if arch(wasm32) -@_extern(wasm, module: "bjs", name: "swift_js_pop_param_f64") -@_spi(BridgeJS) public func _swift_js_pop_param_f64() -> Float64 +@_extern(wasm, module: "bjs", name: "swift_js_pop_f64") +@_spi(BridgeJS) public func _swift_js_pop_f64() -> Float64 #else -@_spi(BridgeJS) public func _swift_js_pop_param_f64() -> Float64 { - _onlyAvailableOnWasm() -} -#endif - -// MARK: Array length operations - -#if arch(wasm32) -@_extern(wasm, module: "bjs", name: "swift_js_push_array_length") -@_spi(BridgeJS) public func _swift_js_push_array_length(_ length: Int32) -#else -@_spi(BridgeJS) public func _swift_js_push_array_length(_ length: Int32) { - _onlyAvailableOnWasm() -} -#endif - -#if arch(wasm32) -@_extern(wasm, module: "bjs", name: "swift_js_pop_param_array_length") -@_spi(BridgeJS) public func _swift_js_pop_param_array_length() -> Int32 -#else -@_spi(BridgeJS) public func _swift_js_pop_param_array_length() -> Int32 { +@_spi(BridgeJS) public func _swift_js_pop_f64() -> Float64 { _onlyAvailableOnWasm() } #endif @@ -704,10 +684,10 @@ func _swift_js_return_optional_double(_ isSome: Int32, _ value: Float64) { #endif #if arch(wasm32) -@_extern(wasm, module: "bjs", name: "swift_js_pop_param_pointer") -@_spi(BridgeJS) public func _swift_js_pop_param_pointer() -> UnsafeMutableRawPointer +@_extern(wasm, module: "bjs", name: "swift_js_pop_pointer") +@_spi(BridgeJS) public func _swift_js_pop_pointer() -> UnsafeMutableRawPointer #else -@_spi(BridgeJS) public func _swift_js_pop_param_pointer() -> UnsafeMutableRawPointer { +@_spi(BridgeJS) public func _swift_js_pop_pointer() -> UnsafeMutableRawPointer { _onlyAvailableOnWasm() } #endif @@ -1511,10 +1491,10 @@ extension Optional where Wrapped: _BridgedSwiftStruct { @_spi(BridgeJS) public consuming func bridgeJSLowerReturn() -> Void { switch consume self { case .none: - _swift_js_push_int(0) // Push only isSome=0 (no struct fields) + _swift_js_push_i32(0) // Push only isSome=0 (no struct fields) case .some(let value): value.bridgeJSLowerReturn() // Push all struct fields FIRST - _swift_js_push_int(1) // Then push isSome=1 LAST (so it's popped FIRST by JS) + _swift_js_push_i32(1) // Then push isSome=1 LAST (so it's popped FIRST by JS) } } } diff --git a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift index 948b454c..35a53805 100644 --- a/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift +++ b/Tests/BridgeJSRuntimeTests/Generated/BridgeJS.swift @@ -1438,15 +1438,15 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .flag(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) case 3: - return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_param_f32())) + return .rate(Float.bridgeJSLiftParameter(_swift_js_pop_f32())) case 4: - return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + return .precise(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) case 5: return .info default: @@ -1465,10 +1465,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } return Int32(0) case .failure(let param0): - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) return Int32(1) case .flag(let param0): - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) return Int32(2) case .rate(let param0): _swift_js_push_f32(param0) @@ -1501,10 +1501,10 @@ extension APIResult: _BridgedSwiftAssociatedValueEnum { } case .failure(let param0): _swift_js_push_tag(Int32(1)) - _swift_js_push_int(Int32(param0)) + _swift_js_push_i32(Int32(param0)) case .flag(let param0): _swift_js_push_tag(Int32(2)) - _swift_js_push_int(param0 ? 1 : 0) + _swift_js_push_i32(param0 ? 1 : 0) case .rate(let param0): _swift_js_push_tag(Int32(3)) _swift_js_push_f32(param0) @@ -1521,17 +1521,17 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> ComplexResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .error(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .error(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .location(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .location(Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 3: - return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 4: - return .coordinates(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + return .coordinates(Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64())) case 5: - return .comprehensive(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .comprehensive(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), Double.bridgeJSLiftParameter(_swift_js_pop_f64()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 6: return .info default: @@ -1554,7 +1554,7 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) return Int32(1) case .location(let param0, let param1, let param2): _swift_js_push_f64(param0) @@ -1565,8 +1565,8 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { } return Int32(2) case .status(let param0, let param1, let param2): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -1578,10 +1578,10 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_f64(param2) return Int32(4) case .comprehensive(let param0, let param1, let param2, let param3, let param4, let param5, let param6, let param7, let param8): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(param1 ? 1 : 0) - _swift_js_push_int(Int32(param2)) - _swift_js_push_int(Int32(param3)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(param1 ? 1 : 0) + _swift_js_push_i32(Int32(param2)) + _swift_js_push_i32(Int32(param3)) _swift_js_push_f64(param4) _swift_js_push_f64(param5) var __bjs_param6 = param6 @@ -1626,7 +1626,7 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) case .location(let param0, let param1, let param2): _swift_js_push_tag(Int32(2)) _swift_js_push_f64(param0) @@ -1637,8 +1637,8 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { } case .status(let param0, let param1, let param2): _swift_js_push_tag(Int32(3)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -1650,10 +1650,10 @@ extension ComplexResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_f64(param2) case .comprehensive(let param0, let param1, let param2, let param3, let param4, let param5, let param6, let param7, let param8): _swift_js_push_tag(Int32(5)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(param1 ? 1 : 0) - _swift_js_push_int(Int32(param2)) - _swift_js_push_int(Int32(param3)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(param1 ? 1 : 0) + _swift_js_push_i32(Int32(param2)) + _swift_js_push_i32(Int32(param3)) _swift_js_push_f64(param4) _swift_js_push_f64(param5) var __bjs_param6 = param6 @@ -1678,11 +1678,11 @@ extension Utilities.Result: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> Utilities.Result { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32())) case 2: - return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()), String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .status(Bool.bridgeJSLiftParameter(_swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32()), String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) default: fatalError("Unknown Utilities.Result case ID: \(caseId)") } @@ -1703,11 +1703,11 @@ extension Utilities.Result: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) return Int32(1) case .status(let param0, let param1, let param2): - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -1740,11 +1740,11 @@ extension Utilities.Result: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) case .status(let param0, let param1, let param2): _swift_js_push_tag(Int32(2)) - _swift_js_push_int(param0 ? 1 : 0) - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(param0 ? 1 : 0) + _swift_js_push_i32(Int32(param1)) var __bjs_param2 = param2 __bjs_param2.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) @@ -1757,9 +1757,9 @@ extension API.NetworkingResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> API.NetworkingResult { switch caseId { case 0: - return .success(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + return .failure(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Int.bridgeJSLiftParameter(_swift_js_pop_i32())) default: fatalError("Unknown API.NetworkingResult case ID: \(caseId)") } @@ -1780,7 +1780,7 @@ extension API.NetworkingResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) return Int32(1) } } @@ -1809,7 +1809,7 @@ extension API.NetworkingResult: _BridgedSwiftAssociatedValueEnum { __bjs_param0.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(param1)) + _swift_js_push_i32(Int32(param1)) } } } @@ -1818,11 +1818,11 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { private static func _bridgeJSLiftFromCaseId(_ caseId: Int32) -> APIOptionalResult { switch caseId { case 0: - return .success(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .success(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())) case 1: - return .failure(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .failure(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) case 2: - return .status(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()), Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + return .status(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()), Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())) default: fatalError("Unknown APIOptionalResult case ID: \(caseId)") } @@ -1840,31 +1840,31 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) return Int32(0) case .failure(let param0, let param1): let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(Int32(__bjs_unwrapped_param0)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param0)) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(__bjs_unwrapped_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param1 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) return Int32(1) case .status(let param0, let param1, let param2): let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(__bjs_unwrapped_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param0 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(Int32(__bjs_unwrapped_param1)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param1)) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) let __bjs_isSome_param2 = param2 != nil if let __bjs_unwrapped_param2 = param2 { var __bjs_str_param2 = __bjs_unwrapped_param2 @@ -1872,7 +1872,7 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param2 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param2 ? 1 : 0) return Int32(2) } } @@ -1898,31 +1898,31 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) case .failure(let param0, let param1): _swift_js_push_tag(Int32(1)) let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(Int32(__bjs_unwrapped_param0)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param0)) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(__bjs_unwrapped_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param1 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) case .status(let param0, let param1, let param2): _swift_js_push_tag(Int32(2)) let __bjs_isSome_param0 = param0 != nil if let __bjs_unwrapped_param0 = param0 { - _swift_js_push_int(__bjs_unwrapped_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_param0 ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_param0 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param0 ? 1 : 0) let __bjs_isSome_param1 = param1 != nil if let __bjs_unwrapped_param1 = param1 { - _swift_js_push_int(Int32(__bjs_unwrapped_param1)) + _swift_js_push_i32(Int32(__bjs_unwrapped_param1)) } - _swift_js_push_int(__bjs_isSome_param1 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param1 ? 1 : 0) let __bjs_isSome_param2 = param2 != nil if let __bjs_unwrapped_param2 = param2 { var __bjs_str_param2 = __bjs_unwrapped_param2 @@ -1930,7 +1930,7 @@ extension APIOptionalResult: _BridgedSwiftAssociatedValueEnum { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_param2 ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_param2 ? 1 : 0) } } } @@ -2220,14 +2220,14 @@ public func _bjs_StaticPropertyNamespace_NestedProperties_static_nestedDouble_se extension Point: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Point { - let y = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let x = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let y = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let x = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return Point(x: x, y: y) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.x)) - _swift_js_push_int(Int32(self.y)) + _swift_js_push_i32(Int32(self.x)) + _swift_js_push_i32(Int32(self.y)) } init(unsafelyCopying jsObject: JSObject) { @@ -2265,11 +2265,11 @@ fileprivate func _bjs_struct_lift_Point() -> Int32 { extension PointerFields: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> PointerFields { - let mutPtr = UnsafeMutablePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let ptr = UnsafePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let opaque = OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let mutRaw = UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) - let raw = UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer()) + let mutPtr = UnsafeMutablePointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let ptr = UnsafePointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let opaque = OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let mutRaw = UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) + let raw = UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer()) return PointerFields(raw: raw, mutRaw: mutRaw, opaque: opaque, ptr: ptr, mutPtr: mutPtr) } @@ -2327,11 +2327,11 @@ public func _bjs_PointerFields_init(_ raw: UnsafeMutableRawPointer, _ mutRaw: Un extension DataPoint: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> DataPoint { - let optFlag = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let optCount = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let label = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let y = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) - let x = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) + let optFlag = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let optCount = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let label = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let y = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) + let x = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) return DataPoint(x: x, y: y, label: label, optCount: optCount, optFlag: optFlag) } @@ -2344,14 +2344,14 @@ extension DataPoint: _BridgedSwiftStruct { } let __bjs_isSome_optCount = self.optCount != nil if let __bjs_unwrapped_optCount = self.optCount { - _swift_js_push_int(Int32(__bjs_unwrapped_optCount)) + _swift_js_push_i32(Int32(__bjs_unwrapped_optCount)) } - _swift_js_push_int(__bjs_isSome_optCount ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_optCount ? 1 : 0) let __bjs_isSome_optFlag = self.optFlag != nil if let __bjs_unwrapped_optFlag = self.optFlag { - _swift_js_push_int(__bjs_unwrapped_optFlag ? 1 : 0) + _swift_js_push_i32(__bjs_unwrapped_optFlag ? 1 : 0) } - _swift_js_push_int(__bjs_isSome_optFlag ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_optFlag ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2400,9 +2400,9 @@ public func _bjs_DataPoint_init(_ x: Float64, _ y: Float64, _ labelBytes: Int32, extension Address: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Address { - let zipCode = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let city = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let street = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let zipCode = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let city = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let street = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Address(street: street, city: city, zipCode: zipCode) } @@ -2417,9 +2417,9 @@ extension Address: _BridgedSwiftStruct { } let __bjs_isSome_zipCode = self.zipCode != nil if let __bjs_unwrapped_zipCode = self.zipCode { - _swift_js_push_int(Int32(__bjs_unwrapped_zipCode)) + _swift_js_push_i32(Int32(__bjs_unwrapped_zipCode)) } - _swift_js_push_int(__bjs_isSome_zipCode ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_zipCode ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2457,11 +2457,11 @@ fileprivate func _bjs_struct_lift_Address() -> Int32 { extension Contact: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Contact { - let secondaryAddress = Optional
.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let email = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let secondaryAddress = Optional
.bridgeJSLiftParameter(_swift_js_pop_i32()) + let email = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32()) let address = Address.bridgeJSLiftParameter() - let age = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let name = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let age = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let name = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Contact(name: name, age: age, address: address, email: email, secondaryAddress: secondaryAddress) } @@ -2470,7 +2470,7 @@ extension Contact: _BridgedSwiftStruct { __bjs_name.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.age)) + _swift_js_push_i32(Int32(self.age)) self.address.bridgeJSLowerReturn() let __bjs_isSome_email = self.email != nil if let __bjs_unwrapped_email = self.email { @@ -2479,12 +2479,12 @@ extension Contact: _BridgedSwiftStruct { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_email ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_email ? 1 : 0) let __bjs_isSome_secondaryAddress = self.secondaryAddress != nil if let __bjs_unwrapped_secondaryAddress = self.secondaryAddress { __bjs_unwrapped_secondaryAddress.bridgeJSLowerReturn() } - _swift_js_push_int(__bjs_isSome_secondaryAddress ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_secondaryAddress ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2522,10 +2522,10 @@ fileprivate func _bjs_struct_lift_Contact() -> Int32 { extension Config: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> Config { - let status = Status.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let direction = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let theme = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let name = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let status = Status.bridgeJSLiftParameter(_swift_js_pop_i32()) + let direction = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let theme = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32()) + let name = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return Config(name: name, theme: theme, direction: direction, status: status) } @@ -2541,13 +2541,13 @@ extension Config: _BridgedSwiftStruct { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_theme ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_theme ? 1 : 0) let __bjs_isSome_direction = self.direction != nil if let __bjs_unwrapped_direction = self.direction { - _swift_js_push_int(__bjs_unwrapped_direction.bridgeJSLowerParameter()) + _swift_js_push_i32(__bjs_unwrapped_direction.bridgeJSLowerParameter()) } - _swift_js_push_int(__bjs_isSome_direction ? 1 : 0) - _swift_js_push_int(Int32(self.status.bridgeJSLowerParameter())) + _swift_js_push_i32(__bjs_isSome_direction ? 1 : 0) + _swift_js_push_i32(Int32(self.status.bridgeJSLowerParameter())) } init(unsafelyCopying jsObject: JSObject) { @@ -2585,18 +2585,18 @@ fileprivate func _bjs_struct_lift_Config() -> Int32 { extension SessionData: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> SessionData { - let owner = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_pointer()) - let id = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let owner = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_pointer()) + let id = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return SessionData(id: id, owner: owner) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.id)) + _swift_js_push_i32(Int32(self.id)) let __bjs_isSome_owner = self.owner != nil if let __bjs_unwrapped_owner = self.owner { _swift_js_push_pointer(__bjs_unwrapped_owner.bridgeJSLowerReturn()) } - _swift_js_push_int(__bjs_isSome_owner ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_owner ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2634,26 +2634,26 @@ fileprivate func _bjs_struct_lift_SessionData() -> Int32 { extension ValidationReport: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> ValidationReport { - let outcome = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let status = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let result = APIResult.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let id = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let outcome = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let status = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let result = APIResult.bridgeJSLiftParameter(_swift_js_pop_i32()) + let id = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return ValidationReport(id: id, result: result, status: status, outcome: outcome) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.id)) + _swift_js_push_i32(Int32(self.id)) self.result.bridgeJSLowerReturn() let __bjs_isSome_status = self.status != nil if let __bjs_unwrapped_status = self.status { - _swift_js_push_int(__bjs_unwrapped_status.bridgeJSLowerParameter()) + _swift_js_push_i32(__bjs_unwrapped_status.bridgeJSLowerParameter()) } - _swift_js_push_int(__bjs_isSome_status ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_status ? 1 : 0) let __bjs_isSome_outcome = self.outcome != nil if let __bjs_unwrapped_outcome = self.outcome { - _swift_js_push_int(__bjs_unwrapped_outcome.bridgeJSLowerParameter()) + _swift_js_push_i32(__bjs_unwrapped_outcome.bridgeJSLowerParameter()) } - _swift_js_push_int(__bjs_isSome_outcome ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_outcome ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2691,52 +2691,52 @@ fileprivate func _bjs_struct_lift_ValidationReport() -> Int32 { extension AdvancedConfig: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> AdvancedConfig { - let overrideDefaults = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let overrideDefaults = Optional.bridgeJSLiftParameter(_swift_js_pop_i32()) let defaults = ConfigStruct.bridgeJSLiftParameter() - let location = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let metadata = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let result = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let status = Status.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let theme = Theme.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let enabled = Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let title = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let id = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let location = Optional.bridgeJSLiftParameter(_swift_js_pop_i32()) + let metadata = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let result = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let status = Status.bridgeJSLiftParameter(_swift_js_pop_i32()) + let theme = Theme.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let enabled = Bool.bridgeJSLiftParameter(_swift_js_pop_i32()) + let title = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) + let id = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return AdvancedConfig(id: id, title: title, enabled: enabled, theme: theme, status: status, result: result, metadata: metadata, location: location, defaults: defaults, overrideDefaults: overrideDefaults) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.id)) + _swift_js_push_i32(Int32(self.id)) var __bjs_title = self.title __bjs_title.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(self.enabled ? 1 : 0) + _swift_js_push_i32(self.enabled ? 1 : 0) var __bjs_theme = self.theme.rawValue __bjs_theme.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.status.bridgeJSLowerParameter())) + _swift_js_push_i32(Int32(self.status.bridgeJSLowerParameter())) let __bjs_isSome_result = self.result != nil if let __bjs_unwrapped_result = self.result { - _swift_js_push_int(__bjs_unwrapped_result.bridgeJSLowerParameter()) + _swift_js_push_i32(__bjs_unwrapped_result.bridgeJSLowerParameter()) } - _swift_js_push_int(__bjs_isSome_result ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_result ? 1 : 0) let __bjs_isSome_metadata = self.metadata != nil if let __bjs_unwrapped_metadata = self.metadata { - _swift_js_push_int(__bjs_unwrapped_metadata.bridgeJSLowerReturn()) + _swift_js_push_i32(__bjs_unwrapped_metadata.bridgeJSLowerReturn()) } - _swift_js_push_int(__bjs_isSome_metadata ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_metadata ? 1 : 0) let __bjs_isSome_location = self.location != nil if let __bjs_unwrapped_location = self.location { __bjs_unwrapped_location.bridgeJSLowerReturn() } - _swift_js_push_int(__bjs_isSome_location ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_location ? 1 : 0) self.defaults.bridgeJSLowerReturn() let __bjs_isSome_overrideDefaults = self.overrideDefaults != nil if let __bjs_unwrapped_overrideDefaults = self.overrideDefaults { __bjs_unwrapped_overrideDefaults.bridgeJSLowerReturn() } - _swift_js_push_int(__bjs_isSome_overrideDefaults ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_overrideDefaults ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2774,10 +2774,10 @@ fileprivate func _bjs_struct_lift_AdvancedConfig() -> Int32 { extension MeasurementConfig: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> MeasurementConfig { - let optionalRatio = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_f64()) - let optionalPrecision = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_f32()) - let ratio = Ratio.bridgeJSLiftParameter(_swift_js_pop_param_f64()) - let precision = Precision.bridgeJSLiftParameter(_swift_js_pop_param_f32()) + let optionalRatio = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_f64()) + let optionalPrecision = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_f32()) + let ratio = Ratio.bridgeJSLiftParameter(_swift_js_pop_f64()) + let precision = Precision.bridgeJSLiftParameter(_swift_js_pop_f32()) return MeasurementConfig(precision: precision, ratio: ratio, optionalPrecision: optionalPrecision, optionalRatio: optionalRatio) } @@ -2788,12 +2788,12 @@ extension MeasurementConfig: _BridgedSwiftStruct { if let __bjs_unwrapped_optionalPrecision = self.optionalPrecision { _swift_js_push_f32(__bjs_unwrapped_optionalPrecision.bridgeJSLowerParameter()) } - _swift_js_push_int(__bjs_isSome_optionalPrecision ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_optionalPrecision ? 1 : 0) let __bjs_isSome_optionalRatio = self.optionalRatio != nil if let __bjs_unwrapped_optionalRatio = self.optionalRatio { _swift_js_push_f64(__bjs_unwrapped_optionalRatio.bridgeJSLowerParameter()) } - _swift_js_push_int(__bjs_isSome_optionalRatio ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_optionalRatio ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2831,7 +2831,7 @@ fileprivate func _bjs_struct_lift_MeasurementConfig() -> Int32 { extension MathOperations: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> MathOperations { - let baseValue = Double.bridgeJSLiftParameter(_swift_js_pop_param_f64()) + let baseValue = Double.bridgeJSLiftParameter(_swift_js_pop_f64()) return MathOperations(baseValue: baseValue) } @@ -2918,13 +2918,13 @@ public func _bjs_MathOperations_static_subtract(_ a: Float64, _ b: Float64) -> F extension CopyableCart: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> CopyableCart { - let note = Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32()) - let x = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let note = Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32()) + let x = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return CopyableCart(x: x, note: note) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.x)) + _swift_js_push_i32(Int32(self.x)) let __bjs_isSome_note = self.note != nil if let __bjs_unwrapped_note = self.note { var __bjs_str_note = __bjs_unwrapped_note @@ -2932,7 +2932,7 @@ extension CopyableCart: _BridgedSwiftStruct { _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } } - _swift_js_push_int(__bjs_isSome_note ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_note ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -2981,8 +2981,8 @@ public func _bjs_CopyableCart_static_fromJSObject(_ object: Int32) -> Void { extension CopyableCartItem: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> CopyableCartItem { - let quantity = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let sku = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let quantity = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let sku = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return CopyableCartItem(sku: sku, quantity: quantity) } @@ -2991,7 +2991,7 @@ extension CopyableCartItem: _BridgedSwiftStruct { __bjs_sku.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.quantity)) + _swift_js_push_i32(Int32(self.quantity)) } init(unsafelyCopying jsObject: JSObject) { @@ -3029,20 +3029,20 @@ fileprivate func _bjs_struct_lift_CopyableCartItem() -> Int32 { extension CopyableNestedCart: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> CopyableNestedCart { - let shippingAddress = Optional
.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let shippingAddress = Optional
.bridgeJSLiftParameter(_swift_js_pop_i32()) let item = CopyableCartItem.bridgeJSLiftParameter() - let id = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) + let id = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) return CopyableNestedCart(id: id, item: item, shippingAddress: shippingAddress) } @_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() { - _swift_js_push_int(Int32(self.id)) + _swift_js_push_i32(Int32(self.id)) self.item.bridgeJSLowerReturn() let __bjs_isSome_shippingAddress = self.shippingAddress != nil if let __bjs_unwrapped_shippingAddress = self.shippingAddress { __bjs_unwrapped_shippingAddress.bridgeJSLowerReturn() } - _swift_js_push_int(__bjs_isSome_shippingAddress ? 1 : 0) + _swift_js_push_i32(__bjs_isSome_shippingAddress ? 1 : 0) } init(unsafelyCopying jsObject: JSObject) { @@ -3091,8 +3091,8 @@ public func _bjs_CopyableNestedCart_static_fromJSObject(_ object: Int32) -> Void extension ConfigStruct: _BridgedSwiftStruct { @_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter() -> ConfigStruct { - let value = Int.bridgeJSLiftParameter(_swift_js_pop_param_int32()) - let name = String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32()) + let value = Int.bridgeJSLiftParameter(_swift_js_pop_i32()) + let name = String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32()) return ConfigStruct(name: name, value: value) } @@ -3101,7 +3101,7 @@ extension ConfigStruct: _BridgedSwiftStruct { __bjs_name.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) } - _swift_js_push_int(Int32(self.value)) + _swift_js_push_i32(Int32(self.value)) } init(unsafelyCopying jsObject: JSObject) { @@ -4567,11 +4567,11 @@ public func _bjs_testEmptyInit(_ object: UnsafeMutableRawPointer) -> UnsafeMutab public func _bjs_arrayWithDefault() -> Int32 { #if arch(wasm32) let ret = arrayWithDefault(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -4591,11 +4591,11 @@ public func _bjs_arrayWithOptionalDefault(_ values: Int32) -> Int32 { return Optional<[Int]>.none } else { return { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -4613,11 +4613,11 @@ public func _bjs_arrayWithOptionalDefault(_ values: Int32) -> Int32 { public func _bjs_arrayMixedDefaults(_ prefixBytes: Int32, _ prefixLength: Int32, _ suffixBytes: Int32, _ suffixLength: Int32) -> Void { #if arch(wasm32) let ret = arrayMixedDefaults(prefix: String.bridgeJSLiftParameter(prefixBytes, prefixLength), values: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -4666,18 +4666,18 @@ public func _bjs_makeAdder(_ base: Int32) -> UnsafeMutableRawPointer { public func _bjs_roundTripIntArray() -> Void { #if arch(wasm32) let ret = roundTripIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4688,11 +4688,11 @@ public func _bjs_roundTripIntArray() -> Void { public func _bjs_roundTripStringArray() -> Void { #if arch(wasm32) let ret = roundTripStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -4702,7 +4702,7 @@ public func _bjs_roundTripStringArray() -> Void { __bjs_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4713,18 +4713,18 @@ public func _bjs_roundTripStringArray() -> Void { public func _bjs_roundTripDoubleArray() -> Void { #if arch(wasm32) let ret = roundTripDoubleArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Double] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_f64(__bjs_elem_ret)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4735,18 +4735,18 @@ public func _bjs_roundTripDoubleArray() -> Void { public func _bjs_roundTripBoolArray() -> Void { #if arch(wasm32) let ret = roundTripBoolArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Bool] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(__bjs_elem_ret ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_elem_ret ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4757,18 +4757,18 @@ public func _bjs_roundTripBoolArray() -> Void { public func _bjs_roundTripDirectionArray() -> Void { #if arch(wasm32) let ret = roundTripDirectionArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Direction] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Direction.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Direction.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4779,18 +4779,18 @@ public func _bjs_roundTripDirectionArray() -> Void { public func _bjs_roundTripStatusArray() -> Void { #if arch(wasm32) let ret = roundTripStatusArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Status] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Status.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Status.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4801,11 +4801,11 @@ public func _bjs_roundTripStatusArray() -> Void { public func _bjs_roundTripThemeArray() -> Void { #if arch(wasm32) let ret = roundTripThemeArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Theme] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Theme.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Theme.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -4815,7 +4815,7 @@ public func _bjs_roundTripThemeArray() -> Void { __bjs_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4826,18 +4826,18 @@ public func _bjs_roundTripThemeArray() -> Void { public func _bjs_roundTripHttpStatusArray() -> Void { #if arch(wasm32) let ret = roundTripHttpStatusArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [HttpStatus] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(HttpStatus.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(HttpStatus.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.bridgeJSLowerParameter()))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4848,7 +4848,7 @@ public func _bjs_roundTripHttpStatusArray() -> Void { public func _bjs_roundTripDataPointArray() -> Void { #if arch(wasm32) let ret = roundTripDataPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [DataPoint] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -4859,7 +4859,7 @@ public func _bjs_roundTripDataPointArray() -> Void { }()) for __bjs_elem_ret in ret { __bjs_elem_ret.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4870,18 +4870,18 @@ public func _bjs_roundTripDataPointArray() -> Void { public func _bjs_roundTripGreeterArray() -> Void { #if arch(wasm32) let ret = roundTripGreeterArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Greeter] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Greeter.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(Greeter.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4892,11 +4892,11 @@ public func _bjs_roundTripGreeterArray() -> Void { public func _bjs_roundTripOptionalIntArray() -> Void { #if arch(wasm32) let ret = roundTripOptionalIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -4904,9 +4904,9 @@ public func _bjs_roundTripOptionalIntArray() -> Void { for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_unwrapped_ret_elem))} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_unwrapped_ret_elem))} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4917,11 +4917,11 @@ public func _bjs_roundTripOptionalIntArray() -> Void { public func _bjs_roundTripOptionalStringArray() -> Void { #if arch(wasm32) let ret = roundTripOptionalStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -4933,8 +4933,8 @@ public func _bjs_roundTripOptionalStringArray() -> Void { __bjs_str_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4945,11 +4945,11 @@ public func _bjs_roundTripOptionalStringArray() -> Void { public func _bjs_roundTripOptionalDataPointArray() -> Void { #if arch(wasm32) let ret = roundTripOptionalDataPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -4958,8 +4958,8 @@ public func _bjs_roundTripOptionalDataPointArray() -> Void { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { __bjs_unwrapped_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4970,11 +4970,11 @@ public func _bjs_roundTripOptionalDataPointArray() -> Void { public func _bjs_roundTripOptionalDirectionArray() -> Void { #if arch(wasm32) let ret = roundTripOptionalDirectionArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -4982,9 +4982,9 @@ public func _bjs_roundTripOptionalDirectionArray() -> Void { for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -4995,11 +4995,11 @@ public func _bjs_roundTripOptionalDirectionArray() -> Void { public func _bjs_roundTripOptionalStatusArray() -> Void { #if arch(wasm32) let ret = roundTripOptionalStatusArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Optional] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(Optional.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -5007,9 +5007,9 @@ public func _bjs_roundTripOptionalStatusArray() -> Void { for __bjs_elem_ret in ret { let __bjs_isSome_ret_elem = __bjs_elem_ret != nil if let __bjs_unwrapped_ret_elem = __bjs_elem_ret { - _swift_js_push_int(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} - _swift_js_push_int(__bjs_isSome_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_unwrapped_ret_elem.bridgeJSLowerParameter())} + _swift_js_push_i32(__bjs_isSome_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5024,11 +5024,11 @@ public func _bjs_roundTripOptionalIntArrayType(_ values: Int32) -> Void { return Optional<[Int]>.none } else { return { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -5038,9 +5038,9 @@ public func _bjs_roundTripOptionalIntArrayType(_ values: Int32) -> Void { let __bjs_isSome_ret = ret != nil if let __bjs_unwrapped_ret = ret { for __bjs_elem_ret in __bjs_unwrapped_ret { - _swift_js_push_int(Int32(__bjs_elem_ret))} - _swift_js_push_array_length(Int32(__bjs_unwrapped_ret.count))} - _swift_js_push_int(__bjs_isSome_ret ? 1 : 0) + _swift_js_push_i32(Int32(__bjs_elem_ret))} + _swift_js_push_i32(Int32(__bjs_unwrapped_ret.count))} + _swift_js_push_i32(__bjs_isSome_ret ? 1 : 0) #else fatalError("Only available on WebAssembly") #endif @@ -5055,11 +5055,11 @@ public func _bjs_roundTripOptionalStringArrayType(_ values: Int32) -> Void { return Optional<[String]>.none } else { return { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -5073,8 +5073,8 @@ public func _bjs_roundTripOptionalStringArrayType(_ values: Int32) -> Void { __bjs_ret_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(__bjs_unwrapped_ret.count))} - _swift_js_push_int(__bjs_isSome_ret ? 1 : 0) + _swift_js_push_i32(Int32(__bjs_unwrapped_ret.count))} + _swift_js_push_i32(__bjs_isSome_ret ? 1 : 0) #else fatalError("Only available on WebAssembly") #endif @@ -5089,11 +5089,11 @@ public func _bjs_roundTripOptionalGreeterArrayType(_ greeters: Int32) -> Void { return Optional<[Greeter]>.none } else { return { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Greeter] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Greeter.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(Greeter.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result @@ -5104,8 +5104,8 @@ public func _bjs_roundTripOptionalGreeterArrayType(_ greeters: Int32) -> Void { if let __bjs_unwrapped_ret = ret { for __bjs_elem_ret in __bjs_unwrapped_ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(__bjs_unwrapped_ret.count))} - _swift_js_push_int(__bjs_isSome_ret ? 1 : 0) + _swift_js_push_i32(Int32(__bjs_unwrapped_ret.count))} + _swift_js_push_i32(__bjs_isSome_ret ? 1 : 0) #else fatalError("Only available on WebAssembly") #endif @@ -5116,16 +5116,16 @@ public func _bjs_roundTripOptionalGreeterArrayType(_ greeters: Int32) -> Void { public func _bjs_roundTripNestedIntArray() -> Void { #if arch(wasm32) let ret = roundTripNestedIntArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Int]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Int] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Int.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -5136,9 +5136,9 @@ public func _bjs_roundTripNestedIntArray() -> Void { }()) for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_elem_ret_elem))} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret_elem))} + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5149,16 +5149,16 @@ public func _bjs_roundTripNestedIntArray() -> Void { public func _bjs_roundTripNestedStringArray() -> Void { #if arch(wasm32) let ret = roundTripNestedStringArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[String]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [String] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(String.bridgeJSLiftParameter(_swift_js_pop_param_int32(), _swift_js_pop_param_int32())) + __result.append(String.bridgeJSLiftParameter(_swift_js_pop_i32(), _swift_js_pop_i32())) } __result.reverse() return __result @@ -5173,8 +5173,8 @@ public func _bjs_roundTripNestedStringArray() -> Void { __bjs_ret_elem_elem.withUTF8 { ptr in _swift_js_push_string(ptr.baseAddress, Int32(ptr.count)) }} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5185,16 +5185,16 @@ public func _bjs_roundTripNestedStringArray() -> Void { public func _bjs_roundTripNestedDoubleArray() -> Void { #if arch(wasm32) let ret = roundTripNestedDoubleArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Double]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Double] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_param_f64())) + __result.append(Double.bridgeJSLiftParameter(_swift_js_pop_f64())) } __result.reverse() return __result @@ -5206,8 +5206,8 @@ public func _bjs_roundTripNestedDoubleArray() -> Void { for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { _swift_js_push_f64(__bjs_elem_ret_elem)} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5218,16 +5218,16 @@ public func _bjs_roundTripNestedDoubleArray() -> Void { public func _bjs_roundTripNestedBoolArray() -> Void { #if arch(wasm32) let ret = roundTripNestedBoolArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Bool]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Bool] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Bool.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -5238,9 +5238,9 @@ public func _bjs_roundTripNestedBoolArray() -> Void { }()) for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { - _swift_js_push_int(__bjs_elem_ret_elem ? 1 : 0)} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(__bjs_elem_ret_elem ? 1 : 0)} + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5251,12 +5251,12 @@ public func _bjs_roundTripNestedBoolArray() -> Void { public func _bjs_roundTripNestedDataPointArray() -> Void { #if arch(wasm32) let ret = roundTripNestedDataPointArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[DataPoint]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [DataPoint] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { @@ -5272,8 +5272,8 @@ public func _bjs_roundTripNestedDataPointArray() -> Void { for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { __bjs_elem_ret_elem.bridgeJSLowerReturn()} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5284,16 +5284,16 @@ public func _bjs_roundTripNestedDataPointArray() -> Void { public func _bjs_roundTripNestedDirectionArray() -> Void { #if arch(wasm32) let ret = roundTripNestedDirectionArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Direction]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Direction] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Direction.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(Direction.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -5304,9 +5304,9 @@ public func _bjs_roundTripNestedDirectionArray() -> Void { }()) for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { - _swift_js_push_int(Int32(__bjs_elem_ret_elem.bridgeJSLowerParameter()))} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret_elem.bridgeJSLowerParameter()))} + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5317,16 +5317,16 @@ public func _bjs_roundTripNestedDirectionArray() -> Void { public func _bjs_roundTripNestedGreeterArray() -> Void { #if arch(wasm32) let ret = roundTripNestedGreeterArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [[Greeter]] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { __result.append({ - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [Greeter] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(Greeter.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(Greeter.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result @@ -5338,8 +5338,8 @@ public func _bjs_roundTripNestedGreeterArray() -> Void { for __bjs_elem_ret in ret { for __bjs_elem_ret_elem in __bjs_elem_ret { _swift_js_push_pointer(__bjs_elem_ret_elem.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(__bjs_elem_ret.count))} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(__bjs_elem_ret.count))} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5350,18 +5350,18 @@ public func _bjs_roundTripNestedGreeterArray() -> Void { public func _bjs_roundTripUnsafeRawPointerArray() -> Void { #if arch(wasm32) let ret = roundTripUnsafeRawPointerArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [UnsafeRawPointer] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(UnsafeRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5372,18 +5372,18 @@ public func _bjs_roundTripUnsafeRawPointerArray() -> Void { public func _bjs_roundTripUnsafeMutableRawPointerArray() -> Void { #if arch(wasm32) let ret = roundTripUnsafeMutableRawPointerArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [UnsafeMutableRawPointer] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(UnsafeMutableRawPointer.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5394,18 +5394,18 @@ public func _bjs_roundTripUnsafeMutableRawPointerArray() -> Void { public func _bjs_roundTripOpaquePointerArray() -> Void { #if arch(wasm32) let ret = roundTripOpaquePointerArray(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [OpaquePointer] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_param_pointer())) + __result.append(OpaquePointer.bridgeJSLiftParameter(_swift_js_pop_pointer())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { _swift_js_push_pointer(__bjs_elem_ret.bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif @@ -5416,11 +5416,11 @@ public func _bjs_roundTripOpaquePointerArray() -> Void { public func _bjs_consumeDataProcessorArrayType() -> Int32 { #if arch(wasm32) let ret = consumeDataProcessorArrayType(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [AnyDataProcessor] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(AnyDataProcessor.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(AnyDataProcessor.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result @@ -5436,18 +5436,18 @@ public func _bjs_consumeDataProcessorArrayType() -> Int32 { public func _bjs_roundTripDataProcessorArrayType() -> Void { #if arch(wasm32) let ret = roundTripDataProcessorArrayType(_: { - let __count = Int(_swift_js_pop_param_array_length()) + let __count = Int(_swift_js_pop_i32()) var __result: [AnyDataProcessor] = [] __result.reserveCapacity(__count) for _ in 0 ..< __count { - __result.append(AnyDataProcessor.bridgeJSLiftParameter(_swift_js_pop_param_int32())) + __result.append(AnyDataProcessor.bridgeJSLiftParameter(_swift_js_pop_i32())) } __result.reverse() return __result }()) for __bjs_elem_ret in ret { - _swift_js_push_int((__bjs_elem_ret as! AnyDataProcessor).bridgeJSLowerReturn())} - _swift_js_push_array_length(Int32(ret.count)) + _swift_js_push_i32((__bjs_elem_ret as! AnyDataProcessor).bridgeJSLowerReturn())} + _swift_js_push_i32(Int32(ret.count)) #else fatalError("Only available on WebAssembly") #endif