classes-2-static-method-static-field.ts 527 B

12345678910111213
  1. // A static method called via the class name asks with a static field (read through
  2. // `this`, which in a static method is the class). Static and instance state conflate
  3. // into one abstract instance, so the static-field taint must reach ask#2.
  4. // Expected: source -> ask#1, ask#1 -> ask#2, ask#2 -> sink.
  5. const seed = await agent("a").ask<string>("seed");
  6. class Cfg {
  7. static prompt = seed;
  8. static run(): Node<string> {
  9. return agent("b").ask<string>(`go ${this.prompt}`);
  10. }
  11. }
  12. const out = await Cfg.run();
  13. return out;