JSTQL-JS-Transform/output_testing/615reduce-reactive-cond-deps-superpath-order1.js

12 lines
365 B
JavaScript
Raw Normal View History

// When an unconditional dependency `props.a` is the subpath of a conditional
// dependency `props.a.b`, we can safely overestimate and only track `props.a`
// as a dependency
// ordering of accesses should not matter
function TestConditionalSuperpath1(props, other) {
const x = {};
x.a = props.a;
if (other |> foo(%)) {
x.b = props.a.b;
}
return x;
}