Skip to content

Commit

Permalink
Fix: Change SourceCode usage deprecated node properties start and end…
Browse files Browse the repository at this point in the history
… to range (fixes eslint#13293)
  • Loading branch information
o.drapeza committed May 13, 2020
1 parent 3d03df0 commit 4a4c63a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/source-code/source-code.js
Expand Up @@ -349,7 +349,7 @@ class SourceCode extends TokenStore {
let currentToken = this.getTokenBefore(node, { includeComments: true });

while (currentToken && isCommentToken(currentToken)) {
if (node.parent && (currentToken.start < node.parent.start)) {
if (node.parent && (currentToken.range[0] < node.parent.range[0])) {
break;
}
comments.leading.push(currentToken);
Expand All @@ -361,7 +361,7 @@ class SourceCode extends TokenStore {
currentToken = this.getTokenAfter(node, { includeComments: true });

while (currentToken && isCommentToken(currentToken)) {
if (node.parent && (currentToken.end > node.parent.end)) {
if (node.parent && (currentToken.range[1] > node.parent.range[1])) {
break;
}
comments.trailing.push(currentToken);
Expand Down

0 comments on commit 4a4c63a

Please sign in to comment.