mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Add bytecode tests verifying identifier resolution produces correct register-backed locals, global lookups, argument indices, and environment lookups for eval/with/captured cases. Add runtime tests for destructuring assignment patterns with expression defaults: class expressions (named/anonymous), function expressions, arrow functions, nested destructuring, eval in defaults, MemberExpression targets with setter functions, and class name scoping.
13 lines
281 B
JavaScript
13 lines
281 B
JavaScript
// Test that variables captured by nested functions are NOT promoted to locals.
|
|
// The bytecode should use GetBinding/SetBinding for captured variables.
|
|
|
|
function outer() {
|
|
let captured = 1;
|
|
function inner() {
|
|
return captured;
|
|
}
|
|
return inner();
|
|
}
|
|
|
|
outer();
|