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
ea479ca5a8
commit
73ff38e35b
@ -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