[compiler] In change detection, be less precise about path dependencies

[ghstack-poisoned]
This commit is contained in:
Mike Vitousek
2024-07-26 14:39:27 -07:00
parent ec93a6c298
commit ec549cae92
@@ -1437,7 +1437,11 @@ function codegenDependency(
): t.Expression {
let object: t.Expression = convertIdentifier(dependency.identifier);
if (dependency.path !== null) {
for (const path of dependency.path) {
let depPath = dependency.path;
if (cx.env.config.enableChangeDetection != null && depPath.length > 0) {
depPath = depPath.slice(0, -1)
}
for (const path of depPath) {
object = t.memberExpression(object, t.identifier(path));
}
}