(accessor: (expr: string) => string, refState: string)
| 48 | } |
| 49 | |
| 50 | read(accessor: (expr: string) => string, refState: string): string { |
| 51 | const result = this.scope.uniqueName("result"); |
| 52 | return ` |
| 53 | ${this.typeInfo.options!.withConstructor |
| 54 | ? ` |
| 55 | const ${result} = new ${this.builder.getOptions("creator")}(); |
| 56 | ` |
| 57 | : ` |
| 58 | const ${result} = {}; |
| 59 | ` |
| 60 | } |
| 61 | ${this.maybeReference(result, refState)} |
| 62 | ${this.builder.getOptions("customSerializer")}.read(${this.builder.getReadContextName()}, ${result}) |
| 63 | ${ |
| 64 | accessor(result) |
| 65 | } |
| 66 | `; |
| 67 | } |
| 68 | |
| 69 | readNoRef(assignStmt: (v: string) => string, refState: string): string { |
| 70 | const result = this.scope.uniqueName("result"); |
no test coverage detected