Skip to content

Commit

Permalink
Editorial: Standardize preambles for host-defined abstract operations
Browse files Browse the repository at this point in the history
... using the format established in PR tc39#1914.
  • Loading branch information
jmdyck committed Jan 16, 2021
1 parent ba3dcb5 commit 03c236d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -9861,7 +9861,7 @@ <h1>JobCallback Records</h1>

<emu-clause id="sec-hostmakejobcallback" aoid="HostMakeJobCallback">
<h1>HostMakeJobCallback ( _callback_ )</h1>
<p>HostMakeJobCallback is a host-defined abstract operation that takes argument _callback_ (a function object).</p>
<p>The host-defined abstract operation HostMakeJobCallback takes argument _callback_ (a function object).</p>
<p>The implementation of HostMakeJobCallback must conform to the following requirements:</p>
<ul>
<li>It must always complete normally (i.e., not return an abrupt completion).</li>
Expand All @@ -9880,7 +9880,7 @@ <h1>HostMakeJobCallback ( _callback_ )</h1>

<emu-clause id="sec-hostcalljobcallback" aoid="HostCallJobCallback">
<h1>HostCallJobCallback ( _jobCallback_, _V_, _argumentsList_ )</h1>
<p>HostCallJobCallback is a host-defined abstract operation that takes arguments _jobCallback_ (a JobCallback Record), _V_ (an ECMAScript language value), and _argumentsList_ (a List of ECMAScript language values).</p>
<p>The host-defined abstract operation HostCallJobCallback takes arguments _jobCallback_ (a JobCallback Record), _V_ (an ECMAScript language value), and _argumentsList_ (a List of ECMAScript language values).</p>
<p>The implementation of HostCallJobCallback must conform to the following requirements:</p>
<ul>
<li>It must always perform and return the result of Call(_jobCallback_.[[Callback]], _V_, _argumentsList_).</li>
Expand All @@ -9898,8 +9898,7 @@ <h1>HostCallJobCallback ( _jobCallback_, _V_, _argumentsList_ )</h1>

<emu-clause id="sec-hostenqueuepromisejob" aoid="HostEnqueuePromiseJob">
<h1>HostEnqueuePromiseJob ( _job_, _realm_ )</h1>
<p>HostEnqueuePromiseJob is a host-defined abstract operation that schedules the Job Abstract Closure _job_ to be performed, at some future time. The Abstract Closures used with this algorithm are intended to be related to the handling of Promises, or otherwise, to be scheduled with equal priority to Promise handling operations.</p>
<p>The _realm_ parameter is either *null* or a Realm Record.</p>
<p>The host-defined abstract operation HostEnqueuePromiseJob takes arguments _job_ (a Job Abstract Closure) and _realm_ (a Realm Record or *null*). It schedules _job_ to be performed, at some future time. The Abstract Closures used with this algorithm are intended to be related to the handling of Promises, or otherwise, to be scheduled with equal priority to Promise handling operations.</p>

<p>The implementation of HostEnqueuePromiseJob must conform to the requirements in <emu-xref href="#sec-jobs"></emu-xref> as well as the following:</p>
<ul>
Expand Down Expand Up @@ -16155,7 +16154,7 @@ <h1>Runtime Semantics: Evaluation</h1>

<emu-clause id="sec-hostgetimportmetaproperties" aoid="HostGetImportMetaProperties">
<h1>HostGetImportMetaProperties ( _moduleRecord_ )</h1>
<p>HostGetImportMetaProperties is a host-defined abstract operation that allows hosts to provide property keys and values for the object returned from `import.meta`.</p>
<p>The host-defined abstract operation HostGetImportMetaProperties takes argument _moduleRecord_ (a Module Record). It allows hosts to provide property keys and values for the object returned from `import.meta`.</p>

<p>The implementation of HostGetImportMetaProperties must conform to the following requirements:</p>
<ul>
Expand All @@ -16170,7 +16169,7 @@ <h1>HostGetImportMetaProperties ( _moduleRecord_ )</h1>

<emu-clause id="sec-hostfinalizeimportmeta" aoid="HostFinalizeImportMeta">
<h1>HostFinalizeImportMeta ( _importMeta_, _moduleRecord_ )</h1>
<p>HostFinalizeImportMeta is a host-defined abstract operation that allows hosts to perform any extraordinary operations to prepare the object returned from `import.meta`.</p>
<p>The host-defined abstract operation HostFinalizeImportMeta takes arguments _importMeta_ (an object) and _moduleRecord_ (a Module Record). It allows hosts to perform any extraordinary operations to prepare the object returned from `import.meta`.</p>

<p>Most hosts will be able to simply define HostGetImportMetaProperties, and leave HostFinalizeImportMeta with its default behaviour. However, HostFinalizeImportMeta provides an "escape hatch" for hosts which need to directly manipulate the object before it is exposed to ECMAScript code.</p>

Expand Down Expand Up @@ -22863,7 +22862,7 @@ <h1>ExecuteModule ( ) Concrete Method</h1>

<emu-clause id="sec-hostresolveimportedmodule" aoid="HostResolveImportedModule">
<h1>HostResolveImportedModule ( _referencingScriptOrModule_, _specifier_ )</h1>
<p>HostResolveImportedModule is a host-defined abstract operation that provides the concrete Module Record subclass instance that corresponds to the |ModuleSpecifier| String, _specifier_, occurring within the context of the script or module represented by the Script Record or Module Record _referencingScriptOrModule_. _referencingScriptOrModule_ may also be *null*, if the resolution is being performed in the context of an <emu-xref href="#sec-import-calls">`import()`</emu-xref> expression, and there is no active script or module at that time.</p>
<p>The host-defined abstract operation HostResolveImportedModule takes arguments _referencingScriptOrModule_ (a Script Record or Module Record or *null*) and _specifier_ (a |ModuleSpecifier| String). It provides the concrete Module Record subclass instance that corresponds to _specifier_, occurring within the context of the script or module represented by _referencingScriptOrModule_. _referencingScriptOrModule_ may be *null*, if the resolution is being performed in the context of an <emu-xref href="#sec-import-calls">`import()`</emu-xref> expression, and there is no active script or module at that time.</p>

<emu-note>
<p>An example of when _referencingScriptOrModule_ can be *null* is in a web browser host. There, if a user clicks on a control given by</p>
Expand All @@ -22890,7 +22889,7 @@ <h1>HostResolveImportedModule ( _referencingScriptOrModule_, _specifier_ )</h1>

<emu-clause id="sec-hostimportmoduledynamically" aoid="HostImportModuleDynamically">
<h1>HostImportModuleDynamically ( _referencingScriptOrModule_, _specifier_, _promiseCapability_ )</h1>
<p>HostImportModuleDynamically is a host-defined abstract operation that performs any necessary setup work in order to make available the module corresponding to the |ModuleSpecifier| String, _specifier_, occurring within the context of the script or module represented by the Script Record or Module Record _referencingScriptOrModule_. (_referencingScriptOrModule_ may also be *null*, if there is no active script or module when the <emu-xref href="#sec-import-calls">`import()`</emu-xref> expression occurs.) It then performs FinishDynamicImport to finish the dynamic import process.</p>
<p>The host-defined abstract operation HostImportModuleDynamically takes arguments _referencingScriptOrModule_ (a Script Record or Module Record or *null*), _specifier_ (a |ModuleSpecifier| String), and _promiseCapability_ (a PromiseCapability Record). It performs any necessary setup work in order to make available the module corresponding to _specifier_, occurring within the context of the script or module represented by _referencingScriptOrModule_. (_referencingScriptOrModule_ may be *null*, if there is no active script or module when the <emu-xref href="#sec-import-calls">`import()`</emu-xref> expression occurs.) It then performs FinishDynamicImport to finish the dynamic import process.</p>
<p>The implementation of HostImportModuleDynamically must conform to the following requirements:</p>

<ul>
Expand Down Expand Up @@ -23702,7 +23701,7 @@ <h1>PerformEval ( _x_, _callerRealm_, _strictCaller_, _direct_ )</h1>

<emu-clause id="sec-hostensurecancompilestrings" aoid="HostEnsureCanCompileStrings">
<h1>HostEnsureCanCompileStrings ( _callerRealm_, _calleeRealm_ )</h1>
<p>HostEnsureCanCompileStrings is a host-defined abstract operation that allows host environments to block certain ECMAScript functions which allow developers to compile strings into ECMAScript code.</p>
<p>The host-defined abstract operation HostEnsureCanCompileStrings takes arguments _callerRealm_ (a Realm Record) and _calleeRealm_ (a Realm Record). It allows host environments to block certain ECMAScript functions which allow developers to compile strings into ECMAScript code.</p>
<p>An implementation of HostEnsureCanCompileStrings may complete normally or abruptly. Any abrupt completions will be propagated to its callers. The default implementation of HostEnsureCanCompileStrings is to unconditionally return an empty normal completion.</p>
</emu-clause>

Expand Down Expand Up @@ -25215,7 +25214,7 @@ <h1>prototype</h1>

<emu-clause id="sec-hosthassourcetextavailable" aoid="HostHasSourceTextAvailable">
<h1>HostHasSourceTextAvailable ( _func_ )</h1>
<p>HostHasSourceTextAvailable is a host-defined abstract operation that allows host environments to prevent the source text from being provided for a given function.</p>
<p>The host-defined abstract operation HostHasSourceTextAvailable takes argument _func_ (a function object). It allows host environments to prevent the source text from being provided for _func_.</p>
<p>An implementation of HostHasSourceTextAvailable must complete normally in all cases. This operation must be deterministic with respect to its parameters. Each time it is called with a specific _func_ as its argument, it must return the same completion record. The default implementation of HostHasSourceTextAvailable is to unconditionally return a normal completion with a value of *true*.</p>
</emu-clause>
</emu-clause>
Expand Down Expand Up @@ -37656,7 +37655,7 @@ <h1>TriggerPromiseReactions ( _reactions_, _argument_ )</h1>

<emu-clause id="sec-host-promise-rejection-tracker" aoid="HostPromiseRejectionTracker">
<h1>HostPromiseRejectionTracker ( _promise_, _operation_ )</h1>
<p>HostPromiseRejectionTracker is a host-defined abstract operation that allows host environments to track promise rejections.</p>
<p>The host-defined abstract operation HostPromiseRejectionTracker takes arguments _promise_ (a promise) and _operation_ (*"reject"* or *"handle"*). It allows host environments to track promise rejections.</p>
<p>An implementation of HostPromiseRejectionTracker must complete normally in all cases. The default implementation of HostPromiseRejectionTracker is to unconditionally return an empty normal completion.</p>

<emu-note>
Expand Down

0 comments on commit 03c236d

Please sign in to comment.