This repository has been archived by the owner on May 19, 2018. It is now read-only.
fixes #13: limit decorator use to CallExpression and IdentifierReference #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an initial stab at #13 that realizes the proposal wycats/javascript-decorators#66
What the patch does is replace the call to parseMaybeAssign() with parseExprSubscripts(), in addition it will also eat the first '@' as parseDecorator() gets called by parseExprOps().
Subsequently, CallExpression and IdentifierReference are realized with the benefit of being able to use subscripts, e.g.
@decorators[Symbol](...)
etc.Not sure about the template handling also available in parseSubscripts(), though.
My initial integration tests using a real project seem to work fine. Needs additional work on the test cases though, see test/fixtures/experimental/uncategorized/63.
Also, the decorator must be made aware of the fact that it is decorating a generator function a/o an async function. But this is part of the transpiler is it not?
How do I create the expected.json?