Fix trailing comment output when the printer returns a doc instead of a string. (#5930)

Previously, Prettier printed `[Object object]` in that situation.
master
Warren Seine 2019-03-03 20:15:08 +01:00 committed by Christopher Chedeau
parent aec3978a13
commit 3a9006659e
1 changed files with 4 additions and 1 deletions

View File

@ -443,7 +443,10 @@ function printTrailingComment(commentPath, print, options) {
return concat([" ", contents]);
}
return concat([lineSuffix(" " + contents), !isBlock ? breakParent : ""]);
return concat([
lineSuffix(concat([" ", contents])),
!isBlock ? breakParent : ""
]);
}
function printDanglingComments(path, options, sameIndent, filter) {