Files
ladybird/Tests/LibJS/Bytecode/input/destructuring-assignment-in-logical-and.js
Andreas Kling 86191ce229 Tests/LibJS: Add bytecode test for destructuring assignment in &&
This adds a test case for array destructuring assignment inside a
logical AND expression, e.g. `t && ([a, b] = t(e))`. The C++ pipeline
allocates a separate register for the RHS and copies it to the result
register after destructuring, while the Rust pipeline evaluates the
RHS directly into the preferred destination, omitting the copy.
2026-03-01 21:20:54 +01:00

6 lines
73 B
JavaScript

function f(t, e) {
let a, b;
t && ([a, b] = t(e));
}
f(null, 0);