-
-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
28eb9a2
commit d535900
Showing
6 changed files
with
427 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 changes: 152 additions & 0 deletions
152
tests/fixtures/attach-comments/comment-within-condition.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
module.exports = { | ||
"type": "Program", | ||
"body": [ | ||
{ | ||
"type": "IfStatement", | ||
"test": { | ||
"type": "Identifier", | ||
"name": "a", | ||
"range": [ | ||
25, | ||
26 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 15 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 16 | ||
} | ||
}, | ||
"leadingComments": [ | ||
{ | ||
"type": "Block", | ||
"value": " bar ", | ||
"range": [ | ||
14, | ||
23 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 13 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"consequent": { | ||
"type": "BlockStatement", | ||
"body": [], | ||
"range": [ | ||
28, | ||
30 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 18 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 20 | ||
} | ||
} | ||
}, | ||
"alternate": null, | ||
"range": [ | ||
10, | ||
30 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 20 | ||
} | ||
}, | ||
"leadingComments": [ | ||
{ | ||
"type": "Block", | ||
"value": " foo ", | ||
"range": [ | ||
0, | ||
9 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"sourceType": "script", | ||
"range": [ | ||
10, | ||
30 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 20 | ||
} | ||
}, | ||
"comments": [ | ||
{ | ||
"type": "Block", | ||
"value": " foo ", | ||
"range": [ | ||
0, | ||
9 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Block", | ||
"value": " bar ", | ||
"range": [ | ||
14, | ||
23 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 13 | ||
} | ||
} | ||
} | ||
] | ||
}; |
2 changes: 2 additions & 0 deletions
2
tests/fixtures/attach-comments/comment-within-condition.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* foo */ | ||
if (/* bar */ a) {} |
Oops, something went wrong.