JSTQL-JS-Transform/output_testing/632reduce-reactive-cond-deps-cfg-switch.js

18 lines
398 B
JavaScript
Raw Normal View History

// props.a.b should be added as a unconditional dependency to the reactive
// scope that produces x, since it is accessed unconditionally in all cfg
// paths
function TestCondDepInSwitch(props, other) {
const x = {};
switch (other |> foo(%)) {
case 1:
x.a = props.a.b;
break;
case 2:
x.b = props.a.b;
break;
default:
x.c = props.a.b;
}
return x;
}