Skip to content

Commit a4aae2e

Browse files
Fix JSPI constructor name: Suspendable -> Suspending
1 parent 6f328c9 commit a4aae2e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

proposals/js-promise-integration/Overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ The `WebAssembly.promising` function takes a WebAssembly function -- i.e., not a
154154

155155
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.
156156

157-
### Suspendable functions
157+
### Suspending functions
158158

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.
160160

161161
#### `new WebAssembly.Suspending(`*`jsFun`*`)`
162162

@@ -165,12 +165,12 @@ The `WebAssembly.Suspending` constructor takes a JavaScript `Function` as an arg
165165
>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`.
166166
167167
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%`
169169
1. Let *susp* be the result of `OrdinaryObjectCreate`(*`suspendingProto`*)
170170
1. Assign the `[[wrappedFunction]]` internal slot of *`susp`* to *`jsFun`*
171171
1. Return *susp*
172172

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`.
174174

175175
[^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.
176176

0 commit comments

Comments
 (0)