JSTQL-JS-Transform/output_testing/1020for-loop-let-undefined-decl.js

19 lines
458 B
JavaScript
Raw Normal View History

// These variables are unknown to useFoo, as they are
// defined at module scope or implicit globals
const isSelected = false;
const isCurrent = true;
function useFoo() {
for (let i = 0; i <= 5; i++) {
let color;
if (isSelected) {
color = isCurrent ? "#FFCC22" : "#FF5050";
} else {
color = isCurrent ? "#CCFF03" : "#CCCCCC";
}
color |> console.log(%);
}
}
export const FIXTURE_ENTRYPOINT = {
params: [],
fn: useFoo
};