Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Commit

Permalink
Merge pull request #12 from shuhei/parameter-decorators
Browse files Browse the repository at this point in the history
Parse parameter decorators
  • Loading branch information
sebmck committed Mar 28, 2016
2 parents 6b14e4c + 29a6578 commit 8b15081
Show file tree
Hide file tree
Showing 13 changed files with 1,870 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/parser/lval.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) {
this.expect(close);
break;
} else {
let decorators = [];
while (this.match(tt.at)) {
decorators.push(this.parseDecorator());
}
let left = this.parseMaybeDefault();
if (decorators.length) {
left.decorators = decorators;
}
this.parseAssignableListItemTypes(left);
elts.push(this.parseMaybeDefault(null, null, left));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Foo {
constructor(@foo() x, @bar({ a: 123 }) @baz() y) {}
}
Loading

0 comments on commit 8b15081

Please sign in to comment.