Comments in parentheses disappear#12560
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/36479/ |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 11df46a:
|
|
From my understanding, the bug involves the parser. When a node has inner comments, they are first considered as trailing comments and then set as inner comments. Except that this was never the case because of two inconsistent if statements. (see the changes in comments.js file) Another problem involves the generators. In particular a And what about a It looks like those inner comments can be found in plenty of places. As I barely have any technical knowledge about Babel, I would highly appreciate some help to try and figure out how wide spread this problem is. The idea is to see how much code this bugfix should impact. Thanks! 🎅 |
| foo | ||
| /* WORKING */ | ||
| ( | ||
| /* NOT WORKING */ |
There was a problem hiding this comment.
We should only consider comments in params as innerComments of CallExpression when it does not have param, otherwise the comment should be categorized as leading / trailing comments of adjacent parameters.
CI fails because`/* comment 1*/ in input source
fn(a, b, /* comment 1 */) /* comment 2*/;
was now an innerComment. Generally Babel avoids generating innerComments because where they should be inserted can be vague.
Uh oh!
There was an error while loading. Please reload this page.