(ast, text)
| 30 | }); |
| 31 | |
| 32 | function postParse(ast, text) { |
| 33 | function attachComments(node) { comment.ensureCommentsBefore(text, node); } |
| 34 | |
| 35 | walk.simple(ast, { |
| 36 | VariableDeclaration: attachComments, |
| 37 | FunctionDeclaration: attachComments, |
| 38 | MethodDefinition: attachComments, |
| 39 | Property: attachComments, |
| 40 | AssignmentExpression: function(node) { |
| 41 | if (node.operator == "=") attachComments(node); |
| 42 | }, |
| 43 | CallExpression: function(node) { |
| 44 | if (isDefinePropertyCall(node)) attachComments(node); |
| 45 | }, |
| 46 | ExportNamedDeclaration: attachComments, |
| 47 | ExportDefaultDeclaration: attachComments, |
| 48 | ClassDeclaration: attachComments |
| 49 | }); |
| 50 | } |
| 51 | |
| 52 | function isDefinePropertyCall(node) { |
| 53 | return node.callee.type == "MemberExpression" && |
nothing calls this directly
no test coverage detected
searching dependent graphs…