control-flow-labeled-break-nested.ts 301 B

12345678910
  1. // Labeled break out of nested loops carrying taint into a post-loop read.
  2. const seed = await agent("scan").ask<string[]>("gather");
  3. let found = "";
  4. outer: for (const item of seed) {
  5. for (const ch of item) {
  6. found = ch;
  7. break outer;
  8. }
  9. }
  10. return agent("act").ask<string>(`act on ${found}`);