check whether the last child is the same node as the one we're removing comments from - fixes #2072, fixes #2068
This commit is contained in:
parent
e15a28cc1c
commit
2ed9416e19
@ -73,7 +73,7 @@ pp.processComment = function (node) {
|
||||
}
|
||||
|
||||
if (lastChild) {
|
||||
if (lastChild.leadingComments && last(lastChild.leadingComments).end <= node.start) {
|
||||
if (lastChild !== node && lastChild.leadingComments && last(lastChild.leadingComments).end <= node.start) {
|
||||
node.leadingComments = lastChild.leadingComments;
|
||||
lastChild.leadingComments = null;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user