functions-summaries-apply-shift.ts 476 B

12345678910
  1. // f.apply(null, [secret]): runtime binds x = secret, which flows into ask#2.
  2. // The analyzer sees actuals [null, [secret]] — param 0 gets null's empty taint and
  3. // the args-array taint sits at actual index 1, never read by param 0's placeholder.
  4. const judge = agent("judge");
  5. const secret = await agent("s").ask<string>("make secret");
  6. function f(x: string): Node<string> {
  7. return judge.ask<string>(`judge ${x}`);
  8. }
  9. const out = await f.apply(null, [secret]);
  10. return out;