Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix returning null from commands #351

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,12 @@ Each [=command=] is defined by:
- A <dfn export for=command>result type</dfn>, which is defined by a [=local
end definition=] fragment.
- A set of [=remote end steps=] which define the actions to take for a command
given a [=BiDi session=] and [=command parameters=] and return an
instance of the command [=result type=].
given a [=BiDi session=] and [=command parameters=]. If the command runs to
completion these steps return [=success=] with either a [=map=] matching the
command [=result type=] production or with null to indicate an
<code>EmptyResult</code>. If the command does not run to completion these
steps return [=error=] with the [=error code=] that will be reported to the
user.

A command that can run without an active session is a <dfn>static
command</dfn>. Commands are not static commands unless stated in their
Expand Down Expand Up @@ -797,6 +801,8 @@ To <dfn>handle an incoming message</dfn> given a [=WebSocket connection=]

1. Let |value| be |result|'s data.

1. If |value| is null, set |value| to an empty map.

1. Assert: |value| matches the definition for the [=result type=]
corresponding to the command with [=command name=] |method|.

Expand Down Expand Up @@ -4917,7 +4923,7 @@ The [=remote end steps=] given |session| and |command parameters| are:

1. <a for=set>Remove</a> |script| from |preload script map|.

1. Return null
1. Return [=success=] with data null

</div>

Expand Down