Skip to content

Commit

Permalink
Fix missing inner comments in function expressions (#13825)
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Oct 7, 2021
1 parent c2f747c commit 6029252
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-generator/src/generators/methods.ts
Expand Up @@ -84,6 +84,7 @@ export function _functionHead(this: Printer, node: any) {
}
this.word("function");
if (node.generator) this.token("*");
this.printInnerComments(node);

this.space();
if (node.id) {
Expand Down
@@ -0,0 +1,7 @@
const f = function /*foo*/ () {};
const g = async function /*foo*/ () {};
const h = async /*foo*/ function () {};
const i = function* /*foo*/ () {};
const j = function/*foo*/* () {};
const k = async function* /*foo*/ () {};
const l = function (/*foo*/) {};
@@ -0,0 +1,3 @@
{
"retainLines": true
}
@@ -0,0 +1,7 @@
const f = function /*foo*/ () {};
const g = async function /*foo*/ () {};
const h = async function /*foo*/ () {};
const i = function* /*foo*/ () {};
const j = function* /*foo*/ () {};
const k = async function* /*foo*/ () {};
const l = function /*foo*/ () {};

0 comments on commit 6029252

Please sign in to comment.