Skip to content

Commit 0d515b9

Browse files
committed
Rename to hasSameLoc
1 parent c4fe5ef commit 0d515b9

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/language-js/printer-estree.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const {
6969
hasNewlineBetweenOrAfterDecorators,
7070
hasNgSideEffect,
7171
hasPrettierIgnore,
72+
hasSameLoc,
7273
hasTrailingComment,
7374
hasTrailingLineComment,
7475
identity,
@@ -91,7 +92,6 @@ const {
9192
isNumericLiteral,
9293
isObjectType,
9394
isObjectTypePropertyAFunction,
94-
isSameNode,
9595
isSimpleFlowType,
9696
isSimpleNumber,
9797
isSimpleTemplateLiteral,
@@ -804,15 +804,15 @@ function printPathNoParens(path, options, print, args) {
804804

805805
parts.push(path.call(print, "imported"));
806806

807-
if (n.local && !isSameNode(n.local, n.imported, options)) {
807+
if (n.local && !hasSameLoc(n.local, n.imported, options)) {
808808
parts.push(" as ", path.call(print, "local"));
809809
}
810810

811811
return concat(parts);
812812
case "ExportSpecifier":
813813
parts.push(path.call(print, "local"));
814814

815-
if (n.exported && !isSameNode(n.local, n.exported, options)) {
815+
if (n.exported && !hasSameLoc(n.local, n.exported, options)) {
816816
parts.push(" as ", path.call(print, "exported"));
817817
}
818818

src/language-js/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ function sameLocEnd(nodeA, nodeB, { locEnd }) {
360360
* @param {Node} nodeB
361361
* @returns {boolean}
362362
*/
363-
function isSameNode(nodeA, nodeB, options) {
363+
function hasSameLoc(nodeA, nodeB, options) {
364364
return (
365365
sameLocStart(nodeA, nodeB, options) && sameLocEnd(nodeA, nodeB, options)
366366
);
@@ -1396,6 +1396,7 @@ module.exports = {
13961396
hasNgSideEffect,
13971397
hasNode,
13981398
hasPrettierIgnore,
1399+
hasSameLoc,
13991400
hasTrailingComment,
14001401
hasTrailingLineComment,
14011402
identity,
@@ -1422,7 +1423,6 @@ module.exports = {
14221423
isNumericLiteral,
14231424
isObjectType,
14241425
isObjectTypePropertyAFunction,
1425-
isSameNode,
14261426
isSimpleFlowType,
14271427
isSimpleNumber,
14281428
isSimpleTemplateLiteral,

0 commit comments

Comments
 (0)