remove comments from old node after inheriting from new one when replacing nodes - closes #2490, closes #2489
This commit is contained in:
parent
fa88b1c00d
commit
6740561f91
@ -137,8 +137,11 @@ export function replaceWith(replacement, whateverAllowed) {
|
||||
return this.replaceExpressionWithStatements([replacement]);
|
||||
}
|
||||
|
||||
var oldNode = this.node;
|
||||
if (oldNode) t.inheritsComments(replacement, oldNode);
|
||||
let oldNode = this.node;
|
||||
if (oldNode) {
|
||||
t.inheritsComments(replacement, oldNode);
|
||||
t.removeComments(oldNode);
|
||||
}
|
||||
|
||||
// replace the node
|
||||
this._replaceWith(replacement);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user