镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Bad ES6 emit accessing named class-expression in its own static initializer #8467

Description

@jeffreymorlan
let c = class NCE {
    static x = 1;
    static y = NCE.x * 2;
}

Output with --target ES6:

let c = (_a = class NCE {
    },
    _a.x = 1,
    _a.y = NCE.x * 2,
    _a);
var _a;

This fails at runtime as the class expression's name is out of scope.

(Inspired by #8363)

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