parent
123d350524
commit
00d9aa208e
|
@ -831,7 +831,7 @@ function printComment(commentPath, options) {
|
||||||
|
|
||||||
switch (comment.type || comment.kind) {
|
switch (comment.type || comment.kind) {
|
||||||
case "Comment":
|
case "Comment":
|
||||||
return "#" + comment.value;
|
return "#" + comment.value.trimRight();
|
||||||
case "CommentBlock":
|
case "CommentBlock":
|
||||||
case "Block":
|
case "Block":
|
||||||
return "/*" + comment.value + "*/";
|
return "/*" + comment.value + "*/";
|
||||||
|
@ -839,9 +839,9 @@ function printComment(commentPath, options) {
|
||||||
case "Line":
|
case "Line":
|
||||||
// Print shebangs with the proper comment characters
|
// Print shebangs with the proper comment characters
|
||||||
if (options.originalText.slice(util.locStart(comment)).startsWith("#!")) {
|
if (options.originalText.slice(util.locStart(comment)).startsWith("#!")) {
|
||||||
return "#!" + comment.value;
|
return "#!" + comment.value.trimRight();
|
||||||
}
|
}
|
||||||
return "//" + comment.value;
|
return "//" + comment.value.trimRight();
|
||||||
default:
|
default:
|
||||||
throw new Error("Not a comment: " + JSON.stringify(comment));
|
throw new Error("Not a comment: " + JSON.stringify(comment));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1249,6 +1249,21 @@ d //comment
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`trailing_space.js 1`] = `
|
||||||
|
#!/there/is-space-here->
|
||||||
|
|
||||||
|
// Do not trim trailing whitespace from this source file!
|
||||||
|
|
||||||
|
// There is some space here ->
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#!/there/is-space-here->
|
||||||
|
|
||||||
|
// Do not trim trailing whitespace from this source file!
|
||||||
|
|
||||||
|
// There is some space here ->
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`try.js 1`] = `
|
exports[`try.js 1`] = `
|
||||||
// comment 1
|
// comment 1
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/there/is-space-here->
|
||||||
|
|
||||||
|
// Do not trim trailing whitespace from this source file!
|
||||||
|
|
||||||
|
// There is some space here ->
|
Loading…
Reference in New Issue