From c5a407f457444c4714baef5b4cdd04bb9ff6ca63 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 26 Jul 2015 21:58:22 +0100 Subject: [PATCH] really fix comment attachment --- packages/babylon/src/parser/comments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babylon/src/parser/comments.js b/packages/babylon/src/parser/comments.js index 9c5d58070f..3b8345fa65 100644 --- a/packages/babylon/src/parser/comments.js +++ b/packages/babylon/src/parser/comments.js @@ -74,7 +74,7 @@ pp.processComment = function (node) { if (lastChild) { if (lastChild.leadingComments) { - if (last(lastChild.leadingComments).end < node.start) { + if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) { node.leadingComments = lastChild.leadingComments; lastChild.leadingComments = null; } else {