You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/js-promise-integration/Overview.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,9 +154,9 @@ The `WebAssembly.promising` function takes a WebAssembly function -- i.e., not a
154
154
155
155
Note that, if the function `wasmFunc` suspends (by invoking a `Promise` returning import), then the `promise` will be returned to the `caller` before `wasmFunc` returns. When `wasmFunc` completes eventually, then `promise` will be resolved -- and one of `accept` or `reject` will be invoked by the browser's microtask runner.
156
156
157
-
### Suspendable functions
157
+
### Suspending functions
158
158
159
-
We use the `Suspendable` constructor to signal to WebAssembly that a given import should cause a suspension of WebAssembly execution.
159
+
We use the `Suspending` constructor to signal to WebAssembly that a given import should cause a suspension of WebAssembly execution.
160
160
161
161
#### `new WebAssembly.Suspending(`*`jsFun`*`)`
162
162
@@ -165,12 +165,12 @@ The `WebAssembly.Suspending` constructor takes a JavaScript `Function` as an arg
165
165
>Note that *`jsFun`* is expected to be a *JavaScript function*. This allows us to ignore certain so-called corner cases in the usage of JSPI: in particular there is no special handling of WebAssembly functions passed to `WebAssembly.Suspending`.
166
166
167
167
1. If IsCallable(*jsFun*) is `false`, throw a `TypeError` exception.
168
-
1. Let *suspendingProto* be `WebAssembly.Suspendable.%prototype%`
168
+
1. Let *suspendingProto* be `WebAssembly.Suspending.%prototype%`
169
169
1. Let *susp* be the result of `OrdinaryObjectCreate`(*`suspendingProto`*)
170
170
1. Assign the `[[wrappedFunction]]` internal slot of *`susp`* to *`jsFun`*
171
171
1. Return *susp*
172
172
173
-
The most direct way that external functions can be accessed from a WebAssembly module is via imports.[^WebAssembly.Function] Therefore, we modify the *read-the-imports* algorithm to account for imports annotated as `Suspendable`.
173
+
The most direct way that external functions can be accessed from a WebAssembly module is via imports.[^WebAssembly.Function] Therefore, we modify the *read-the-imports* algorithm to account for imports annotated as `Suspending`.
174
174
175
175
[^WebAssembly.Function]: The other way is by using a `WebAssembly.Function` constructor, as proposed in the [js-types proposal](https://github.com/WebAssembly/js-types). However, the semantics of `WebAssembly.Function` also revolve around modules and importing.
0 commit comments