mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Created these while experimenting with LibJS. Might as well bring them into the tree and increase our coverage.
17 lines
438 B
JavaScript
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");
|