-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal implementation of Decorators #2399
Conversation
Can you add testcases for sourcemaps |
@@ -100,11 +100,18 @@ module ts { | |||
let globalIterableType: ObjectType; | |||
|
|||
let anyArrayType: Type; | |||
let globalTypedPropertyDescriptorType: ObjectType; | |||
let globalClassDecoratorType: ObjectType; | |||
let globalClassAnnotationType: ObjectType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's try to limit the number of concepts users have to deal with and keep the decorator only falvor.
Merged manually into master |
@@ -4968,14 +5113,15 @@ module ts { | |||
|
|||
function parseDeclaration(): ModuleElement { | |||
let fullStart = getNodePos(); | |||
let decorators = parseDecorators(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows you to use decorators before the export
keyword.
@decorator export default class Foo {}
But if this is the spec we're following, this isn't actually included in the grammar. Only:
export default @decorator class Foo {}
If you can confirm this is a mistake, I'll open an issue and/or PR if you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subscribers, discussion is being had here wycats/javascript-decorators#7 (comment)
Minimal implementation of Decorators