mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
try to fix: https://github.com/rolldown/rolldown/issues/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 ``` |
||
|---|---|---|
| .. | ||
| annotation_comment.rs | ||
| binary_expr_visitor.rs | ||
| context.rs | ||
| gen.rs | ||
| lib.rs | ||
| operator.rs | ||
| sourcemap_builder.rs | ||