* Transforms the potential method to actual MethodDefinition node. * @return {MethodDefinition}
()
| 50 | * @return {MethodDefinition} |
| 51 | */ |
| 52 | toMethodDefinition() { |
| 53 | return { |
| 54 | type: 'MethodDefinition', |
| 55 | key: { |
| 56 | type: 'Identifier', |
| 57 | name: this.name, |
| 58 | }, |
| 59 | computed: false, |
| 60 | value: { |
| 61 | type: 'FunctionExpression', |
| 62 | async: this.methodNode.async, |
| 63 | params: this.methodNode.params, |
| 64 | defaults: this.methodNode.defaults, |
| 65 | body: this.getBody(), |
| 66 | generator: false, |
| 67 | expression: false, |
| 68 | }, |
| 69 | kind: this.kind, |
| 70 | static: this.static, |
| 71 | comments: extractComments(this.commentNodes), |
| 72 | }; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Removes original prototype assignment node from AST. |
no test coverage detected