Avoid creating a new line comment when a block comment is preceded by a forward slash (#5562)
Fixes #5557
This commit is contained in:
parent
216cbf5bd6
commit
769eddc788
@ -557,6 +557,9 @@ export default class Printer {
|
||||
val = val.replace(/\n(?!$)/g, `\n${repeat(" ", indentSize)}`);
|
||||
}
|
||||
|
||||
// Avoid creating //* comments
|
||||
if (this.endsWith("/")) this._space();
|
||||
|
||||
this.withSource("start", comment.loc, () => {
|
||||
this._append(val);
|
||||
});
|
||||
|
||||
@ -0,0 +1 @@
|
||||
var foo = 1 / /* leading */ 1;
|
||||
@ -0,0 +1 @@
|
||||
var foo=1/ /* leading */1;
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"compact": true
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user