Skip to content

Commit

Permalink
Fix some small issues in script.callFunction and script.evaluate
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Feb 9, 2023
1 parent 1f56b75 commit b2543f2
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4825,11 +4825,13 @@ Note: the |function declaration| is parenthesized and evaluated.

1. [=Clean up after running script=] with |environment settings|.

1. Return |function body evaluation status|.
1. Return (|function script|, |function body evaluation status|).

</div>


<div algorithm="remote end steps for script.callFunction">

The [=remote end steps=] with |session| and |command parameters| are:

1. Let |realm| be the result of [=trying=] to [=get a realm from a target=]
Expand All @@ -4840,7 +4842,7 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. Let |environment settings| be the [=environment settings object=] whose
[=realm execution context=]'s Realm component is |realm|.

1. Let |arguments| be the value of the <code>arguments</code> field
1. Let |command arguments| be the value of the <code>arguments</code> field
of |command parameters|.

1. Let |deserialized arguments| be an empty [=/list=].
Expand All @@ -4865,8 +4867,13 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. Let |result ownership| be the value of the <code>resultOwnership</code> field of
|command parameters|, if present, or <code>none</code> otherwise.

1. Let |function body evaluation status| be the result of [=evaluate function body=]
(|function declaration|, |environment settings|, |base URL|, and |options|).
1. Let |base URL| be the [=API base URL=] of |environment settings|.

1. Let |options| be the [=default classic script fetch options=].

1. Let (<var ignore>script</var>, |function body evaluation status|) be the
result of [=evaluate function body=] with |function declaration|,
|environment settings|, |base URL|, and |options|.

1. If |function body evaluation status|.\[[Type]] is <code>throw</code>:

Expand Down Expand Up @@ -4908,8 +4915,8 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. Assert: |evaluation status|.\[[Type]] is <code>normal</code>.

1. Let |result| be the result of [=serialize as a remote value=] with
|evaluation status|.\[[Value]], <code>1</code> as |max depth|, |result ownership|,
a new [=/map=] as serialization internal map, |realm| and |session|.
|evaluation status|.\[[Value]], <code>1</code> as max depth, |result ownership|,
a new [=/map=] as serialization internal map, |realm|, and |session|.

1. Return a new [=/map=] matching the <code>script.EvaluateResultSuccess</code>
production, with the <code>realm</code> field set to |realm id|,
Expand Down Expand Up @@ -4957,7 +4964,9 @@ TODO: Add timeout argument. It's not totally clear how this ought to work; in
Chrome it seems like the timeout doesn't apply to the promise resolve step, but
that likely isn't what clients want.

The [=remote end steps=] with |session| and |command parameters| are:
<div algorithm="remote end steps for script.evaluate">

The [=remote end steps=] given |session| and |command parameters| are:

1. Let |realm| be the result of [=trying=] to [=get a realm from a target=]
given the value of the <code>target</code> field of |command parameters|.
Expand Down Expand Up @@ -5006,8 +5015,8 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. Assert: |evaluation status|.\[[Type]] is <code>normal</code>.

1. Let |result| be the result of [=serialize as a remote value=] with
|evaluation status|.\[[Value]], <code>1</code> as |max depth|, |result ownership|,
a new [=/map=] as serialization internal map, |realm| and |session|.
|evaluation status|.\[[Value]], <code>1</code> as max depth, |result ownership|,
a new [=/map=] as serialization internal map, |realm|, and |session|.

1. Return a new [=/map=] matching the <code>script.EvaluateResultSuccess</code>
production, with the with the <code>realm</code> field set to |realm id|, and
Expand Down

0 comments on commit b2543f2

Please sign in to comment.