Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -827,15 +827,15 @@ struct StackCodegen {
accessor: String,
varPrefix: String
) -> [CodeBlockItemSyntax] {
var statements: [CodeBlockItemSyntax] = []
let elemVar = "__bjs_elem_\(varPrefix)"
statements.append("for \(raw: elemVar) in \(raw: accessor) {")
statements.append(
" _swift_js_push_i32((\(raw: elemVar) as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())"
)
statements.append("}")
statements.append("_swift_js_push_i32(Int32(\(raw: accessor).count))")
return statements
return [
"""
for \(raw: elemVar) in \(raw: accessor) {
_swift_js_push_i32((\(raw: elemVar) as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())
}
""",
"_swift_js_push_i32(Int32(\(raw: accessor).count))",
]
}

private func lowerDictionaryStatements(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,8 @@ public func _bjs_processDelegates() -> Void {
#if arch(wasm32)
let ret = processDelegates(_: [AnyMyViewControllerDelegate].bridgeJSStackPop())
for __bjs_elem_ret in ret {
_swift_js_push_i32((__bjs_elem_ret as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())}
_swift_js_push_i32((__bjs_elem_ret as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())
}
_swift_js_push_i32(Int32(ret.count))
#else
fatalError("Only available on WebAssembly")
Expand Down Expand Up @@ -955,7 +956,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_i32((__bjs_elem_ret as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())}
_swift_js_push_i32((__bjs_elem_ret as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())
}
_swift_js_push_i32(Int32(ret.count))
#else
fatalError("Only available on WebAssembly")
Expand Down