report-class-instance.ts 263 B

123456789
  1. // 类实例不是纯数据(方法与原型都过不了 JSON 边界)—— report 与 ask<T> 同样拒绝。
  2. class Finding {
  3. constructor(readonly path: string) {}
  4. describe(): string {
  5. return this.path;
  6. }
  7. }
  8. report(new Finding("src/a.ts")); // error