Skip to content

Emitter crashes for static property of class expression #9966

Closed
@ghost

Description

TypeScript Version: nightly

Code

(Requires --target es6)

(class {
    static x = 0;
});

Expected behavior: No crash

Actual behavior:

TypeError: Cannot read property 'id' of undefined
    at Object.getNodeId (tsc.js:13122:18)
    at getGeneratedNameForNode (tsc.js:30138:29)
    at emitClassLikeDeclarationForES6AndHigher (tsc.js:33691:37)
    at emitClassLikeDeclaration (tsc.js:33649:21)
    at emitClassExpression (tsc.js:33639:24)
    at emitJavaScriptWorker (tsc.js:35749:32)
    at emitNodeWithoutSourceMap (tsc.js:35557:21)
    at emitNodeWithSourceMap (tsc.js:35551:21)
    at emitNodeConsideringCommentsOption (tsc.js:35542:21)
    at emit (tsc.js:35525:17)

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