parent
8ed75acf46
commit
d944ebf6db
|
@ -977,7 +977,7 @@ function genericPrintNoParens(path, options, print) {
|
|||
if (n.test) parts.push("case ", path.call(print, "test"), ":");
|
||||
else parts.push("default:");
|
||||
|
||||
if (n.consequent.length > 0) {
|
||||
if (n.consequent.find(node => node.type !== "EmptyStatement")) {
|
||||
const cons = path.call(
|
||||
function(consequentPath) {
|
||||
return printStatementSequence(consequentPath, options, print);
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
exports[`test empty_switch.js 1`] = `
|
||||
"switch (1) { default:; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
switch (1) {
|
||||
default:
|
||||
}
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`test more_switch.js 1`] = `
|
||||
"/* @flow */
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
switch (1) { default:; }
|
Loading…
Reference in New Issue