mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
fix(es/minifier): Fix unicode handling (#5875)
This commit is contained in:
parent
5cf78b0213
commit
c3fa96b21b
@ -200,6 +200,7 @@ impl Pure<'_> {
|
||||
|| (!c.contains("\\n") && !c.contains("\\r")))
|
||||
&& !c.contains("\\0")
|
||||
&& !c.contains("\\x")
|
||||
&& !c.contains("\\u")
|
||||
{
|
||||
let value = c
|
||||
.replace("\\`", "`")
|
||||
|
@ -10029,3 +10029,12 @@ fn issue_5645() {
|
||||
|
||||
run_exec_test(src, config, false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issue_5799() {
|
||||
let src = r###"
|
||||
console.log(`\u2014`)
|
||||
"###;
|
||||
|
||||
run_default_exec_test(src);
|
||||
}
|
||||
|
@ -2395,8 +2395,22 @@ impl ExprCtx {
|
||||
});
|
||||
}
|
||||
|
||||
Expr::TaggedTpl { .. } => unimplemented!("add_effects for tagged template literal"),
|
||||
Expr::Tpl { .. } => unimplemented!("add_effects for template literal"),
|
||||
Expr::TaggedTpl(TaggedTpl {
|
||||
tag,
|
||||
tpl: Tpl { exprs, .. },
|
||||
..
|
||||
}) => {
|
||||
self.extract_side_effects_to(to, *tag);
|
||||
|
||||
exprs
|
||||
.into_iter()
|
||||
.for_each(|e| self.extract_side_effects_to(to, *e));
|
||||
}
|
||||
Expr::Tpl(Tpl { exprs, .. }) => {
|
||||
exprs
|
||||
.into_iter()
|
||||
.for_each(|e| self.extract_side_effects_to(to, *e));
|
||||
}
|
||||
Expr::Class(ClassExpr { .. }) => unimplemented!("add_effects for class expression"),
|
||||
|
||||
Expr::JSXMember(..)
|
||||
|
Loading…
Reference in New Issue
Block a user