parent
7046d978a4
commit
d8c242891b
|
@ -542,7 +542,9 @@ function genericPrintNoParens(path, options, print) {
|
|||
!n.comments &&
|
||||
(parent.type === "ArrowFunctionExpression" ||
|
||||
parent.type === "FunctionExpression" ||
|
||||
parent.type === "FunctionDeclaration")
|
||||
parent.type === "FunctionDeclaration" ||
|
||||
parent.type === "ObjectMethod" ||
|
||||
parent.type === "ClassMethod")
|
||||
) {
|
||||
return "{}";
|
||||
}
|
||||
|
|
|
@ -41,6 +41,10 @@ class A { // comment
|
|||
|
||||
class A {
|
||||
}
|
||||
|
||||
class A {
|
||||
m() {}
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
class A {
|
||||
// comment
|
||||
|
@ -51,6 +55,10 @@ class A {
|
|||
}
|
||||
|
||||
class A {}
|
||||
|
||||
class A {
|
||||
m() {}
|
||||
}
|
||||
"
|
||||
`;
|
||||
|
||||
|
|
|
@ -7,3 +7,7 @@ class A { // comment
|
|||
|
||||
class A {
|
||||
}
|
||||
|
||||
class A {
|
||||
m() {}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,13 @@ a = () => ({}).x;
|
|||
"
|
||||
`;
|
||||
|
||||
exports[`test method.js 1`] = `
|
||||
"a = { f() {} }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
a = { f() {} };
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`test range.js 1`] = `
|
||||
"group(
|
||||
concat([
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
a = { f() {} }
|
Loading…
Reference in New Issue