Skip to content

Annex B: --> SingleLineHTMLCloseComment on first line throws SyntaxError #5375

@Oichkatzelesfrettschen

Description

@Oichkatzelesfrettschen

--> is a valid HTML close comment when it appears on the first line of a script (Annex B). Boa rejects it unconditionally with SyntaxError.

Repro (raw script, no preceding newline):

--> this is a comment
throw new EvalError("reached");

Expected: EvalError thrown — the --> line is treated as a comment, execution continues to the next line
Got: SyntaxError

Spec: https://tc39.es/ecma262/#sec-html-like-comments

HTMLCloseComment ::
  WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt]

Failing test262: annexB/language/comments/single-line-html-close-first-line-{1,2,3}.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions