Skip to content

Commit 8611b7a

Browse files
Distinguish 6.0 and main toolchains by hasFeature(Extern)
The main toolchain still says it's 6.0, so we can' distinguish them by `#if compiler`. The feature is baseline in the main branch but not in the 6.0, so we can use it for now.
1 parent 9f4e95e commit 8611b7a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
6161
return _shared
6262
}
6363

64-
#if compiler(>=6.1) && _runtime(_multithreaded)
64+
#if compiler(>=6.0) && hasFeature(Extern) && _runtime(_multithreaded)
6565
// In multi-threaded environment, we have an event loop executor per
6666
// thread (per Web Worker). A job enqueued in one thread should be
6767
// executed in the same thread under this global executor.

Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if compiler(>=6.1) && _runtime(_multithreaded) // @_expose and @_extern are only available in Swift 6.0+
1+
#if compiler(>=6.0) && hasFeature(Extern) && _runtime(_multithreaded) // @_expose and @_extern are only available in Swift 6.0+
22

33
import JavaScriptKit
44
import _CJavaScriptKit

Tests/JavaScriptEventLoopTests/WebWorkerTaskExecutorTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if compiler(>=6.1) && _runtime(_multithreaded)
1+
#if compiler(>=6.0) && hasFeature(Extern) && _runtime(_multithreaded)
22
import XCTest
33
import JavaScriptKit
44
import _CJavaScriptKit // For swjs_get_worker_thread_id

0 commit comments

Comments
 (0)