File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed
Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,27 @@ public func _bjs_GlobalUtils_PublicConverter_toString(_ _self: UnsafeMutableRawP
296296 #endif
297297}
298298
299+ @_expose ( wasm, " bjs_GlobalUtils_PublicConverter_precision_get " )
300+ @_cdecl ( " bjs_GlobalUtils_PublicConverter_precision_get " )
301+ public func _bjs_GlobalUtils_PublicConverter_precision_get( _ _self: UnsafeMutableRawPointer ) -> Int32 {
302+ #if arch(wasm32)
303+ let ret = GlobalUtils . PublicConverter. bridgeJSLiftParameter ( _self) . precision
304+ return ret. bridgeJSLowerReturn ( )
305+ #else
306+ fatalError ( " Only available on WebAssembly " )
307+ #endif
308+ }
309+
310+ @_expose ( wasm, " bjs_GlobalUtils_PublicConverter_precision_set " )
311+ @_cdecl ( " bjs_GlobalUtils_PublicConverter_precision_set " )
312+ public func _bjs_GlobalUtils_PublicConverter_precision_set( _ _self: UnsafeMutableRawPointer , _ value: Int32 ) -> Void {
313+ #if arch(wasm32)
314+ GlobalUtils . PublicConverter. bridgeJSLiftParameter ( _self) . precision = Int . bridgeJSLiftParameter ( value)
315+ #else
316+ fatalError ( " Only available on WebAssembly " )
317+ #endif
318+ }
319+
299320@_expose ( wasm, " bjs_GlobalUtils_PublicConverter_deinit " )
300321@_cdecl ( " bjs_GlobalUtils_PublicConverter_deinit " )
301322public func _bjs_GlobalUtils_PublicConverter_deinit( _ pointer: UnsafeMutableRawPointer ) -> Void {
Original file line number Diff line number Diff line change 156156 " GlobalUtils"
157157 ],
158158 "properties" : [
159+ {
160+ "isReadonly" : false ,
161+ "isStatic" : false ,
162+ "name" : " precision" ,
163+ "namespace" : [
164+ " GlobalUtils"
165+ ],
166+ "type" : {
167+ "int" : {
159168
169+ }
170+ }
171+ }
160172 ],
161173 "swiftCallName" : " GlobalUtils.PublicConverter"
162174 }
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ enum Internal {
6363
6464@JS enum GlobalUtils {
6565 @JS class PublicConverter {
66+ @JS var precision : Int = 2
67+
6668 @JS init ( ) { }
6769
6870 @JS func toString( value: Int ) -> String {
Original file line number Diff line number Diff line change @@ -1032,6 +1032,9 @@ function BridgeJSGlobalTests_runJsWorksGlobal() {
10321032
10331033 const globalConverter = new globalThis . GlobalUtils . PublicConverter ( ) ;
10341034 assert . equal ( globalConverter . toString ( 99 ) , "99" ) ;
1035+ assert . equal ( globalConverter . precision , 2 ) ;
1036+ globalConverter . precision = 5 ;
1037+ assert . equal ( globalConverter . precision , 5 ) ;
10351038 globalConverter . release ( ) ;
10361039
10371040 const globalHttpServer = new globalThis . GlobalNetworking . API . TestHTTPServer ( ) ;
You can’t perform that action at this time.
0 commit comments