Skip to content
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

Closed
wants to merge 29 commits into from
Closed

Minimal implementation of Decorators #2399

wants to merge 29 commits into from

Conversation

rbuckton
Copy link
Member

Minimal implementation of Decorators

@paulvanbrenk
Copy link
Contributor

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;
Copy link
Contributor

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.

@rbuckton
Copy link
Member Author

Merged manually into master

@mhegazy mhegazy deleted the decorators_min branch March 25, 2015 19:31
@mhegazy mhegazy mentioned this pull request Mar 25, 2015
@@ -4968,14 +5113,15 @@ module ts {

function parseDeclaration(): ModuleElement {
let fullStart = getNodePos();
let decorators = parseDecorators();

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.

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)

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants