Skip to content

Commit 9ba7c10

Browse files
committed
formatting
1 parent 6fc3f01 commit 9ba7c10

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ public struct ImportTS {
118118
self.context = context
119119
let liftingInfo = try returnType.liftingReturnInfo(context: context)
120120
needsReturnVariable =
121-
!(returnType == .void || returnType.usesSideChannelForOptionalReturn() || liftingInfo.valueToLift == nil)
121+
!(returnType == .void || returnType.usesSideChannelForOptionalReturn()
122+
|| liftingInfo.valueToLift == nil)
122123
}
123124

124125
func lowerParameter(param: Parameter) throws {

Sources/JavaScriptKit/BridgeJSIntrinsics.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,9 @@ extension _BridgedSwiftStruct {
732732

733733
extension _BridgedSwiftEnumNoPayload where Self: RawRepresentable, RawValue == String {
734734
// MARK: ImportTS
735-
@_spi(BridgeJS) public consuming func bridgeJSWithLoweredParameter<T>(_ body: (Int32, Int32) -> T) -> T { rawValue.bridgeJSWithLoweredParameter(body) }
735+
@_spi(BridgeJS) public consuming func bridgeJSWithLoweredParameter<T>(_ body: (Int32, Int32) -> T) -> T {
736+
rawValue.bridgeJSWithLoweredParameter(body)
737+
}
736738

737739
@_spi(BridgeJS) public static func bridgeJSLiftReturn(_ id: Int32) -> Self {
738740
Self(rawValue: .bridgeJSLiftReturn(id))!
@@ -1502,7 +1504,9 @@ extension _BridgedAsOptional where Wrapped == Bool {
15021504
}
15031505

15041506
extension _BridgedAsOptional where Wrapped == String {
1505-
@_spi(BridgeJS) @_transparent public consuming func bridgeJSWithLoweredParameter<T>(_ body: (Int32, Int32, Int32) -> T) -> T {
1507+
@_spi(BridgeJS) @_transparent public consuming func bridgeJSWithLoweredParameter<T>(
1508+
_ body: (Int32, Int32, Int32) -> T
1509+
) -> T {
15061510
switch asOptional {
15071511
case .none:
15081512
return body(0, 0, 0)
@@ -1683,7 +1687,9 @@ extension _BridgedAsOptional where Wrapped: _BridgedSwiftCaseEnum {
16831687

16841688
extension _BridgedAsOptional
16851689
where Wrapped: _BridgedSwiftEnumNoPayload, Wrapped: RawRepresentable, Wrapped.RawValue == String {
1686-
@_spi(BridgeJS) @_transparent public consuming func bridgeJSWithLoweredParameter<T>(_ body: (Int32, Int32, Int32) -> T) -> T {
1690+
@_spi(BridgeJS) @_transparent public consuming func bridgeJSWithLoweredParameter<T>(
1691+
_ body: (Int32, Int32, Int32) -> T
1692+
) -> T {
16871693
switch asOptional {
16881694
case .none:
16891695
return body(0, 0, 0)

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)