JSTQL-JS-Transform/output_testing/1036error.todo-hoisting-simple-var-declaration.js

14 lines
No EOL
386 B
JavaScript

function hoisting() {
function addOne(b) {
// a is undefined (only the declaration is hoisted, not the init) but shouldn't throw
return a + b;
}
const result = 2 |> addOne(%);
var a = 1;
return result; // OK: returns NaN. The code is semantically wrong but technically correct
}
export const FIXTURE_ENTRYPOINT = {
fn: hoisting,
params: [],
isComponent: false
};