functions-summaries-arguments-object.ts 447 B

12345678910
  1. // The `arguments` object: f(secret) binds arguments[0] = secret at runtime, which
  2. // flows into ask#2 even though the named param is never read. Probes whether call
  3. // mechanics model the arguments object at all.
  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 ${String(arguments[0])}`);
  8. }
  9. const out = await f(secret);
  10. return out;