iteration-fanout-forof-entries.ts 545 B

12345678910
  1. // for...of over .entries() of a tainted array, destructured [i, v]: entries() is an
  2. // unknown call (collapse of the receiver keeps world-read#1), the loop body asks, so
  3. // the for...of promotes; v (and i, over-approximated) carry the glob taint.
  4. // Expected: source -> world-read#1; world-read#1 -> fan-out#1;
  5. // world-read#1 -> ask#1; fan-out#1 -> ask#1; source completion none else.
  6. const seeds = await files.glob("*.md");
  7. for (const [i, v] of seeds.entries()) {
  8. await agent("worker").ask<string>(`${i}: ${v}`);
  9. }
  10. return "done";