11
11
public func _bjs_PlayBridgeJS_init( ) -> UnsafeMutableRawPointer {
12
12
#if arch(wasm32)
13
13
let ret = PlayBridgeJS ( )
14
- return Unmanaged . passRetained ( ret) . toOpaque ( )
14
+ return ret. bridgeJSLowerReturn ( )
15
15
#else
16
16
fatalError ( " Only available on WebAssembly " )
17
17
#endif
18
18
}
19
19
20
20
@_expose ( wasm, " bjs_PlayBridgeJS_update " )
21
21
@_cdecl ( " bjs_PlayBridgeJS_update " )
22
- public func _bjs_PlayBridgeJS_update( _self: UnsafeMutableRawPointer , swiftSourceBytes: Int32 , swiftSourceLen : Int32 , dtsSourceBytes: Int32 , dtsSourceLen : Int32 ) -> UnsafeMutableRawPointer {
22
+ public func _bjs_PlayBridgeJS_update( _self: UnsafeMutableRawPointer , swiftSourceBytes: Int32 , swiftSourceLength : Int32 , dtsSourceBytes: Int32 , dtsSourceLength : Int32 ) -> UnsafeMutableRawPointer {
23
23
#if arch(wasm32)
24
24
do {
25
- let ret = try Unmanaged < PlayBridgeJS > . fromOpaque ( _self) . takeUnretainedValue ( ) . update ( swiftSource: String . bridgeJSLiftParameter ( swiftSourceBytes, swiftSourceLen ) , dtsSource: String . bridgeJSLiftParameter ( dtsSourceBytes, dtsSourceLen ) )
26
- return Unmanaged . passRetained ( ret) . toOpaque ( )
25
+ let ret = try PlayBridgeJS . bridgeJSLiftParameter ( _self) . update ( swiftSource: String . bridgeJSLiftParameter ( swiftSourceBytes, swiftSourceLength ) , dtsSource: String . bridgeJSLiftParameter ( dtsSourceBytes, dtsSourceLength ) )
26
+ return ret. bridgeJSLowerReturn ( )
27
27
} catch let error {
28
28
if let error = error. thrownValue. object {
29
29
withExtendedLifetime ( error) {
@@ -48,10 +48,16 @@ public func _bjs_PlayBridgeJS_deinit(pointer: UnsafeMutableRawPointer) {
48
48
Unmanaged < PlayBridgeJS > . fromOpaque ( pointer) . release ( )
49
49
}
50
50
51
- extension PlayBridgeJS : ConvertibleToJSValue {
51
+ extension PlayBridgeJS : ConvertibleToJSValue , _BridgedSwiftHeapObject {
52
52
var jsValue : JSValue {
53
+ #if arch(wasm32)
53
54
@_extern ( wasm, module: " PlayBridgeJS " , name: " bjs_PlayBridgeJS_wrap " )
54
55
func _bjs_PlayBridgeJS_wrap( _: UnsafeMutableRawPointer ) -> Int32
56
+ #else
57
+ func _bjs_PlayBridgeJS_wrap( _: UnsafeMutableRawPointer ) -> Int32 {
58
+ fatalError ( " Only available on WebAssembly " )
59
+ }
60
+ #endif
55
61
return . object( JSObject ( id: UInt32 ( bitPattern: _bjs_PlayBridgeJS_wrap ( Unmanaged . passRetained ( self ) . toOpaque ( ) ) ) ) )
56
62
}
57
63
}
@@ -60,7 +66,7 @@ extension PlayBridgeJS: ConvertibleToJSValue {
60
66
@_cdecl ( " bjs_PlayBridgeJSOutput_outputJs " )
61
67
public func _bjs_PlayBridgeJSOutput_outputJs( _self: UnsafeMutableRawPointer ) -> Void {
62
68
#if arch(wasm32)
63
- let ret = Unmanaged < PlayBridgeJSOutput > . fromOpaque ( _self) . takeUnretainedValue ( ) . outputJs ( )
69
+ let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . outputJs ( )
64
70
return ret. bridgeJSLowerReturn ( )
65
71
#else
66
72
fatalError ( " Only available on WebAssembly " )
@@ -71,7 +77,7 @@ public func _bjs_PlayBridgeJSOutput_outputJs(_self: UnsafeMutableRawPointer) ->
71
77
@_cdecl ( " bjs_PlayBridgeJSOutput_outputDts " )
72
78
public func _bjs_PlayBridgeJSOutput_outputDts( _self: UnsafeMutableRawPointer ) -> Void {
73
79
#if arch(wasm32)
74
- let ret = Unmanaged < PlayBridgeJSOutput > . fromOpaque ( _self) . takeUnretainedValue ( ) . outputDts ( )
80
+ let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . outputDts ( )
75
81
return ret. bridgeJSLowerReturn ( )
76
82
#else
77
83
fatalError ( " Only available on WebAssembly " )
@@ -82,7 +88,7 @@ public func _bjs_PlayBridgeJSOutput_outputDts(_self: UnsafeMutableRawPointer) ->
82
88
@_cdecl ( " bjs_PlayBridgeJSOutput_importSwiftGlue " )
83
89
public func _bjs_PlayBridgeJSOutput_importSwiftGlue( _self: UnsafeMutableRawPointer ) -> Void {
84
90
#if arch(wasm32)
85
- let ret = Unmanaged < PlayBridgeJSOutput > . fromOpaque ( _self) . takeUnretainedValue ( ) . importSwiftGlue ( )
91
+ let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . importSwiftGlue ( )
86
92
return ret. bridgeJSLowerReturn ( )
87
93
#else
88
94
fatalError ( " Only available on WebAssembly " )
@@ -93,7 +99,7 @@ public func _bjs_PlayBridgeJSOutput_importSwiftGlue(_self: UnsafeMutableRawPoint
93
99
@_cdecl ( " bjs_PlayBridgeJSOutput_exportSwiftGlue " )
94
100
public func _bjs_PlayBridgeJSOutput_exportSwiftGlue( _self: UnsafeMutableRawPointer ) -> Void {
95
101
#if arch(wasm32)
96
- let ret = Unmanaged < PlayBridgeJSOutput > . fromOpaque ( _self) . takeUnretainedValue ( ) . exportSwiftGlue ( )
102
+ let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . exportSwiftGlue ( )
97
103
return ret. bridgeJSLowerReturn ( )
98
104
#else
99
105
fatalError ( " Only available on WebAssembly " )
@@ -106,10 +112,16 @@ public func _bjs_PlayBridgeJSOutput_deinit(pointer: UnsafeMutableRawPointer) {
106
112
Unmanaged < PlayBridgeJSOutput > . fromOpaque ( pointer) . release ( )
107
113
}
108
114
109
- extension PlayBridgeJSOutput : ConvertibleToJSValue {
115
+ extension PlayBridgeJSOutput : ConvertibleToJSValue , _BridgedSwiftHeapObject {
110
116
var jsValue : JSValue {
117
+ #if arch(wasm32)
111
118
@_extern ( wasm, module: " PlayBridgeJS " , name: " bjs_PlayBridgeJSOutput_wrap " )
112
119
func _bjs_PlayBridgeJSOutput_wrap( _: UnsafeMutableRawPointer ) -> Int32
120
+ #else
121
+ func _bjs_PlayBridgeJSOutput_wrap( _: UnsafeMutableRawPointer ) -> Int32 {
122
+ fatalError ( " Only available on WebAssembly " )
123
+ }
124
+ #endif
113
125
return . object( JSObject ( id: UInt32 ( bitPattern: _bjs_PlayBridgeJSOutput_wrap ( Unmanaged . passRetained ( self ) . toOpaque ( ) ) ) ) )
114
126
}
115
127
}
0 commit comments