From 4a4c63a8413ac2c33132b7231a43b2bc99cd8a6a Mon Sep 17 00:00:00 2001 From: "o.drapeza" Date: Wed, 13 May 2020 17:57:07 +0300 Subject: [PATCH] Fix: Change SourceCode usage deprecated node properties start and end to range (fixes #13293) --- lib/source-code/source-code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/source-code/source-code.js b/lib/source-code/source-code.js index 591d5a7e454e..e9c318c05348 100644 --- a/lib/source-code/source-code.js +++ b/lib/source-code/source-code.js @@ -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); @@ -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);