14 lines
386 B
JavaScript
14 lines
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
|
||
|
};
|