Skip to content

Commit bf36300

Browse files
committed
Fix formatting
1 parent ea82047 commit bf36300

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

Plugins/BridgeJS/Sources/BridgeJSCore/SwiftToSkeleton.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,8 @@ private final class ExportSwiftAPICollector: SyntaxAnyVisitor {
11261126
guard throwsClause.type != nil else {
11271127
diagnose(
11281128
node: throwsClause,
1129-
message: "Thrown type must be specified. Only JSException or any error conforming to ConvertibleToJSException is supported"
1129+
message:
1130+
"Thrown type must be specified. Only JSException or any error conforming to ConvertibleToJSException is supported"
11301131
)
11311132
return nil
11321133
}

Sources/JavaScriptKit/BridgeJSIntrinsics.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ extension ConvertibleToJSException {
5454
}
5555

5656
extension Error {
57-
@available(*, unavailable, message: "It is only possible to throw a JSException or an Error which conforms to ConvertibleToJSException")
57+
@available(
58+
*,
59+
unavailable,
60+
message: "It is only possible to throw a JSException or an Error which conforms to ConvertibleToJSException"
61+
)
5862
@_spi(BridgeJS) public func bridgeJSLowerThrow() {
5963
fatalError()
6064
}
6165

62-
@available(*, unavailable, message: "It is only possible to throw a JSException or an Error which conforms to ConvertibleToJSException")
66+
@available(
67+
*,
68+
unavailable,
69+
message: "It is only possible to throw a JSException or an Error which conforms to ConvertibleToJSException"
70+
)
6371
@_spi(BridgeJS) public func bridgeJSLowerThrowAsync() -> JSException {
6472
fatalError()
6573
}

Sources/JavaScriptKit/ConvertibleToJSException.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// Errors that can be converted to a JSException.
2-
///
2+
///
33
/// If an error conforms to this protocol, it is possible to throw it from a `@JS` method.
44
public protocol ConvertibleToJSException: Error {
55
var jsException: JSException { get }

Tests/JavaScriptEventLoopTests/JSClosure+AsyncTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class JSClosureAsyncTests: XCTestCase {
7272
)!.value()
7373
XCTAssertEqual(result, 42.0)
7474
}
75-
75+
7676
func testAsyncOneshotClosureWithPriority() async throws {
7777
let priority = UnsafeSendableBox<TaskPriority?>(nil)
7878
let closure = JSOneshotClosure.async(priority: .high) { _ in
@@ -83,7 +83,7 @@ class JSClosureAsyncTests: XCTestCase {
8383
XCTAssertEqual(result, 42.0)
8484
XCTAssertEqual(priority.value, .high)
8585
}
86-
86+
8787
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
8888
func testAsyncOneshotClosureWithTaskExecutor() async throws {
8989
let executor = AnyTaskExecutor()
@@ -93,7 +93,7 @@ class JSClosureAsyncTests: XCTestCase {
9393
let result = try await JSPromise(from: closure.function!())!.value()
9494
XCTAssertEqual(result, 42.0)
9595
}
96-
96+
9797
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
9898
func testAsyncOneshotClosureWithTaskExecutorPreference() async throws {
9999
let executor = AnyTaskExecutor()

0 commit comments

Comments
 (0)