Files
ladybird/Tests/LibJS/Bytecode/input/computed-member-compound-assign.js
Andreas Kling fdd7809bd1 Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests
Created these while experimenting with LibJS. Might as well bring them
into the tree and increase our coverage.
2026-02-17 20:44:57 +01:00

17 lines
438 B
JavaScript

// Test that compound assignment to computed member expressions
// produces optimal register allocation (reusing the property register
// after saving it), and that register free order is consistent across
// sequential statements.
function compound_computed(obj, key) {
obj[key] += 1;
}
function compound_then_assign(imag, i) {
imag[i] += 0;
imag[i] = i;
}
compound_computed({}, "x");
compound_then_assign({ x: 1 }, "x");