Skip to content

Commit 65658bd

Browse files
Update Sources/JavaScriptKit/FundamentalObjects/JSClosure.swift
Co-authored-by: Jed Fox <git@jedfox.com>
1 parent e67b03e commit 65658bd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: Sources/JavaScriptKit/FundamentalObjects/JSClosure.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,27 @@ public class JSClosure: JSOneshotClosure {
9090

9191
// MARK: - `JSClosure` mechanism note
9292
//
93-
// 1. Create thunk function in JavaScript world, that has a reference
94-
// to Swift Closure.
93+
// 1. Create a thunk in the JavaScript world, which has a reference
94+
// to a Swift closure.
9595
// ┌─────────────────────┬──────────────────────────┐
9696
// │ Swift side │ JavaScript side │
9797
// │ │ │
9898
// │ │ │
99-
// │ │ ┌──[Thunk function]──┐ │
99+
// │ │ ┌──────[Thunk]───────┐ │
100100
// │ ┌ ─ ─ ─ ─ ─│─ ─│─ ─ ─ ─ ─ ┐ │ │
101101
// │ ↓ │ │ │ │ │
102102
// │ [Swift Closure] │ │ Host Function ID │ │
103103
// │ │ │ │ │
104104
// │ │ └────────────────────┘ │
105105
// └─────────────────────┴──────────────────────────┘
106106
//
107-
// 2. When thunk function is invoked, it calls Swift Closure via
108-
// `_call_host_function` and callback the result through callback func
107+
// 2. When the thunk function is invoked, it calls the Swift closure via
108+
// `_call_host_function` and receives the result through a callback.
109109
// ┌─────────────────────┬──────────────────────────┐
110110
// │ Swift side │ JavaScript side │
111111
// │ │ │
112112
// │ │ │
113-
// │ Apply ┌──[Thunk function]──┐ │
113+
// │ Apply ┌──────[Thunk]───────┐ │
114114
// │ ┌ ─ ─ ─ ─ ─│─ ─│─ ─ ─ ─ ─ ┐ │ │
115115
// │ ↓ │ │ │ │ │
116116
// │ [Swift Closure] │ │ Host Function ID │ │

0 commit comments

Comments
 (0)