@@ -34,7 +34,7 @@ import JavaScriptEventLoop
3434JavaScriptEventLoop.installGlobalExecutor()
3535```
3636*/
37- @available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
37+ @available ( macOS 14 . 0 , iOS 17 . 0 , watchOS 10 . 0 , tvOS 17 . 0 , * )
3838public final class JavaScriptEventLoop : SerialExecutor , @unchecked Sendable {
3939
4040 /// A function that queues a given closure as a microtask into JavaScript event loop.
@@ -92,7 +92,7 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
9292
9393 typealias swift_task_enqueueGlobal_hook_Fn = @convention ( thin) ( UnownedJob , swift_task_enqueueGlobal_original ) -> Void
9494 let swift_task_enqueueGlobal_hook_impl : swift_task_enqueueGlobal_hook_Fn = { job, original in
95- JavaScriptEventLoop . shared. enqueue ( job)
95+ JavaScriptEventLoop . shared. unsafeEnqueue ( job)
9696 }
9797 swift_task_enqueueGlobal_hook = unsafeBitCast ( swift_task_enqueueGlobal_hook_impl, to: UnsafeMutableRawPointer ? . self)
9898
@@ -112,7 +112,7 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
112112
113113 typealias swift_task_enqueueMainExecutor_hook_Fn = @convention ( thin) ( UnownedJob , swift_task_enqueueMainExecutor_original ) -> Void
114114 let swift_task_enqueueMainExecutor_hook_impl : swift_task_enqueueMainExecutor_hook_Fn = { job, original in
115- JavaScriptEventLoop . shared. enqueue ( job)
115+ JavaScriptEventLoop . shared. unsafeEnqueue ( job)
116116 }
117117 swift_task_enqueueMainExecutor_hook = unsafeBitCast ( swift_task_enqueueMainExecutor_hook_impl, to: UnsafeMutableRawPointer ? . self)
118118
@@ -130,15 +130,20 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
130130 } )
131131 }
132132
133+ private func unsafeEnqueue( _ job: UnownedJob ) {
134+ insertJobQueue ( job: job)
135+ }
136+
133137 #if compiler(>=5.9)
138+ @available ( macOS 14 . 0 , iOS 17 . 0 , watchOS 10 . 0 , tvOS 17 . 0 , * )
134139 public func enqueue( _ job: consuming ExecutorJob ) {
135140 // NOTE: Converting a `ExecutorJob` to an ``UnownedJob`` and invoking
136141 // ``UnownedJob/runSynchronously(_:)` on it multiple times is undefined behavior.
137- insertJobQueue ( job : UnownedJob ( job) )
142+ unsafeEnqueue ( UnownedJob ( job) )
138143 }
139144 #else
140145 public func enqueue( _ job: UnownedJob ) {
141- insertJobQueue ( job : job)
146+ unsafeEnqueue ( job)
142147 }
143148 #endif
144149
@@ -155,7 +160,7 @@ internal func swift_get_time(
155160 _ nanoseconds: UnsafeMutablePointer < Int64 > ,
156161 _ clock: CInt )
157162
158- @available( macOS 10 . 15 , iOS 13 .0, watchOS 6 .0, tvOS 13 .0, * )
163+ @available( macOS 14 . 0 , iOS 17 .0, watchOS 10 .0, tvOS 17 .0, * )
159164extension JavaScriptEventLoop {
160165 fileprivate func enqueue(
161166 _ job: UnownedJob , withDelay seconds: Int64 , _ nanoseconds: Int64 ,
0 commit comments