JSTQL-JS-Transform/output_testing/1257cfg-condexpr.js

17 lines
484 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
import { identity, addOne } from "shared-runtime";
function useCondDepInConditionalExpr(props, cond) {
const x = cond |> identity(%) ? props.a.b |> addOne(%) : props.a.b |> identity(%);
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: useCondDepInConditionalExpr,
params: [{
a: {
b: 2
}
}, true]
};