@@ -1736,6 +1736,67 @@ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11
17361736 #endif
17371737}
17381738
1739+ #if arch(wasm32)
1740+ @_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y")
1741+ fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y_extern(_ callback: Int32, _ param0: Int32) -> Void
1742+ #else
1743+ fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y_extern(_ callback: Int32, _ param0: Int32) -> Void {
1744+ fatalError("Only available on WebAssembly")
1745+ }
1746+ #endif
1747+ @inline(never) fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y(_ callback: Int32, _ param0: Int32) -> Void {
1748+ return invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y_extern(callback, param0)
1749+ }
1750+
1751+ #if arch(wasm32)
1752+ @_extern(wasm, module: "bjs", name: "make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y")
1753+ fileprivate func make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer<UInt8>, _ line: UInt32) -> Int32
1754+ #else
1755+ fileprivate func make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y_extern(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer<UInt8>, _ line: UInt32) -> Int32 {
1756+ fatalError("Only available on WebAssembly")
1757+ }
1758+ #endif
1759+ @inline(never) fileprivate func make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y(_ boxPtr: UnsafeMutableRawPointer, _ file: UnsafePointer<UInt8>, _ line: UInt32) -> Int32 {
1760+ return make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y_extern(boxPtr, file, line)
1761+ }
1762+
1763+ private enum _BJS_Closure_20BridgeJSRuntimeTestss11WeatherDataC_y {
1764+ static func bridgeJSLift(_ callbackId: Int32) -> (sending WeatherData) -> Void {
1765+ let callback = JSObject.bridgeJSLiftParameter(callbackId)
1766+ return { [callback] param0 in
1767+ #if arch(wasm32)
1768+ let callbackValue = callback.bridgeJSLowerParameter()
1769+ let param0Value = param0.bridgeJSLowerParameter()
1770+ invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y(callbackValue, param0Value)
1771+ #else
1772+ fatalError("Only available on WebAssembly")
1773+ #endif
1774+ }
1775+ }
1776+ }
1777+
1778+ extension JSTypedClosure where Signature == (sending WeatherData) -> Void {
1779+ init(fileID: StaticString = #fileID, line: UInt32 = #line, _ body: @escaping (sending WeatherData) -> Void) {
1780+ self.init(
1781+ makeClosure: make_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y,
1782+ body: body,
1783+ fileID: fileID,
1784+ line: line
1785+ )
1786+ }
1787+ }
1788+
1789+ @_expose(wasm, "invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y")
1790+ @_cdecl("invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y")
1791+ public func _invoke_swift_closure_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss11WeatherDataC_y(_ boxPtr: UnsafeMutableRawPointer, _ param0: Int32) -> Void {
1792+ #if arch(wasm32)
1793+ let closure = Unmanaged<_BridgeJSTypedClosureBox<(sending WeatherData) -> Void>>.fromOpaque(boxPtr).takeUnretainedValue().closure
1794+ closure(WeatherData.bridgeJSLiftParameter(param0))
1795+ #else
1796+ fatalError("Only available on WebAssembly")
1797+ #endif
1798+ }
1799+
17391800#if arch(wasm32)
17401801@_extern(wasm, module: "bjs", name: "invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss7JSValueV_y")
17411802fileprivate func invoke_js_callback_BridgeJSRuntimeTests_20BridgeJSRuntimeTestss7JSValueV_y_extern(_ callback: Int32, _ param0Kind: Int32, _ param0Payload1: Int32, _ param0Payload2: Float64) -> Void
@@ -12170,6 +12231,31 @@ func _$runAsyncWorks() async throws(JSException) -> Void {
1217012231 }
1217112232}
1217212233
12234+ #if arch(wasm32)
12235+ @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_fetchWeatherData")
12236+ fileprivate func bjs_fetchWeatherData_extern(_ resolveRef: Int32, _ rejectRef: Int32, _ cityBytes: Int32, _ cityLength: Int32) -> Void
12237+ #else
12238+ fileprivate func bjs_fetchWeatherData_extern(_ resolveRef: Int32, _ rejectRef: Int32, _ cityBytes: Int32, _ cityLength: Int32) -> Void {
12239+ fatalError("Only available on WebAssembly")
12240+ }
12241+ #endif
12242+ @inline(never) fileprivate func bjs_fetchWeatherData(_ resolveRef: Int32, _ rejectRef: Int32, _ cityBytes: Int32, _ cityLength: Int32) -> Void {
12243+ return bjs_fetchWeatherData_extern(resolveRef, rejectRef, cityBytes, cityLength)
12244+ }
12245+
12246+ func _$fetchWeatherData(_ city: String) async throws(JSException) -> WeatherData {
12247+ let resolved = try await _bjs_awaitPromise(makeResolveClosure: {
12248+ JSTypedClosure<(sending WeatherData) -> Void>($0)
12249+ }, makeRejectClosure: {
12250+ JSTypedClosure<(sending JSValue) -> Void>($0)
12251+ }) { resolveRef, rejectRef in
12252+ city.bridgeJSWithLoweredParameter { (cityBytes, cityLength) in
12253+ bjs_fetchWeatherData(resolveRef, rejectRef, cityBytes, cityLength)
12254+ }
12255+ }
12256+ return resolved
12257+ }
12258+
1217312259#if arch(wasm32)
1217412260@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs__jsWeirdFunction")
1217512261fileprivate func bjs__jsWeirdFunction_extern() -> Float64
@@ -12348,6 +12434,133 @@ func _$JsGreeter_changeName(_ self: JSObject, _ name: String) throws(JSException
1234812434 }
1234912435}
1235012436
12437+ #if arch(wasm32)
12438+ @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_WeatherData_temperature_get")
12439+ fileprivate func bjs_WeatherData_temperature_get_extern(_ self: Int32) -> Float64
12440+ #else
12441+ fileprivate func bjs_WeatherData_temperature_get_extern(_ self: Int32) -> Float64 {
12442+ fatalError("Only available on WebAssembly")
12443+ }
12444+ #endif
12445+ @inline(never) fileprivate func bjs_WeatherData_temperature_get(_ self: Int32) -> Float64 {
12446+ return bjs_WeatherData_temperature_get_extern(self)
12447+ }
12448+
12449+ #if arch(wasm32)
12450+ @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_WeatherData_description_get")
12451+ fileprivate func bjs_WeatherData_description_get_extern(_ self: Int32) -> Int32
12452+ #else
12453+ fileprivate func bjs_WeatherData_description_get_extern(_ self: Int32) -> Int32 {
12454+ fatalError("Only available on WebAssembly")
12455+ }
12456+ #endif
12457+ @inline(never) fileprivate func bjs_WeatherData_description_get(_ self: Int32) -> Int32 {
12458+ return bjs_WeatherData_description_get_extern(self)
12459+ }
12460+
12461+ #if arch(wasm32)
12462+ @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_WeatherData_humidity_get")
12463+ fileprivate func bjs_WeatherData_humidity_get_extern(_ self: Int32) -> Float64
12464+ #else
12465+ fileprivate func bjs_WeatherData_humidity_get_extern(_ self: Int32) -> Float64 {
12466+ fatalError("Only available on WebAssembly")
12467+ }
12468+ #endif
12469+ @inline(never) fileprivate func bjs_WeatherData_humidity_get(_ self: Int32) -> Float64 {
12470+ return bjs_WeatherData_humidity_get_extern(self)
12471+ }
12472+
12473+ #if arch(wasm32)
12474+ @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_WeatherData_temperature_set")
12475+ fileprivate func bjs_WeatherData_temperature_set_extern(_ self: Int32, _ newValue: Float64) -> Void
12476+ #else
12477+ fileprivate func bjs_WeatherData_temperature_set_extern(_ self: Int32, _ newValue: Float64) -> Void {
12478+ fatalError("Only available on WebAssembly")
12479+ }
12480+ #endif
12481+ @inline(never) fileprivate func bjs_WeatherData_temperature_set(_ self: Int32, _ newValue: Float64) -> Void {
12482+ return bjs_WeatherData_temperature_set_extern(self, newValue)
12483+ }
12484+
12485+ #if arch(wasm32)
12486+ @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_WeatherData_description_set")
12487+ fileprivate func bjs_WeatherData_description_set_extern(_ self: Int32, _ newValueBytes: Int32, _ newValueLength: Int32) -> Void
12488+ #else
12489+ fileprivate func bjs_WeatherData_description_set_extern(_ self: Int32, _ newValueBytes: Int32, _ newValueLength: Int32) -> Void {
12490+ fatalError("Only available on WebAssembly")
12491+ }
12492+ #endif
12493+ @inline(never) fileprivate func bjs_WeatherData_description_set(_ self: Int32, _ newValueBytes: Int32, _ newValueLength: Int32) -> Void {
12494+ return bjs_WeatherData_description_set_extern(self, newValueBytes, newValueLength)
12495+ }
12496+
12497+ #if arch(wasm32)
12498+ @_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs_WeatherData_humidity_set")
12499+ fileprivate func bjs_WeatherData_humidity_set_extern(_ self: Int32, _ newValue: Float64) -> Void
12500+ #else
12501+ fileprivate func bjs_WeatherData_humidity_set_extern(_ self: Int32, _ newValue: Float64) -> Void {
12502+ fatalError("Only available on WebAssembly")
12503+ }
12504+ #endif
12505+ @inline(never) fileprivate func bjs_WeatherData_humidity_set(_ self: Int32, _ newValue: Float64) -> Void {
12506+ return bjs_WeatherData_humidity_set_extern(self, newValue)
12507+ }
12508+
12509+ func _$WeatherData_temperature_get(_ self: JSObject) throws(JSException) -> Double {
12510+ let selfValue = self.bridgeJSLowerParameter()
12511+ let ret = bjs_WeatherData_temperature_get(selfValue)
12512+ if let error = _swift_js_take_exception() {
12513+ throw error
12514+ }
12515+ return Double.bridgeJSLiftReturn(ret)
12516+ }
12517+
12518+ func _$WeatherData_description_get(_ self: JSObject) throws(JSException) -> String {
12519+ let selfValue = self.bridgeJSLowerParameter()
12520+ let ret = bjs_WeatherData_description_get(selfValue)
12521+ if let error = _swift_js_take_exception() {
12522+ throw error
12523+ }
12524+ return String.bridgeJSLiftReturn(ret)
12525+ }
12526+
12527+ func _$WeatherData_humidity_get(_ self: JSObject) throws(JSException) -> Double {
12528+ let selfValue = self.bridgeJSLowerParameter()
12529+ let ret = bjs_WeatherData_humidity_get(selfValue)
12530+ if let error = _swift_js_take_exception() {
12531+ throw error
12532+ }
12533+ return Double.bridgeJSLiftReturn(ret)
12534+ }
12535+
12536+ func _$WeatherData_temperature_set(_ self: JSObject, _ newValue: Double) throws(JSException) -> Void {
12537+ let selfValue = self.bridgeJSLowerParameter()
12538+ let newValueValue = newValue.bridgeJSLowerParameter()
12539+ bjs_WeatherData_temperature_set(selfValue, newValueValue)
12540+ if let error = _swift_js_take_exception() {
12541+ throw error
12542+ }
12543+ }
12544+
12545+ func _$WeatherData_description_set(_ self: JSObject, _ newValue: String) throws(JSException) -> Void {
12546+ let selfValue = self.bridgeJSLowerParameter()
12547+ newValue.bridgeJSWithLoweredParameter { (newValueBytes, newValueLength) in
12548+ bjs_WeatherData_description_set(selfValue, newValueBytes, newValueLength)
12549+ }
12550+ if let error = _swift_js_take_exception() {
12551+ throw error
12552+ }
12553+ }
12554+
12555+ func _$WeatherData_humidity_set(_ self: JSObject, _ newValue: Double) throws(JSException) -> Void {
12556+ let selfValue = self.bridgeJSLowerParameter()
12557+ let newValueValue = newValue.bridgeJSLowerParameter()
12558+ bjs_WeatherData_humidity_set(selfValue, newValueValue)
12559+ if let error = _swift_js_take_exception() {
12560+ throw error
12561+ }
12562+ }
12563+
1235112564#if arch(wasm32)
1235212565@_extern(wasm, module: "BridgeJSRuntimeTests", name: "bjs__WeirdClass_init")
1235312566fileprivate func bjs__WeirdClass_init_extern() -> Int32
0 commit comments