-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Domain: DecoratorsThe issue relates to the decorator syntaxThe issue relates to the decorator syntaxDomain: JS EmitThe issue relates to the emission of JavaScriptThe issue relates to the emission of JavaScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)Fix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
As per conclusions we arrived at in the January 2023 meeting
- we should allow decorators before and after
export/export default, but not around both. - our down-level emit and printing should preserve the ordering of where decorators are placed.
declare function decorator(...args: any[]): any;
// ✅ Works!
@decorator export class Foo {}
// ✅ Works!
export @decorator class Bar {}
// ❌ You have to pick *one or the other*.
@decorator export @decorator class Baz {}declare function decorator(...args: any[]): any;
// ✅ Works!
@decorator export default class Foo {}
// ✅ Works!
export default @decorator class default Bar {}
// ❌ Not in between.
export @decorator default class Baz {}
// ❌ Not around both.
@decorator export default @decorator class Biz {}
// ❌ DEFINITELY not interleaved.
@decorator export @decorator default @decorator class Wat {}Metadata
Metadata
Assignees
Labels
Domain: DecoratorsThe issue relates to the decorator syntaxThe issue relates to the decorator syntaxDomain: JS EmitThe issue relates to the emission of JavaScriptThe issue relates to the emission of JavaScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)Fix AvailableA PR has been opened for this issueA PR has been opened for this issue