mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
fix(es/minifier): Abort sequential inliner on optional chaining (#6637)
**Related issue:** - Closes https://github.com/swc-project/swc/issues/6636.
This commit is contained in:
parent
4986694d4c
commit
e4e4d6cf6b
@ -1546,7 +1546,9 @@ where
|
||||
}
|
||||
|
||||
match b {
|
||||
Expr::Update(..) | Expr::Arrow(..) | Expr::Fn(..) => return Ok(false),
|
||||
Expr::Update(..) | Expr::Arrow(..) | Expr::Fn(..) | Expr::OptChain(..) => {
|
||||
return Ok(false)
|
||||
}
|
||||
|
||||
Expr::Cond(b) => {
|
||||
trace_op!("seq: Try test of cond");
|
||||
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"passes": 2,
|
||||
"toplevel": true,
|
||||
"defaults": true,
|
||||
"sequences": true,
|
||||
"collapse_vars": true
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
export function memo(fn, opts) {
|
||||
let result;
|
||||
return () => {
|
||||
result = fn(...newDeps);
|
||||
opts?.onChange?.(result);
|
||||
return result;
|
||||
};
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
export function memo(fn, opts) {
|
||||
let result;
|
||||
return ()=>(result = fn(...newDeps), opts?.onChange?.(result), result);
|
||||
}
|
Loading…
Reference in New Issue
Block a user