GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix availability marker for Swift 5.9 compiler targeting host machine · rarestype/JavaScriptKit@88abb13

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Sources
    • JavaScriptEventLoopTestSupport
      • JavaScriptEventLoopTestSupport.swift
    • JavaScriptEventLoop
      • JavaScriptEventLoop.swift
      • JobQueue.swift
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift‎

Copy file name to clipboardExpand all lines: Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift
+11-6Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import JavaScriptEventLoop
3434
JavaScriptEventLoop.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, *)
3838
public 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, *)
159164
extension JavaScriptEventLoop {
160165
fileprivate func enqueue(
161166
_ job: UnownedJob, withDelay seconds: Int64, _ nanoseconds: Int64,
Collapse file

‎Sources/JavaScriptEventLoop/JobQueue.swift‎

Copy file name to clipboardExpand all lines: Sources/JavaScriptEventLoop/JobQueue.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct QueueState: Sendable {
1212
fileprivate var isSpinning: Bool = false
1313
}
1414

15-
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
15+
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
1616
extension JavaScriptEventLoop {
1717

1818
func insertJobQueue(job newJob: UnownedJob) {
Collapse file

‎Sources/JavaScriptEventLoopTestSupport/JavaScriptEventLoopTestSupport.swift‎

Copy file name to clipboardExpand all lines: Sources/JavaScriptEventLoopTestSupport/JavaScriptEventLoopTestSupport.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import JavaScriptEventLoop
2222

2323
#if compiler(>=5.5)
2424

25-
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
25+
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
2626
@_cdecl("swift_javascriptkit_activate_js_executor_impl")
2727
func swift_javascriptkit_activate_js_executor_impl() {
2828
JavaScriptEventLoop.installGlobalExecutor()

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.