-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since PR babel/babylon#478 , some comments are now attached to the previous node. This is the case for example when the previous statement doesn't finish with a semi. Let's search for the comment in previous node trailing comments too. Shoul fix #2
- Loading branch information
1 parent
55eb9fa
commit 1616d55
Showing
3 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/__tests__/fixtures/previous_statement_trailing_comments/expected.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,16 @@ | ||
'use strict'; | ||
|
||
// foo | ||
|
||
const __test__ = {}; | ||
const Biz = { | ||
bar: true | ||
|
||
// @test-export | ||
}; | ||
__test__.format = function format(rights) { | ||
console.log('whatever'); | ||
}; | ||
|
||
module.exports = {}; | ||
module.exports.__test__ = __test__ |
13 changes: 13 additions & 0 deletions
13
src/__tests__/fixtures/previous_statement_trailing_comments/input.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,13 @@ | ||
'use strict' | ||
|
||
// foo | ||
const Biz = { | ||
bar: true, | ||
} | ||
|
||
// @test-export | ||
function format(rights) { | ||
console.log('whatever') | ||
} | ||
|
||
module.exports = {} |
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