代码之家  ›  专栏  ›  技术社区  ›  Max Heiber

为什么标识符要在类型脚本编译器中扩展声明?

  •  2
  • Max Heiber  · 技术社区  · 7 年前

    在TS编译器内部,用于 Identifier 延伸 Declaration :

    export interface Identifier extends PrimaryExpression, Declaration {
        ...
    }
    

    为什么?

    在公共API中的实际AST中, const x = 3 (整个范围)是 VariableDeclaration 以及 x 部分是 name 类型声明的属性 标识符 . 那么为什么 标识符 它本身就是 src/compiler/types.ts ?

    0 回复  |  直到 7 年前