Skip to content

Make bullets in 11.1 consistent #1659

Description

@Nigel-Ecma

The first bullet names its construct “switch statement”, the second uses the rule name, “is-pattern”, while the third does both, “switch expression” & ”switch-expression”. Maybe use one style consistently? Given the second bullet I might go with the rule names:

- In a *switch_statement*, the *pattern* of a *switch_label* is tested against the *selector_expression* of the *switch_statement*.  
- With an *is-pattern* operator, the *pattern* on the right-hand-side is tested against the expression on the left.  
- In a *switch_expression*, the *pattern* of a *switch_expression_arm* is tested against the expression on the *switch_expression*’s left-hand-side.  
- In nested contexts, the *sub-pattern* is tested against values retrieved from properties, fields, or indexed from other input values, depending on the pattern form.  

Yes, I left two occurrences of “expression” as in both cases expression is technically wrong but the actual rule name would I think be unhelpful.

Feel free to wordsmith better options!

Originally posted by @Nigel-Ecma in #873 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions