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

Commit c204b8d

Browse files
committed
Fix error with space after function name
1 parent 1dc4039 commit c204b8d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/.ast-converter.js.swp

96 KB
Binary file not shown.

lib/ast-converter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ module.exports = function(ast, extra) {
10481048
case SyntaxKind.GetAccessor:
10491049
case SyntaxKind.SetAccessor:
10501050
case SyntaxKind.MethodDeclaration:
1051+
var offset = node.parameters.pos - node.name.end - 1;
10511052

10521053
// TODO: double-check that these positions are correct
10531054
var methodLoc = ast.getLineAndCharacterOfPosition(node.name.end + 1),
@@ -1058,7 +1059,7 @@ module.exports = function(ast, extra) {
10581059
generator: false,
10591060
expression: false,
10601061
body: convertChild(node.body),
1061-
range: [ node.name.end, result.range[1]],
1062+
range: [ node.name.end + offset, result.range[1]],
10621063
loc: {
10631064
start: {
10641065
line: methodLoc.line + 1,

0 commit comments

Comments
 (0)