@@ -39,19 +39,16 @@ extension Status: _BridgedSwiftCaseEnum {
3939
4040extension Config : _BridgedSwiftStruct {
4141 @_spi ( BridgeJS) @_transparent public static func bridgeJSLiftParameter( ) -> Config {
42- let enabled = Bool . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) )
43- let value = Int . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) )
44- let name = String . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) , _swift_js_pop_i32 ( ) )
42+ let enabled = Bool . bridgeJSLiftParameter ( )
43+ let value = Int . bridgeJSLiftParameter ( )
44+ let name = String . bridgeJSLiftParameter ( )
4545 return Config ( name: name, value: value, enabled: enabled)
4646 }
4747
4848 @_spi ( BridgeJS) @_transparent public consuming func bridgeJSLowerReturn( ) {
49- var __bjs_name = self . name
50- __bjs_name. withUTF8 { ptr in
51- _swift_js_push_string ( ptr. baseAddress, Int32 ( ptr. count) )
52- }
53- _swift_js_push_i32 ( Int32 ( self . value) )
54- _swift_js_push_i32 ( self . enabled ? 1 : 0 )
49+ self . name. bridgeJSLowerStackReturn ( )
50+ self . value. bridgeJSLowerStackReturn ( )
51+ self . enabled. bridgeJSLowerStackReturn ( )
5552 }
5653
5754 init ( unsafelyCopying jsObject: JSObject ) {
@@ -89,12 +86,12 @@ fileprivate func _bjs_struct_lift_Config() -> Int32 {
8986
9087extension MathOperations : _BridgedSwiftStruct {
9188 @_spi ( BridgeJS) @_transparent public static func bridgeJSLiftParameter( ) -> MathOperations {
92- let baseValue = Double . bridgeJSLiftParameter ( _swift_js_pop_f64 ( ) )
89+ let baseValue = Double . bridgeJSLiftParameter ( )
9390 return MathOperations ( baseValue: baseValue)
9491 }
9592
9693 @_spi ( BridgeJS) @_transparent public consuming func bridgeJSLowerReturn( ) {
97- _swift_js_push_f64 ( self . baseValue)
94+ self . baseValue. bridgeJSLowerStackReturn ( )
9895 }
9996
10097 init ( unsafelyCopying jsObject: JSObject ) {
@@ -321,19 +318,8 @@ public func _bjs_testOptionalStructWithValueDefault(_ point: Int32) -> Void {
321318@_cdecl ( " bjs_testIntArrayDefault " )
322319public func _bjs_testIntArrayDefault( ) -> Void {
323320 #if arch(wasm32)
324- let ret = testIntArrayDefault ( values: {
325- let __count = Int ( _swift_js_pop_i32 ( ) )
326- var __result : [ Int ] = [ ]
327- __result. reserveCapacity ( __count)
328- for _ in 0 ..< __count {
329- __result. append ( Int . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) ) )
330- }
331- __result. reverse ( )
332- return __result
333- } ( ) )
334- for __bjs_elem_ret in ret {
335- _swift_js_push_i32 ( Int32 ( __bjs_elem_ret) ) }
336- _swift_js_push_i32 ( Int32 ( ret. count) )
321+ let ret = testIntArrayDefault ( values: [ Int ] . bridgeJSLiftParameter ( ) )
322+ ret. bridgeJSLowerReturn ( )
337323 #else
338324 fatalError ( " Only available on WebAssembly " )
339325 #endif
@@ -343,22 +329,8 @@ public func _bjs_testIntArrayDefault() -> Void {
343329@_cdecl ( " bjs_testStringArrayDefault " )
344330public func _bjs_testStringArrayDefault( ) -> Void {
345331 #if arch(wasm32)
346- let ret = testStringArrayDefault ( names: {
347- let __count = Int ( _swift_js_pop_i32 ( ) )
348- var __result : [ String ] = [ ]
349- __result. reserveCapacity ( __count)
350- for _ in 0 ..< __count {
351- __result. append ( String . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) , _swift_js_pop_i32 ( ) ) )
352- }
353- __result. reverse ( )
354- return __result
355- } ( ) )
356- for __bjs_elem_ret in ret {
357- var __bjs_ret_elem = __bjs_elem_ret
358- __bjs_ret_elem. withUTF8 { ptr in
359- _swift_js_push_string ( ptr. baseAddress, Int32 ( ptr. count) )
360- } }
361- _swift_js_push_i32 ( Int32 ( ret. count) )
332+ let ret = testStringArrayDefault ( names: [ String ] . bridgeJSLiftParameter ( ) )
333+ ret. bridgeJSLowerReturn ( )
362334 #else
363335 fatalError ( " Only available on WebAssembly " )
364336 #endif
@@ -368,19 +340,8 @@ public func _bjs_testStringArrayDefault() -> Void {
368340@_cdecl ( " bjs_testDoubleArrayDefault " )
369341public func _bjs_testDoubleArrayDefault( ) -> Void {
370342 #if arch(wasm32)
371- let ret = testDoubleArrayDefault ( values: {
372- let __count = Int ( _swift_js_pop_i32 ( ) )
373- var __result : [ Double ] = [ ]
374- __result. reserveCapacity ( __count)
375- for _ in 0 ..< __count {
376- __result. append ( Double . bridgeJSLiftParameter ( _swift_js_pop_f64 ( ) ) )
377- }
378- __result. reverse ( )
379- return __result
380- } ( ) )
381- for __bjs_elem_ret in ret {
382- _swift_js_push_f64 ( __bjs_elem_ret) }
383- _swift_js_push_i32 ( Int32 ( ret. count) )
343+ let ret = testDoubleArrayDefault ( values: [ Double ] . bridgeJSLiftParameter ( ) )
344+ ret. bridgeJSLowerReturn ( )
384345 #else
385346 fatalError ( " Only available on WebAssembly " )
386347 #endif
@@ -390,19 +351,8 @@ public func _bjs_testDoubleArrayDefault() -> Void {
390351@_cdecl ( " bjs_testBoolArrayDefault " )
391352public func _bjs_testBoolArrayDefault( ) -> Void {
392353 #if arch(wasm32)
393- let ret = testBoolArrayDefault ( flags: {
394- let __count = Int ( _swift_js_pop_i32 ( ) )
395- var __result : [ Bool ] = [ ]
396- __result. reserveCapacity ( __count)
397- for _ in 0 ..< __count {
398- __result. append ( Bool . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) ) )
399- }
400- __result. reverse ( )
401- return __result
402- } ( ) )
403- for __bjs_elem_ret in ret {
404- _swift_js_push_i32 ( __bjs_elem_ret ? 1 : 0 ) }
405- _swift_js_push_i32 ( Int32 ( ret. count) )
354+ let ret = testBoolArrayDefault ( flags: [ Bool ] . bridgeJSLiftParameter ( ) )
355+ ret. bridgeJSLowerReturn ( )
406356 #else
407357 fatalError ( " Only available on WebAssembly " )
408358 #endif
@@ -412,19 +362,8 @@ public func _bjs_testBoolArrayDefault() -> Void {
412362@_cdecl ( " bjs_testEmptyArrayDefault " )
413363public func _bjs_testEmptyArrayDefault( ) -> Void {
414364 #if arch(wasm32)
415- let ret = testEmptyArrayDefault ( items: {
416- let __count = Int ( _swift_js_pop_i32 ( ) )
417- var __result : [ Int ] = [ ]
418- __result. reserveCapacity ( __count)
419- for _ in 0 ..< __count {
420- __result. append ( Int . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) ) )
421- }
422- __result. reverse ( )
423- return __result
424- } ( ) )
425- for __bjs_elem_ret in ret {
426- _swift_js_push_i32 ( Int32 ( __bjs_elem_ret) ) }
427- _swift_js_push_i32 ( Int32 ( ret. count) )
365+ let ret = testEmptyArrayDefault ( items: [ Int ] . bridgeJSLiftParameter ( ) )
366+ ret. bridgeJSLowerReturn ( )
428367 #else
429368 fatalError ( " Only available on WebAssembly " )
430369 #endif
@@ -434,16 +373,7 @@ public func _bjs_testEmptyArrayDefault() -> Void {
434373@_cdecl ( " bjs_testMixedWithArrayDefault " )
435374public func _bjs_testMixedWithArrayDefault( _ nameBytes: Int32 , _ nameLength: Int32 , _ enabled: Int32 ) -> Void {
436375 #if arch(wasm32)
437- let ret = testMixedWithArrayDefault ( name: String . bridgeJSLiftParameter ( nameBytes, nameLength) , values: {
438- let __count = Int ( _swift_js_pop_i32 ( ) )
439- var __result : [ Int ] = [ ]
440- __result. reserveCapacity ( __count)
441- for _ in 0 ..< __count {
442- __result. append ( Int . bridgeJSLiftParameter ( _swift_js_pop_i32 ( ) ) )
443- }
444- __result. reverse ( )
445- return __result
446- } ( ) , enabled: Bool . bridgeJSLiftParameter ( enabled) )
376+ let ret = testMixedWithArrayDefault ( name: String . bridgeJSLiftParameter ( nameBytes, nameLength) , values: [ Int ] . bridgeJSLiftParameter ( ) , enabled: Bool . bridgeJSLiftParameter ( enabled) )
447377 return ret. bridgeJSLowerReturn ( )
448378 #else
449379 fatalError ( " Only available on WebAssembly " )
0 commit comments