Skip to content

continue label incorrectly allowed to be a non-IterationStatement label #287

@michaelficarra

Description

@michaelficarra

The invalid program for(;;){ a: continue a; } is parsed successfully. See ES5 section 12.7, specifically

A program is considered syntactically incorrect if [...] The program contains a continue statement with the optional Identifier, where Identifier does not appear in the label set of an enclosing (but not crossing function boundaries) IterationStatement.

as opposed to section 12.8 (break) which states

A program is considered syntactically incorrect if [...] The program contains a break statement with the optional Identifier, where Identifier does not appear in the label set of an enclosing (but not crossing function boundaries) Statement."

emphasis mine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions