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: document/js-api/index.bs
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1018,8 +1018,15 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
1018
1018
To <dfn>create a host function</dfn> from the JavaScript object |func| and type |functype|, perform the following steps:
1019
1019
1020
1020
1. Assert: [=IsCallable=](|func|).
1021
+
1. Let |stored settings| be the [=incumbent settings object=].
1021
1022
1. Let |hostfunc| be a [=host function=] which performs the following steps when called with arguments |arguments|:
1023
+
1. Let |realm| be |func|'s [=associated Realm=].
1024
+
1. Let |relevant settings| be |realm|'s [=Realm/settings object=].
1025
+
1. [=Prepare to run script=] with |relevant settings|.
1026
+
1. [=Prepare to run a callback=] with |stored settings|.
1022
1027
1. Let |result| be the result of [=run a host function|running a host function=] from |func|, |functype|, and |arguments|.
1028
+
1. [=Clean up after running a callback=] with |stored settings|.
1029
+
1. [=Clean up after running script=] with |relevant settings|.
1023
1030
1. Assert: |result|.\[[Type]] is <emu-const>throw</emu-const> or <emu-const>normal</emu-const>.
1024
1031
1. If |result|.\[[Type]] is <emu-const>throw</emu-const>, then trigger a WebAssembly trap, and propagate |result|.\[[Value]] to the enclosing JavaScript.
0 commit comments