mirror of
https://github.com/swc-project/swc.git
synced 2024-11-27 13:38:33 +03:00
fix(es/minifier): Remove raw
of strings after modification (#8865)
**Related issue:** - Closes #8864
This commit is contained in:
parent
af19385097
commit
740c0bb00a
@ -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
|
||||
}));
|
||||
}
|
||||
|
@ -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'));
|
||||
",
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user