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

Commit ff9d21a

Browse files
NeoReyadsoda0289
authored andcommitted
Fix: Exception thrown when space occurs after function name
Fix issue #123 We can calculate where the function parameters starts by using node.parameters.pos and adding one.
1 parent 1dc4039 commit ff9d21a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/ast-converter.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,6 @@ module.exports = function(ast, extra) {
10481048
case SyntaxKind.GetAccessor:
10491049
case SyntaxKind.SetAccessor:
10501050
case SyntaxKind.MethodDeclaration:
1051-
10521051
// TODO: double-check that these positions are correct
10531052
var methodLoc = ast.getLineAndCharacterOfPosition(node.name.end + 1),
10541053
nodeIsMethod = (node.kind === SyntaxKind.MethodDeclaration),
@@ -1058,7 +1057,7 @@ module.exports = function(ast, extra) {
10581057
generator: false,
10591058
expression: false,
10601059
body: convertChild(node.body),
1061-
range: [ node.name.end, result.range[1]],
1060+
range: [ node.parameter.pos + 1, result.range[1]],
10621061
loc: {
10631062
start: {
10641063
line: methodLoc.line + 1,

0 commit comments

Comments
 (0)