Skip to content

Missing ASI after field named getΒ #59549

Closed
@nicolo-ribaudo

Description

@nicolo-ribaudo

πŸ”Ž Search Terms

class field asi

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?noImplicitAny=false&filetype=js#code/MYGwhgzhAECC0G8BQ1XQOYFMAuK0CoAPACgEpEBfJKoA

πŸ’» Code

class A {
    get
    *x() {}
}

πŸ™ Actual behavior

tsc marks the * as an error (Identifier expected.)

πŸ™‚ Expected behavior

Given that there cannot be a * after get, ASI kicks in and that code is equivalent to

class A {
    get;
    *x() {}
}

Additional information about the issue

Firefox also gets this wrong, I submitted a test262 test case: tc39/test262#4189

Also, ASI does not apply to

class A {
    get
    async x() {}
}

because async is a valid token after get.

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions