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.
23 lines
333 B
JavaScript
23 lines
333 B
JavaScript
function with_basic(obj) {
|
|
with (obj) {
|
|
return x;
|
|
}
|
|
}
|
|
|
|
function with_and_local(obj) {
|
|
let y = 1;
|
|
with (obj) {
|
|
return x + y;
|
|
}
|
|
}
|
|
|
|
function with_nested_function(obj) {
|
|
with (obj) {
|
|
function inner() {
|
|
let z = 2;
|
|
return z;
|
|
}
|
|
return inner();
|
|
}
|
|
}
|