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

Fix returning null from commands #351

wants to merge 1 commit into from

Conversation

jgraham
Copy link
Member

@jgraham jgraham commented Jan 4, 2023

We want returning null to map onto an empty result. We could do this explicitly per command, but it's less verbose to just allow null at the top level.


Preview | Diff

@jugglinmike
Copy link
Contributor

This supports the commands which return "success with data null" (as of fa58031, that's session.subscribe, session.unsubscribe, and browsingContext.handleUserPrompt). It does not support script.removePreloadScript since those steps currently specify "return null." Maybe this patch should update that last command, too.

Also, we'll have to update this part of the definition of "command":

- 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=].

Alternatively, I'll suggest a tweak to gh-350 which makes it more palatable.

@jgraham jgraham force-pushed the handle_null_return branch from 4e586f9 to 0e1e99a Compare January 6, 2023 10:44
We want returning null to map onto an empty result. We could
do this explicitly per command, but it's less verbose to just
allow null at the top level.
@jgraham jgraham force-pushed the handle_null_return branch from 0e1e99a to 359ea5b Compare January 6, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants