mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 09:27:00 +02:00
Add 39 test cases exercising AST dump output and scope analysis. Tests cover local/global identifier marking, eval/with poisoning, destructuring, closures, hoisting, classes, generators, and more.
29 lines
374 B
JavaScript
29 lines
374 B
JavaScript
function var_hoisting() {
|
|
x = 1;
|
|
var x;
|
|
return x;
|
|
}
|
|
|
|
function let_in_block() {
|
|
let x = 1;
|
|
{
|
|
let x = 2;
|
|
x;
|
|
}
|
|
return x;
|
|
}
|
|
|
|
function const_binding() {
|
|
const x = 1;
|
|
const y = 2;
|
|
return x + y;
|
|
}
|
|
|
|
function for_let_scoping() {
|
|
let sum = 0;
|
|
for (let i = 0; i < 3; i++) {
|
|
sum = sum + i;
|
|
}
|
|
return sum;
|
|
}
|