Files
ladybird/Tests/LibJS/Bytecode/input/argument-variables.js
Andreas Kling 32389c5e96 Tests/LibJS: Add tests for scope analysis and destructuring
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.
2026-02-10 02:05:20 +01:00

14 lines
244 B
JavaScript

// Test that simple function parameters are promoted to register-backed
// arguments. The bytecode should use argN registers directly.
function identity(x) {
return x;
}
function swap(a, b) {
return b + a;
}
identity(1);
swap(1, 2);