This commit is contained in:
Lily Scott 2022-07-12 17:33:05 -06:00
parent 8516823fa7
commit aec4d901fa

View file

@ -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")]);