Update decorators parsing (#7719)

* Update decorators parsing

This commit introduces three changes:
1) Class properties can be decorated
2) Decorators can contain arbitrary expressions, using @(...)
3) The Decorator node type has a new property, "arguments". This
    makes it possible do distinguish @dec() and @(dec()), which have
    different behaviors because @(dec()) is equivalent to @(dec())().

* Rename Decorator#expression to Decorator#callee

* Add test for @dec()()
This commit is contained in:
Nicolò Ribaudo
2018-04-17 23:22:03 +02:00
committed by Brian Ng
parent 81149a5cc9
commit 341bdab90c
72 changed files with 2172 additions and 505 deletions

View File

@@ -91,7 +91,7 @@ export function Super() {
export function Decorator(node: Object) {
this.token("@");
this.print(node.expression, node);
this.print(node.callee, node);
this.newline();
}