为什么 TypeScript 不支持 export @deco?
Why does TypeScript not support export @deco?
此问题已在 https://github.com/tc39/proposal-decorators/issues/69 中讨论过,那么为什么 TypeScript 不支持它?
此代码无效:
export @deco()
class a {};
虽然这个是:
@deco
export class a {};
来自issue #31370:
The Decorators Proposal is still in flux and we do not intend to make any significant changes to our implementation until the proposal has officially reached Stage 3. We will revisit this issue at that time.
顺便说一句,Decorators 提案目前处于第 2 阶段。
此问题已在 https://github.com/tc39/proposal-decorators/issues/69 中讨论过,那么为什么 TypeScript 不支持它?
此代码无效:
export @deco()
class a {};
虽然这个是:
@deco
export class a {};
来自issue #31370:
The Decorators Proposal is still in flux and we do not intend to make any significant changes to our implementation until the proposal has officially reached Stage 3. We will revisit this issue at that time.
顺便说一句,Decorators 提案目前处于第 2 阶段。