Skip to content

Commit

Permalink
Remove unused variable (#9089)
Browse files Browse the repository at this point in the history
When I was reading the code, I see `parent` is not used in `_getComments` function.
so it make me confused why we delivery the `parent` in those functions.

If I'm wrong, please correct me.
  • Loading branch information
Gcaufy authored and danez committed Nov 27, 2018
1 parent 2bb24f9 commit 0047ae8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/babel-generator/src/printer.js
Expand Up @@ -363,14 +363,14 @@ export default class Printer {
}
if (needsParens) this.token("(");

this._printLeadingComments(node, parent);
this._printLeadingComments(node);

const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;
this.withSource("start", loc, () => {
this[node.type](node, parent);
});

this._printTrailingComments(node, parent);
this._printTrailingComments(node);

if (needsParens) this.token(")");

Expand Down Expand Up @@ -472,12 +472,12 @@ export default class Printer {
this.print(node, parent);
}

_printTrailingComments(node, parent) {
this._printComments(this._getComments(false, node, parent));
_printTrailingComments(node) {
this._printComments(this._getComments(false, node));
}

_printLeadingComments(node, parent) {
this._printComments(this._getComments(true, node, parent));
_printLeadingComments(node) {
this._printComments(this._getComments(true, node));
}

printInnerComments(node, indent = true) {
Expand Down

0 comments on commit 0047ae8

Please sign in to comment.