Skip to content

tsc emits invalid code for class expression assigned to a reserved word property #26325

Description

TypeScript Version: 3.1.0-dev.20180809, 3.0.1

Search Terms:
Unexpected token, reserved keyword

Code

({for: class{},default: class{}})

Expected behavior:
Emits code with valid identifiers

Actual behavior:
Emits code with invalid identifiers

({
for: /** @class */ (function () {
function for() {
// ~~~ Cannot use the keyword 'for' as a function name
}
...

Playground Link:

Related Issues:

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions