JSTQL-JS-Transform/output_testing/583reduce-reactive-cond-deps-superpath-order2.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 TestConditionalSuperpath2(props, other) {
const x = {};
if (other |> foo(%)) {
x.b = props.a.b;
}
x.a = props.a;
return x;
}