Files
scriptc/tests/corpus/3121-compound-assignment-values.js
Chris Tate 6aa732c089 Support static generator methods and loop bindings (#512)
Lower static and non-overridden instance generator methods through spawn wrappers. Bind sync and async generator loop values through declarations or assignment patterns, and preserve compound assignment expression values.
2026-09-27 23:33:40 -05:00

27 lines
443 B
JavaScript

let count = 1;
console.log(count += 2, count *= 3, count);
function mutate() {
count = 20;
return 4;
}
console.log(count += mutate(), count);
let label = "a";
console.log(label += "b", label);
function update() {
return count += 5;
}
console.log(update(), count);
let first, second;
async function main() {
for await ([first = count += 1, second = count *= 2] of [[]]) {
console.log(first, second, count);
}
}
void main();