Skip to content

Use a group choice to ensure that only one of the contexts or userContexts parameters can be set at a time #913

Open
@whimboo

Description

@whimboo

Several commands make use of contexts and userContexts these days whereby those two parameters are mutual exclusive and at least one of them has to be specified.

Currently they are implemented like:

  ? contexts: [+browsingContext.BrowsingContext],
  ? userContexts: [+browser.UserContext],

This requires an extra step to check that one of both has been specified.

Instead we could use a group choice to enforce the mutability:

  (
    contexts: [+browsingContext.BrowsingContext] //
    userContexts: [+browser.UserContext]
  )

To simplify we probably want to extract it to a new definition which then can easily be used for all of the related commands.

@jgraham, @OrKoN, @sadym-chromium do you have any objections?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions