fixes #13: limit decorator use to CallExpression and IdentifierReference#14
fixes #13: limit decorator use to CallExpression and IdentifierReference#14silkentrance wants to merge 1 commit into
Conversation
|
If it parses successfully it will generate a expected.json for you when you run the test if it isn't provided |
|
@hzoo thanks for pointing this out. I will check the fixtures and see whether the file is there. |
|
@hzoo I didn't realize it but the expected.json was generated and seems to be fine. |
|
@hzoo I have added additional test cases for testing "fringe" use cases of decorators and also invalid uses such as Also adds missing tests such as See test/fixtures/experimental/uncategorized/[63..75]. I need you or someone else to review the generated expected.json files as I am not that familiar with the AST the babylon parser generates. |
|
@hzoo @wycats How does or can the alternate use of While And since |
|
I'm concerned that this would be a breaking change, we'll need to work out how to coordinate it. |
|
covered by #590 |
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?