-
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathBridgeJS.ImportTS.swift
More file actions
52 lines (48 loc) · 1.69 KB
/
BridgeJS.ImportTS.swift
File metadata and controls
52 lines (48 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
// DO NOT EDIT.
//
// To update this file, just rebuild your project or run
// `swift package bridge-js`.
@_spi(BridgeJS) import JavaScriptKit
func benchmarkHelperNoop() throws(JSException) -> Void {
#if arch(wasm32)
@_extern(wasm, module: "Benchmarks", name: "bjs_benchmarkHelperNoop")
func bjs_benchmarkHelperNoop() -> Void
#else
func bjs_benchmarkHelperNoop() -> Void {
fatalError("Only available on WebAssembly")
}
#endif
bjs_benchmarkHelperNoop()
if let error = _swift_js_take_exception() {
throw error
}
}
func benchmarkHelperNoopWithNumber(_ n: Double) throws(JSException) -> Void {
#if arch(wasm32)
@_extern(wasm, module: "Benchmarks", name: "bjs_benchmarkHelperNoopWithNumber")
func bjs_benchmarkHelperNoopWithNumber(_ n: Float64) -> Void
#else
func bjs_benchmarkHelperNoopWithNumber(_ n: Float64) -> Void {
fatalError("Only available on WebAssembly")
}
#endif
bjs_benchmarkHelperNoopWithNumber(n.bridgeJSLowerParameter())
if let error = _swift_js_take_exception() {
throw error
}
}
func benchmarkRunner(_ name: String, _ body: JSObject) throws(JSException) -> Void {
#if arch(wasm32)
@_extern(wasm, module: "Benchmarks", name: "bjs_benchmarkRunner")
func bjs_benchmarkRunner(_ name: Int32, _ body: Int32) -> Void
#else
func bjs_benchmarkRunner(_ name: Int32, _ body: Int32) -> Void {
fatalError("Only available on WebAssembly")
}
#endif
bjs_benchmarkRunner(name.bridgeJSLowerParameter(), body.bridgeJSLowerParameter())
if let error = _swift_js_take_exception() {
throw error
}
}