File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Sources/JavaScriptKit/FundamentalObjects Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff 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 │ │
You can’t perform that action at this time.
0 commit comments