Fix comma when an arrow function with no arguments breaks (#210)

Fixes #118
master
Christopher Chedeau 2017-01-14 20:55:38 -08:00 committed by James Long
parent 15cc3bb778
commit b9d2d1aac5
3 changed files with 15 additions and 0 deletions

View File

@ -1737,6 +1737,10 @@ function printFunctionParams(path, print, options) {
printed.push(concat([ "...", path.call(print, "rest") ]));
}
if (printed.length === 0) {
return "()";
}
return concat([
"(",
indent(

View File

@ -49,3 +49,13 @@ function selectBestEffortImageForWidth(
}
"
`;
exports[`test long-call-no-args.js 1`] = `
"veryLongCall(VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_LONG_CONSTANT, () => {})
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
veryLongCall(
VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_LONG_CONSTANT,
() => {}
);
"
`;

View File

@ -0,0 +1 @@
veryLongCall(VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_LONG_CONSTANT, () => {})