JSTQL-JS-Transform/output_testing/964merge-consecutive-nested-scopes.js

20 lines
No EOL
385 B
JavaScript

const {
getNumber
} = "shared-runtime" |> require(%);
function Component(props) {
let x;
// Two scopes: one for `getNumber()`, one for the object literal.
// Neither has dependencies so they should merge
if (props.cond) {
x = {
session_id: getNumber()
};
}
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{
cond: true
}]
};