Skip to content

First token after class should use previous strict-mode state #912

@pvdz

Description

@pvdz

This is the same bug as Babel: babel/babel#11183

I guess when parsing the } closing token of a class, the next token is still parsed as the strict-mode context from that class, rather than using the outer strict mode status.

In script mode, this (a legacy octal) passes in Acorn/Babel (because it applies annexb by default):

05

This fails after a class:

class x {}
05

But passes with anything in between:

class x {}
y
05

(All the above cases should pass in non-strict script mode under annexb rules)

[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions