diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs index 404662b23d870..8680671b6c37c 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs @@ -457,28 +457,28 @@ impl EvalContext { left, right, .. - }) => JsValue::equal(self.eval(left), self.eval(right)), + }) => JsValue::equal(Box::new(self.eval(left)), Box::new(self.eval(right))), Expr::Bin(BinExpr { op: op!("!="), left, right, .. - }) => JsValue::not_equal(self.eval(left), self.eval(right)), + }) => JsValue::not_equal(Box::new(self.eval(left)), Box::new(self.eval(right))), Expr::Bin(BinExpr { op: op!("==="), left, right, .. - }) => JsValue::strict_equal(self.eval(left), self.eval(right)), + }) => JsValue::strict_equal(Box::new(self.eval(left)), Box::new(self.eval(right))), Expr::Bin(BinExpr { op: op!("!=="), left, right, .. - }) => JsValue::strict_not_equal(self.eval(left), self.eval(right)), + }) => JsValue::strict_not_equal(Box::new(self.eval(left)), Box::new(self.eval(right))), &Expr::Cond(CondExpr { box ref cons, @@ -1670,7 +1670,7 @@ impl VisitAstPath for Analyzer<'_> { { let mut ast_path = ast_path.with_guard(AstParentNodeRef::ForOfStmt(n, ForOfStmtField::Left)); - self.current_value = Some(JsValue::iterated(array)); + self.current_value = Some(JsValue::iterated(Box::new(array))); self.visit_for_head(&n.left, &mut ast_path); } diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs index 3c694b1c660fc..8589e70c2ed97 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs @@ -863,43 +863,43 @@ impl JsValue { ) } - pub fn iterated(iterable: JsValue) -> Self { - Self::Iterated(1 + iterable.total_nodes(), Box::new(iterable)) + pub fn iterated(iterable: Box) -> Self { + Self::Iterated(1 + iterable.total_nodes(), iterable) } - pub fn equal(a: JsValue, b: JsValue) -> Self { + pub fn equal(a: Box, b: Box) -> Self { Self::Binary( 1 + a.total_nodes() + b.total_nodes(), - Box::new(a), + a, BinaryOperator::Equal, - Box::new(b), + b, ) } - pub fn not_equal(a: JsValue, b: JsValue) -> Self { + pub fn not_equal(a: Box, b: Box) -> Self { Self::Binary( 1 + a.total_nodes() + b.total_nodes(), - Box::new(a), + a, BinaryOperator::NotEqual, - Box::new(b), + b, ) } - pub fn strict_equal(a: JsValue, b: JsValue) -> Self { + pub fn strict_equal(a: Box, b: Box) -> Self { Self::Binary( 1 + a.total_nodes() + b.total_nodes(), - Box::new(a), + a, BinaryOperator::StrictEqual, - Box::new(b), + b, ) } - pub fn strict_not_equal(a: JsValue, b: JsValue) -> Self { + pub fn strict_not_equal(a: Box, b: Box) -> Self { Self::Binary( 1 + a.total_nodes() + b.total_nodes(), - Box::new(a), + a, BinaryOperator::StrictNotEqual, - Box::new(b), + b, ) }