Skip to content

Commit 7ba5491

Browse files
Update execute a function body for modern ES/html. Fixes #869
1 parent f9225a4 commit 7ba5491

File tree

1 file changed

+22
-31
lines changed

1 file changed

+22
-31
lines changed

webdriver-spec.html

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ <h3>Dependencies</h3>
205205
<dt>ECMAScript
206206
<dd><p>The following terms are defined in the ECMAScript Language Specification: [[!ECMA-262]]
207207
<ul>
208+
<!-- Abrupt Completion --> <li><dfn><a href="https://tc39.github.io/ecma262/#sec-completion-record-specification-type">Abrupt Completion</a></dfn>
208209
<!-- Create a function object --> <li><dfn><a href=http://www.ecma-international.org/ecma-262/5.1/#sec-13.2>Create a function object</a></dfn>
209210
<!-- Directive prologue --> <li><dfn><a href=http://www.ecma-international.org/ecma-262/5.1/#sec-14.1>Directive prologue</a></dfn>
210211
<!-- Early error --> <li><dfn><a href=http://www.ecma-international.org/ecma-262/5.1/#sec-16>Early error</a></dfn>
@@ -213,6 +214,7 @@ <h3>Dependencies</h3>
213214
<!-- Global environment --> <li><dfn><a href=http://www.ecma-international.org/ecma-262/5.1/#sec-10.2.3>Global environment</a></dfn>
214215
<!-- Own property --> <li><dfn data-lt="own properties"><a href=http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.30>Own property</a></dfn>
215216
<!-- parseFloat --> <li><dfn><a href=http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.2.3>parseFloat</a></dfn>
217+
<!-- realm --> <li><dfn><a href="https://tc39.github.io/ecma262/#sec-code-realms">realm</a></dfn>
216218
<!-- Use strict directive --> <li><dfn><a href=http://www.ecma-international.org/ecma-262/5.1/#sec-14.1>Use strict directive</a></dfn>
217219
</ul>
218220

@@ -296,6 +298,8 @@ <h3>Dependencies</h3>
296298
<!-- Checkedness --> <li><dfn><a href=https://html.spec.whatwg.org/#concept-fe-checked>Checkedness</a></dfn>
297299
<!-- Child browsing context --> <li><dfn><a href=https://html.spec.whatwg.org/#child-browsing-context>Child browsing context</a></dfn>
298300
<!-- Close a browsing context --> <li><dfn data-lt="close|closes"><a href=https://html.spec.whatwg.org/#close-a-browsing-context>Close a browsing context</a></dfn>
301+
<!-- Clean up after running a callback --> <li><dfn><a href="https://html.spec.whatwg.org/#clean-up-after-running-a-callback">Clean up after running a callback</a></dfn>
302+
<!-- Clean up after running a script --> <li><dfn><a href="https://html.spec.whatwg.org/#clean-up-after-running-script">Clean up after running a script</a></dfn>
299303
<!-- Code entry-point --> <li><dfn><a href=https://html.spec.whatwg.org/#code-entry-point>Code entry-point</a></dfn>
300304
<!-- Cookie-averse Document object --> <li><dfn><a href=https://html.spec.whatwg.org/#cookie-averse-document-object>Cookie-averse <code>Document</code> object</a></dfn>
301305
<!-- Current entry --> <li><dfn><a href=https://html.spec.whatwg.org/#current-entry>Current entry</a></dfn>
@@ -329,6 +333,8 @@ <h3>Dependencies</h3>
329333
<!-- Parent browsing context --> <li><dfn><a href=https://html.spec.whatwg.org/#parent-browsing-context>Parent browsing context</a></dfn>
330334
<!-- Pause --> <li><dfn data-lt=unpaused><a href=https://html.spec.whatwg.org/#pause>HTML Pause</a></dfn>
331335
<!-- Prompt to unload a document --> <li><dfn data-lt="prompting to unload"><a href=https://html.spec.whatwg.org/#prompt-to-unload-a-document>Prompt to unload a document</a></dfn>
336+
<!-- Prepare to run a callback --> <li><dfn><a href="https://html.spec.whatwg.org/#prepare-to-run-a-callback">Prepare to run a callback</a></dfn>
337+
<!-- Prepare to run a script --> <li><dfn><a href="https://html.spec.whatwg.org/#prepare-to-run-script">Prepare to run a script</a></dfn>
332338
<!-- Radio button --> <li><dfn><a href="https://html.spec.whatwg.org/#radio-button-state-%28type=radio%29">Radio Button</a></dfn> state
333339
<!-- Refresh state pragma directive --> <li><dfn><a href=https://html.spec.whatwg.org/#attr-meta-http-equiv-refresh>Refresh state pragma directive</a></dfn>
334340
<!-- Reset algorithm --><li><dfn><a href=https://html.spec.whatwg.org/#concept-form-reset-control>Reset algorithm</a></dfn>
@@ -6316,9 +6322,8 @@ <h3>Executing Script</h3>
63166322
<li><p>Let <var>environment settings</var> be
63176323
the <a>environment settings object</a> for <var>window</var>.
63186324

6319-
<li><p>Let <var>script environment</var> be
6320-
the <a>script execution environment</a>
6321-
for JavaScript obtained from <var>environment settings</var>.
6325+
<li>Let <var>global scope</var> be <var>environment settings</var> <a>realm</a>'s
6326+
<a>global environment</a>.
63226327

63236328
<li><p>If <var>body</var> is not parsable as a <a>FunctionBody</a>
63246329
or if parsing detects an <a>early error</a>,
@@ -6329,44 +6334,30 @@ <h3>Executing Script</h3>
63296334
then let <var>strict</var> be true,
63306335
otherwise let <var>strict</var> be false.
63316336

6332-
<li><p>Using the <a>script execution environment</a> <var>script environment</var>,
6333-
let <var>function</var> be the result of
6337+
<li><p><a>Prepare to run a script</a> with <var>environment settings</var>.
6338+
6339+
<li><p><a>Prepare to run a callback</a> with <var>environment settings</var>.
6340+
6341+
<li><p>Let <var>function</var> be the result of
63346342
calling <a>create a function object</a> with parameter list of
63356343
an empty <a>List</a>,
63366344
body <var>body</var>,
63376345
scope of the <a>global environment</a>,
63386346
and strict flag <var>strict</var>.
63396347

6340-
<li><p>Let <var>script</var> be a new <a>script</a>.
6341-
6342-
<li><p>Let <var>script</var>’s <a>code entry-point</a>
6343-
be <var>function</var>.
6344-
6345-
<li><p>Let script’s <a>settings object</a> object
6346-
be <var>script settings</var>.
6347-
6348-
<!-- the stuff from here on down is quite dubious -->
6349-
<!-- this incumbent scripts stuff is in webidl but the references don't
6350-
lead anywhere -->
6351-
<!-- li><p><a href="">Push <var>script</var> onto <a>the stack of
6352-
incumbent scripts</a>.</li-->
6348+
<li><p>Let <var>completion</var> be <a>[[\CALL]]</a> with parameter list of
6349+
<var>function</var>,
6350+
<var>window</var>,
6351+
and parameters.
63536352

6354-
<li><p>Invoke the <a>[[\Call]]</a> <a>internal method</a> of <var>function</var>,
6355-
providing <var>window</var> as the this value
6356-
and <var>parameters</var> as the argument values.
6357-
If doing so does not produce an exception,
6358-
let <var>result</var> be <a>success</a> with data set
6359-
to the return value from this function call.
6360-
Otherwise let <var>result</var> be <a>error</a>
6361-
with <a>error code</a> <a>javascript error</a>.
6353+
<li><p><a>Clean up after running a callback</a> with <var>environment settings</var>.
63626354

6363-
<!-- li><p><a href="">Pop <var>script</var> from <a>the stack of
6364-
incumbent scripts</a>.</p></li -->
6355+
<li><p><a>Clean up after running a script</a> with <var>environment settings</var>.
63656356

6366-
<li><p>If <var>result</var> is an <a>error</a>, return result.
6357+
<li><p>If <var>completion</var> is an <a>abrupt completion</a>, return an <a>error</a> with
6358+
<a>error code</a> <a>javascript error</a>.
63676359

6368-
<li><p>Otherwise let <var>json data</var> be a <a>JSON clone</a>
6369-
of <var>result</var>’s data.
6360+
<li><p>Let <var>json data</var> be a <a>JSON clone</a> of <var>completion</var><code>.[[\Value]]</code>.
63706361

63716362
<li><p>Return <a>success</a> with data <var>json data</var>.
63726363
</ol>

0 commit comments

Comments
 (0)