JSTQL-JS-Transform/output_testing/510reduce-reactive-cond-deps-cfg-switch-missing-default.js

15 lines
365 B
JavaScript
Raw Normal View History

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