replace-fn.ts 326 B

123456
  1. // .replace with a replacement FUNCTION that returns tainted text. The keystone rule
  2. // must analyze the replacer body so the taint it captures survives into `merged`.
  3. const a = await agent("alpha").ask<string>("start");
  4. const merged = "tt".replace(/t/g, () => a);
  5. const b = await agent("beta").ask<string>(merged);
  6. return b;