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
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,9 +241,10 @@ if the value of `promising` is `"last"`.
241
241
242
242
If the value of `promising` is `"none"`, then this specification does not apply to the constructed function.
243
243
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.
245
245
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`:
247
248
1. Allocate a new `Suspender` object and pass it as an additional argument to `args` to the `func` argument in the `WebAssembly.Function` constructor.
248
249
2. Changes the state of `suspender`'s state to **Active**[`caller`] (where `caller` is the current caller)
249
250
3. Lets `result` be the result of calling `func(args)` (or any trap or thrown exception)
0 commit comments