We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
void 0
1 parent 0b0a5c1 commit 4a6e24bCopy full SHA for 4a6e24b
turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs
@@ -420,9 +420,12 @@ impl EvalContext {
420
421
Expr::Unary(UnaryExpr {
422
op: op!("void"),
423
- arg: box Expr::Lit(Lit::Num(num)),
+ // Only treat literals as constant undefined, allowing arbitrary values inside here
424
+ // would mean that they can have sideeffects, and `JsValue::Constant` can't model
425
+ // that.
426
+ arg: box Expr::Lit(_),
427
..
- }) if num.value == 0.0 => JsValue::Constant(ConstantValue::Undefined),
428
+ }) => JsValue::Constant(ConstantValue::Undefined),
429
430
431
op: op!("!"), arg, ..
0 commit comments