Skip to content

Commit c6ab3d5

Browse files
authored
fix(turbopack): Fix analysis of private properties (#76654)
### What? Still look for effects even if a private property exists. ### Why? It's valid ECMAScript input. ### How? Closes #75938
1 parent 0b699b1 commit c6ab3d5

File tree

7 files changed

+1706
-3
lines changed

7 files changed

+1706
-3
lines changed

Diff for: turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1141,9 +1141,10 @@ impl Analyzer<'_> {
11411141
let prop_value = match prop {
11421142
// TODO avoid clone
11431143
MemberProp::Ident(i) => Box::new(i.sym.clone().into()),
1144-
MemberProp::PrivateName(_) => {
1145-
return;
1146-
}
1144+
MemberProp::PrivateName(_) => Box::new(JsValue::unknown_empty(
1145+
false,
1146+
"private names in member expressions are not supported",
1147+
)),
11471148
MemberProp::Computed(ComputedPropName { expr, .. }) => {
11481149
Box::new(self.eval_context.eval(expr))
11491150
}

0 commit comments

Comments
 (0)