Skip to content

Commit 8451c76

Browse files
committed
Some word smithing
1 parent e014c04 commit 8451c76

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

proposals/js-promise-integration/Overview.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,10 @@ if the value of `promising` is `"last"`.
241241

242242
If the value of `promising` is `"none"`, then this specification does not apply to the constructed function.
243243

244-
Note that the return type of the `WebAssembly.Function` is fixed to `externref`. This is because the wrapped function may return a `Promise`. Because the function is not always expected to return a `Promise`—if the export returns normally as opposed to suspending then it will typically not return a `Promise`; however, type consistentency requires that any non-`Promise` return value must be boxed as an `externref`. This boxing is implemented as part of the constructed function.
244+
Note that the return type of the `WebAssembly.Function` is fixed to `externref`. This is because the constructed function may return a `Promise`. The constructed function is not always expected to return a `Promise`—if the `func` returns normally as opposed to suspending then it will typically not return a `Promise`. Type consistentency requires that any non-`Promise` return value must be boxed as an `externref`. This boxing is implemented as part of the constructed function.
245245

246-
0. Let `func` be the function that is created using this variant of the `WebAssembly.Function` constructor. This function, when called with arguments `args`, will:
246+
0. Let `func` be the function that is passed to the `WebAssembly.Function` constructor,
247+
1. the function that is created using this variant of the `WebAssembly.Function` constructor will, when called with arguments `args`:
247248
1. Allocate a new `Suspender` object and pass it as an additional argument to `args` to the `func` argument in the `WebAssembly.Function` constructor.
248249
2. Changes the state of `suspender`'s state to **Active**[`caller`] (where `caller` is the current caller)
249250
3. Lets `result` be the result of calling `func(args)` (or any trap or thrown exception)

0 commit comments

Comments
 (0)