parent
ee7cfa9501
commit
5d8ffd0c2e
|
@ -161,6 +161,7 @@ function attach(comments, ast, text, options) {
|
|||
handleMemberExpressionComments(enclosingNode, followingNode, comment) ||
|
||||
handleIfStatementComments(
|
||||
text,
|
||||
precedingNode,
|
||||
enclosingNode,
|
||||
followingNode,
|
||||
comment
|
||||
|
@ -209,6 +210,7 @@ function attach(comments, ast, text, options) {
|
|||
handleTemplateLiteralComments(enclosingNode, comment) ||
|
||||
handleIfStatementComments(
|
||||
text,
|
||||
precedingNode,
|
||||
enclosingNode,
|
||||
followingNode,
|
||||
comment
|
||||
|
@ -240,6 +242,7 @@ function attach(comments, ast, text, options) {
|
|||
if (
|
||||
handleIfStatementComments(
|
||||
text,
|
||||
precedingNode,
|
||||
enclosingNode,
|
||||
followingNode,
|
||||
comment
|
||||
|
@ -391,6 +394,7 @@ function addBlockOrNotComment(node, comment) {
|
|||
// }
|
||||
function handleIfStatementComments(
|
||||
text,
|
||||
precedingNode,
|
||||
enclosingNode,
|
||||
followingNode,
|
||||
comment
|
||||
|
@ -408,7 +412,8 @@ function handleIfStatementComments(
|
|||
// The only workaround I found is to look at the next character to see if
|
||||
// it is a ).
|
||||
if (getNextNonSpaceNonCommentCharacter(text, comment) === ")") {
|
||||
return false;
|
||||
addTrailingComment(precedingNode, comment);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (followingNode.type === "BlockStatement") {
|
||||
|
|
|
@ -122,6 +122,13 @@ if (code === 92 /* '\\' */ /* '\\' */) {}
|
|||
|
||||
if (code === 92) /* '\\' */ {}
|
||||
if (code === 92) { /* '\\' */ }
|
||||
|
||||
if (
|
||||
1
|
||||
// Comment
|
||||
) {
|
||||
a;
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if (code === 92 /* '\\' */) {
|
||||
}
|
||||
|
@ -135,4 +142,11 @@ if (code === 92) {
|
|||
/* '\\' */
|
||||
}
|
||||
|
||||
if (
|
||||
1
|
||||
// Comment
|
||||
) {
|
||||
a;
|
||||
}
|
||||
|
||||
`;
|
||||
|
|
|
@ -3,3 +3,10 @@ if (code === 92 /* '\' */ /* '\' */) {}
|
|||
|
||||
if (code === 92) /* '\' */ {}
|
||||
if (code === 92) { /* '\' */ }
|
||||
|
||||
if (
|
||||
1
|
||||
// Comment
|
||||
) {
|
||||
a;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue