control-flow-comma-incrementor.ts 284 B

12345678
  1. // Comma expression as the for-incrementor: the second operand's compound
  2. // assignment accumulates taint each iteration.
  3. const seed = await agent("scan").ask("seed");
  4. let acc = "";
  5. for (let i = 0; i < 3; i++, acc += seed) {
  6. log(String(i));
  7. }
  8. return agent("act").ask(`acc ${acc}`);