Skip to content

Commit 58fce8c

Browse files
BridgeJS: Suppress warning about unhandled resource files
1 parent 62be420 commit 58fce8c

File tree

11 files changed

+46
-42
lines changed

11 files changed

+46
-42
lines changed

Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,16 @@ let package = Package(
151151
.product(name: "SwiftBasicFormat", package: "swift-syntax"),
152152
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
153153
],
154-
path: "Plugins/BridgeJS/Sources/BridgeJSTool"
154+
path: "Plugins/BridgeJS/Sources/BridgeJSTool",
155+
exclude: ["TS2Skeleton/JavaScript"]
155156
),
156157
.testTarget(
157158
name: "BridgeJSRuntimeTests",
158159
dependencies: ["JavaScriptKit"],
159160
exclude: [
160161
"bridge-js.config.json",
161162
"bridge-js.d.ts",
162-
"Generated/JavaScript"
163+
"Generated/JavaScript",
163164
],
164165
swiftSettings: [
165166
.enableExperimentalFeature("Extern")

Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ struct ImportTS {
213213
)
214214
}
215215
}),
216+
effectSpecifiers: FunctionEffectSpecifiersSyntax(
217+
throwsClause: ThrowsClauseSyntax(throwsSpecifier: .keyword(.throws))
218+
),
216219
returnClause: ReturnClauseSyntax(
217220
arrow: .arrowToken(),
218221
type: IdentifierTypeSyntax(name: .identifier(abiReturnType.map { $0.swiftType } ?? "Void"))

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/ArrayParameter.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
func checkArray(_ a: JSObject) -> Void {
1010
#if arch(wasm32)
1111
@_extern(wasm, module: "Check", name: "bjs_checkArray")
12-
func bjs_checkArray(_ a: Int32) -> Void
12+
func bjs_checkArray(_ a: Int32) throws -> Void
1313
#else
14-
func bjs_checkArray(_ a: Int32) -> Void {
14+
func bjs_checkArray(_ a: Int32) throws -> Void {
1515
fatalError("Only available on WebAssembly")
1616
}
1717
#endif
@@ -21,9 +21,9 @@ func checkArray(_ a: JSObject) -> Void {
2121
func checkArrayWithLength(_ a: JSObject, _ b: Double) -> Void {
2222
#if arch(wasm32)
2323
@_extern(wasm, module: "Check", name: "bjs_checkArrayWithLength")
24-
func bjs_checkArrayWithLength(_ a: Int32, _ b: Float64) -> Void
24+
func bjs_checkArrayWithLength(_ a: Int32, _ b: Float64) throws -> Void
2525
#else
26-
func bjs_checkArrayWithLength(_ a: Int32, _ b: Float64) -> Void {
26+
func bjs_checkArrayWithLength(_ a: Int32, _ b: Float64) throws -> Void {
2727
fatalError("Only available on WebAssembly")
2828
}
2929
#endif
@@ -33,9 +33,9 @@ func checkArrayWithLength(_ a: JSObject, _ b: Double) -> Void {
3333
func checkArray(_ a: JSObject) -> Void {
3434
#if arch(wasm32)
3535
@_extern(wasm, module: "Check", name: "bjs_checkArray")
36-
func bjs_checkArray(_ a: Int32) -> Void
36+
func bjs_checkArray(_ a: Int32) throws -> Void
3737
#else
38-
func bjs_checkArray(_ a: Int32) -> Void {
38+
func bjs_checkArray(_ a: Int32) throws -> Void {
3939
fatalError("Only available on WebAssembly")
4040
}
4141
#endif

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/Interface.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
func returnAnimatable() -> Animatable {
1010
#if arch(wasm32)
1111
@_extern(wasm, module: "Check", name: "bjs_returnAnimatable")
12-
func bjs_returnAnimatable() -> Int32
12+
func bjs_returnAnimatable() throws -> Int32
1313
#else
14-
func bjs_returnAnimatable() -> Int32 {
14+
func bjs_returnAnimatable() throws -> Int32 {
1515
fatalError("Only available on WebAssembly")
1616
}
1717
#endif
@@ -33,9 +33,9 @@ struct Animatable {
3333
func animate(_ keyframes: JSObject, _ options: JSObject) -> JSObject {
3434
#if arch(wasm32)
3535
@_extern(wasm, module: "Check", name: "bjs_Animatable_animate")
36-
func bjs_Animatable_animate(_ self: Int32, _ keyframes: Int32, _ options: Int32) -> Int32
36+
func bjs_Animatable_animate(_ self: Int32, _ keyframes: Int32, _ options: Int32) throws -> Int32
3737
#else
38-
func bjs_Animatable_animate(_ self: Int32, _ keyframes: Int32, _ options: Int32) -> Int32 {
38+
func bjs_Animatable_animate(_ self: Int32, _ keyframes: Int32, _ options: Int32) throws -> Int32 {
3939
fatalError("Only available on WebAssembly")
4040
}
4141
#endif
@@ -46,9 +46,9 @@ struct Animatable {
4646
func getAnimations(_ options: JSObject) -> JSObject {
4747
#if arch(wasm32)
4848
@_extern(wasm, module: "Check", name: "bjs_Animatable_getAnimations")
49-
func bjs_Animatable_getAnimations(_ self: Int32, _ options: Int32) -> Int32
49+
func bjs_Animatable_getAnimations(_ self: Int32, _ options: Int32) throws -> Int32
5050
#else
51-
func bjs_Animatable_getAnimations(_ self: Int32, _ options: Int32) -> Int32 {
51+
func bjs_Animatable_getAnimations(_ self: Int32, _ options: Int32) throws -> Int32 {
5252
fatalError("Only available on WebAssembly")
5353
}
5454
#endif

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/PrimitiveParameters.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
func check(_ a: Double, _ b: Bool) -> Void {
1010
#if arch(wasm32)
1111
@_extern(wasm, module: "Check", name: "bjs_check")
12-
func bjs_check(_ a: Float64, _ b: Int32) -> Void
12+
func bjs_check(_ a: Float64, _ b: Int32) throws -> Void
1313
#else
14-
func bjs_check(_ a: Float64, _ b: Int32) -> Void {
14+
func bjs_check(_ a: Float64, _ b: Int32) throws -> Void {
1515
fatalError("Only available on WebAssembly")
1616
}
1717
#endif

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/PrimitiveReturn.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
func checkNumber() -> Double {
1010
#if arch(wasm32)
1111
@_extern(wasm, module: "Check", name: "bjs_checkNumber")
12-
func bjs_checkNumber() -> Float64
12+
func bjs_checkNumber() throws -> Float64
1313
#else
14-
func bjs_checkNumber() -> Float64 {
14+
func bjs_checkNumber() throws -> Float64 {
1515
fatalError("Only available on WebAssembly")
1616
}
1717
#endif
@@ -22,9 +22,9 @@ func checkNumber() -> Double {
2222
func checkBoolean() -> Bool {
2323
#if arch(wasm32)
2424
@_extern(wasm, module: "Check", name: "bjs_checkBoolean")
25-
func bjs_checkBoolean() -> Int32
25+
func bjs_checkBoolean() throws -> Int32
2626
#else
27-
func bjs_checkBoolean() -> Int32 {
27+
func bjs_checkBoolean() throws -> Int32 {
2828
fatalError("Only available on WebAssembly")
2929
}
3030
#endif

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/StringParameter.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
func checkString(_ a: String) -> Void {
1010
#if arch(wasm32)
1111
@_extern(wasm, module: "Check", name: "bjs_checkString")
12-
func bjs_checkString(_ a: Int32) -> Void
12+
func bjs_checkString(_ a: Int32) throws -> Void
1313
#else
14-
func bjs_checkString(_ a: Int32) -> Void {
14+
func bjs_checkString(_ a: Int32) throws -> Void {
1515
fatalError("Only available on WebAssembly")
1616
}
1717
#endif
@@ -25,9 +25,9 @@ func checkString(_ a: String) -> Void {
2525
func checkStringWithLength(_ a: String, _ b: Double) -> Void {
2626
#if arch(wasm32)
2727
@_extern(wasm, module: "Check", name: "bjs_checkStringWithLength")
28-
func bjs_checkStringWithLength(_ a: Int32, _ b: Float64) -> Void
28+
func bjs_checkStringWithLength(_ a: Int32, _ b: Float64) throws -> Void
2929
#else
30-
func bjs_checkStringWithLength(_ a: Int32, _ b: Float64) -> Void {
30+
func bjs_checkStringWithLength(_ a: Int32, _ b: Float64) throws -> Void {
3131
fatalError("Only available on WebAssembly")
3232
}
3333
#endif

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/StringReturn.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
func checkString() -> String {
1010
#if arch(wasm32)
1111
@_extern(wasm, module: "Check", name: "bjs_checkString")
12-
func bjs_checkString() -> Int32
12+
func bjs_checkString() throws -> Int32
1313
#else
14-
func bjs_checkString() -> Int32 {
14+
func bjs_checkString() throws -> Int32 {
1515
fatalError("Only available on WebAssembly")
1616
}
1717
#endif

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeAlias.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
func checkSimple(_ a: Double) -> Void {
1010
#if arch(wasm32)
1111
@_extern(wasm, module: "Check", name: "bjs_checkSimple")
12-
func bjs_checkSimple(_ a: Float64) -> Void
12+
func bjs_checkSimple(_ a: Float64) throws -> Void
1313
#else
14-
func bjs_checkSimple(_ a: Float64) -> Void {
14+
func bjs_checkSimple(_ a: Float64) throws -> Void {
1515
fatalError("Only available on WebAssembly")
1616
}
1717
#endif

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/ImportTSTests/TypeScriptClass.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ struct Greeter {
2020
init(_ name: String) {
2121
#if arch(wasm32)
2222
@_extern(wasm, module: "Check", name: "bjs_Greeter_init")
23-
func bjs_Greeter_init(_ name: Int32) -> Int32
23+
func bjs_Greeter_init(_ name: Int32) throws -> Int32
2424
#else
25-
func bjs_Greeter_init(_ name: Int32) -> Int32 {
25+
func bjs_Greeter_init(_ name: Int32) throws -> Int32 {
2626
fatalError("Only available on WebAssembly")
2727
}
2828
#endif
@@ -38,9 +38,9 @@ struct Greeter {
3838
get {
3939
#if arch(wasm32)
4040
@_extern(wasm, module: "Check", name: "bjs_Greeter_name_get")
41-
func bjs_Greeter_name_get(_ self: Int32) -> Int32
41+
func bjs_Greeter_name_get(_ self: Int32) throws -> Int32
4242
#else
43-
func bjs_Greeter_name_get(_ self: Int32) -> Int32 {
43+
func bjs_Greeter_name_get(_ self: Int32) throws -> Int32 {
4444
fatalError("Only available on WebAssembly")
4545
}
4646
#endif
@@ -53,9 +53,9 @@ struct Greeter {
5353
nonmutating set {
5454
#if arch(wasm32)
5555
@_extern(wasm, module: "Check", name: "bjs_Greeter_name_set")
56-
func bjs_Greeter_name_set(_ self: Int32, _ newValue: Int32) -> Void
56+
func bjs_Greeter_name_set(_ self: Int32, _ newValue: Int32) throws -> Void
5757
#else
58-
func bjs_Greeter_name_set(_ self: Int32, _ newValue: Int32) -> Void {
58+
func bjs_Greeter_name_set(_ self: Int32, _ newValue: Int32) throws -> Void {
5959
fatalError("Only available on WebAssembly")
6060
}
6161
#endif
@@ -71,9 +71,9 @@ struct Greeter {
7171
get {
7272
#if arch(wasm32)
7373
@_extern(wasm, module: "Check", name: "bjs_Greeter_age_get")
74-
func bjs_Greeter_age_get(_ self: Int32) -> Float64
74+
func bjs_Greeter_age_get(_ self: Int32) throws -> Float64
7575
#else
76-
func bjs_Greeter_age_get(_ self: Int32) -> Float64 {
76+
func bjs_Greeter_age_get(_ self: Int32) throws -> Float64 {
7777
fatalError("Only available on WebAssembly")
7878
}
7979
#endif
@@ -85,9 +85,9 @@ struct Greeter {
8585
func greet() -> String {
8686
#if arch(wasm32)
8787
@_extern(wasm, module: "Check", name: "bjs_Greeter_greet")
88-
func bjs_Greeter_greet(_ self: Int32) -> Int32
88+
func bjs_Greeter_greet(_ self: Int32) throws -> Int32
8989
#else
90-
func bjs_Greeter_greet(_ self: Int32) -> Int32 {
90+
func bjs_Greeter_greet(_ self: Int32) throws -> Int32 {
9191
fatalError("Only available on WebAssembly")
9292
}
9393
#endif
@@ -101,9 +101,9 @@ struct Greeter {
101101
func changeName(_ name: String) -> Void {
102102
#if arch(wasm32)
103103
@_extern(wasm, module: "Check", name: "bjs_Greeter_changeName")
104-
func bjs_Greeter_changeName(_ self: Int32, _ name: Int32) -> Void
104+
func bjs_Greeter_changeName(_ self: Int32, _ name: Int32) throws -> Void
105105
#else
106-
func bjs_Greeter_changeName(_ self: Int32, _ name: Int32) -> Void {
106+
func bjs_Greeter_changeName(_ self: Int32, _ name: Int32) throws -> Void {
107107
fatalError("Only available on WebAssembly")
108108
}
109109
#endif

0 commit comments

Comments
 (0)