Fix #1146
This commit is contained in:
parent
8516823fa7
commit
aec4d901fa
1 changed files with 13 additions and 10 deletions
|
|
@ -2487,26 +2487,29 @@ function genericPrintNoParens(path: any, options: any, print: any) {
|
|||
|
||||
parts.push(path.call(print, "id"));
|
||||
|
||||
if (n.body && n.body.type === "TSModuleDeclaration") {
|
||||
if (n.body) {
|
||||
parts.push(" ");
|
||||
parts.push(path.call(print, "body"));
|
||||
} else if (n.body) {
|
||||
const bodyLines = path.call(print, "body");
|
||||
if (bodyLines.isEmpty()) {
|
||||
parts.push(" {}");
|
||||
} else {
|
||||
parts.push(" {\n", bodyLines.indent(options.tabWidth), "\n}");
|
||||
}
|
||||
}
|
||||
|
||||
return concat(parts);
|
||||
}
|
||||
|
||||
case "TSModuleBlock":
|
||||
return path.call(
|
||||
case "TSModuleBlock": {
|
||||
const naked = path.call(
|
||||
(bodyPath: any) => printStatementSequence(bodyPath, options, print),
|
||||
"body",
|
||||
);
|
||||
|
||||
if (naked.isEmpty()) {
|
||||
parts.push("{}");
|
||||
} else {
|
||||
parts.push("{\n", naked.indent(options.tabWidth), "\n}");
|
||||
}
|
||||
|
||||
return concat(parts);
|
||||
}
|
||||
|
||||
// https://github.com/babel/babel/pull/10148
|
||||
case "V8IntrinsicIdentifier":
|
||||
return concat(["%", path.call(print, "name")]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue