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

Commit

Permalink
New: Add method decorators to AST (fixes #65) (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry authored and nzakas committed Aug 24, 2016
1 parent b8ab833 commit 7364cb9
Show file tree
Hide file tree
Showing 26 changed files with 1,758 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ast-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,10 @@ module.exports = function(ast, extra) {
value: method,
computed: methodNameIsComputed,
static: Boolean(node.flags & ts.NodeFlags.Static),
kind: "method"
kind: "method",
decorators: (node.decorators) ? node.decorators.map(function(d) {
return convertChild(d.expression);
}) : []
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ module.exports = {
},
"kind": "method",
"computed": false,
"decorators": [],
"range": [
103,
119
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
18
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -162,6 +163,7 @@ module.exports = {
29
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
23
],
"computed": true,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
22
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
19
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
41
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
19
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
33
],
"computed": true,
"decorators": [],
"key": {
"type": "Literal",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
26
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
21
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
21
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -162,6 +163,7 @@ module.exports = {
38
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -239,6 +241,7 @@ module.exports = {
56
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
22
],
"computed": true,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -162,6 +163,7 @@ module.exports = {
37
],
"computed": true,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
26
],
"computed": false,
"decorators": [],
"key": {
"type": "Literal",
"loc": {
Expand Down Expand Up @@ -163,6 +164,7 @@ module.exports = {
46
],
"computed": true,
"decorators": [],
"key": {
"type": "Literal",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
14
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -162,6 +163,7 @@ module.exports = {
20
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
15
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -162,6 +163,7 @@ module.exports = {
21
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
14
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -162,6 +163,7 @@ module.exports = {
20
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
14
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down Expand Up @@ -162,6 +163,7 @@ module.exports = {
19
],
"computed": false,
"decorators": [],
"key": {
"type": "Identifier",
"loc": {
Expand Down
Loading

0 comments on commit 7364cb9

Please sign in to comment.