Skip to content

Commit

Permalink
Merge branch 'main' into issue-8852
Browse files Browse the repository at this point in the history
  • Loading branch information
swc-bot authored Apr 16, 2024
2 parents be90249 + 4d73326 commit 6fc7040
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@



- **(es/minifier)** Remove `raw` of strings after modification ([#8865](https://github.com/swc-project/swc/issues/8865)) ([740c0bb](https://github.com/swc-project/swc/commit/740c0bb00a0bb9e0f4d808c9dc71e8087d416f72))


- **(es/parser)** Fix span of `BindingIdent` ([#8859](https://github.com/swc-project/swc/issues/8859)) ([fbd32fb](https://github.com/swc-project/swc/commit/fbd32fbff323ff4116e82d2dd1d763f7f3844de2))


Expand Down
3 changes: 2 additions & 1 deletion crates/swc_ecma_minifier/src/compress/pure/evaluate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,10 @@ impl Pure<'_> {
};

self.changed = true;
report_change!("evaluate: Evaluated `{}` of a string literal", method);
report_change!("evaluate: Evaluated `{method}` of a string literal");
*e = Expr::Lit(Lit::Str(Str {
value: new_val.into(),
raw: None,
..s
}));
}
Expand Down
19 changes: 19 additions & 0 deletions crates/swc_ecma_minifier/tests/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11193,3 +11193,22 @@ fn issue_8246_1() {
false,
);
}

#[test]
fn issue_8864_1() {
run_default_exec_test(
"
class Renderer {
renderStaticFrame(string1, string2) {
const line1Text = `${string1} and ${string2}`.toUpperCase();
const line2Text = 'line 2 text'.toUpperCase();
const text = `${line1Text}\n${line2Text}`;
return text;
}
}
console.log(new Renderer().renderStaticFrame('a', 'b'));
",
)
}

0 comments on commit 6fc7040

Please sign in to comment.