Skip to content

Commit 6e398ce

Browse files
[WIP] BridgeJS: Macro-annotated import notations
1 parent e211f07 commit 6e398ce

File tree

131 files changed

+16185
-12930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+16185
-12930
lines changed

Benchmarks/Sources/Generated/BridgeJS.ImportTS.swift

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
2+
// DO NOT EDIT.
3+
//
4+
// To update this file, just rebuild your project or run
5+
// `swift package bridge-js`.
6+
7+
import JavaScriptKit
8+
9+
@JSFunction func benchmarkHelperNoop() throws (JSException) -> Void
10+
11+
@JSFunction func benchmarkHelperNoopWithNumber(_ n: Double) throws (JSException) -> Void
12+
13+
@JSFunction func benchmarkRunner(_ name: String, _ body: JSObject) throws (JSException) -> Void

Benchmarks/Sources/Generated/BridgeJS.ExportSwift.swift renamed to Benchmarks/Sources/Generated/BridgeJS.swift

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// bridge-js: skip
12
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
23
// DO NOT EDIT.
34
//
@@ -1172,4 +1173,64 @@ fileprivate func _bjs_ClassRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) ->
11721173
fileprivate func _bjs_ClassRoundtrip_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 {
11731174
fatalError("Only available on WebAssembly")
11741175
}
1175-
#endif
1176+
#endif
1177+
1178+
// bridge-js: skip
1179+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
1180+
// DO NOT EDIT.
1181+
//
1182+
// To update this file, just rebuild your project or run
1183+
// `swift package bridge-js`.
1184+
1185+
@_spi(BridgeJS) import JavaScriptKit
1186+
1187+
#if arch(wasm32)
1188+
@_extern(wasm, module: "Benchmarks", name: "bjs_benchmarkHelperNoop")
1189+
fileprivate func bjs_benchmarkHelperNoop() -> Void
1190+
#else
1191+
fileprivate func bjs_benchmarkHelperNoop() -> Void {
1192+
fatalError("Only available on WebAssembly")
1193+
}
1194+
#endif
1195+
1196+
func _$benchmarkHelperNoop() throws(JSException) -> Void {
1197+
bjs_benchmarkHelperNoop()
1198+
if let error = _swift_js_take_exception() {
1199+
throw error
1200+
}
1201+
}
1202+
1203+
#if arch(wasm32)
1204+
@_extern(wasm, module: "Benchmarks", name: "bjs_benchmarkHelperNoopWithNumber")
1205+
fileprivate func bjs_benchmarkHelperNoopWithNumber(_ n: Float64) -> Void
1206+
#else
1207+
fileprivate func bjs_benchmarkHelperNoopWithNumber(_ n: Float64) -> Void {
1208+
fatalError("Only available on WebAssembly")
1209+
}
1210+
#endif
1211+
1212+
func _$benchmarkHelperNoopWithNumber(_ n: Double) throws(JSException) -> Void {
1213+
let nValue = n.bridgeJSLowerParameter()
1214+
bjs_benchmarkHelperNoopWithNumber(nValue)
1215+
if let error = _swift_js_take_exception() {
1216+
throw error
1217+
}
1218+
}
1219+
1220+
#if arch(wasm32)
1221+
@_extern(wasm, module: "Benchmarks", name: "bjs_benchmarkRunner")
1222+
fileprivate func bjs_benchmarkRunner(_ name: Int32, _ body: Int32) -> Void
1223+
#else
1224+
fileprivate func bjs_benchmarkRunner(_ name: Int32, _ body: Int32) -> Void {
1225+
fatalError("Only available on WebAssembly")
1226+
}
1227+
#endif
1228+
1229+
func _$benchmarkRunner(_ name: String, _ body: JSObject) throws(JSException) -> Void {
1230+
let nameValue = name.bridgeJSLowerParameter()
1231+
let bodyValue = body.bridgeJSLowerParameter()
1232+
bjs_benchmarkRunner(nameValue, bodyValue)
1233+
if let error = _swift_js_take_exception() {
1234+
throw error
1235+
}
1236+
}

0 commit comments

Comments
 (0)