-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: comments gen regression (#5003)
try to fix: rolldown/rolldown#2013 1. Before we only considering the ast is untouched, but considering the scenario. ```js const a = /*__PURE__*/ test(), // ^^^ ^^^^^^ is removed during transform b = a(); ``` Then according to the previous algorithm, `PURE` will attach to `b = a()` 2. Now, we try to attach comments as much as possible unless the comments are separated by comments, for the case above, `PURE` will not be attached to `a()` since the content between `b = a()` and `/* __PURE__*/` is not all whitespace. 3. we added back `MoveMap`, for the special case ```js /*__NODE_SIDE_EFFECTS__*/ export const c = 100; // ^^^^^^^^^^^^^^^^^^^^^ should be attached to first declarator, // ^^^^^^ are not whitespace ```
- Loading branch information
1 parent
cd9cf5e
commit b7db235
Showing
6 changed files
with
113 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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