(assignStmt: (v: string) => string)
| 240 | } |
| 241 | |
| 242 | readRef(assignStmt: (v: string) => string): string { |
| 243 | const refFlag = this.scope.uniqueName("refFlag"); |
| 244 | return ` |
| 245 | const ${refFlag} = ${this.builder.reader.readInt8()}; |
| 246 | switch (${refFlag}) { |
| 247 | case ${RefFlags.NotNullValueFlag}: |
| 248 | case ${RefFlags.RefValueFlag}: |
| 249 | ${this.readNoRef(assignStmt, `${refFlag} === ${RefFlags.RefValueFlag}`)} |
| 250 | break; |
| 251 | case ${RefFlags.RefFlag}: |
| 252 | ${assignStmt(this.builder.referenceResolver.getReadRef(this.builder.reader.readVarUInt32()))} |
| 253 | break; |
| 254 | case ${RefFlags.NullFlag}: |
| 255 | ${assignStmt("null")} |
| 256 | break; |
| 257 | } |
| 258 | `; |
| 259 | } |
| 260 | |
| 261 | protected maybeReference(accessor: string, refState: string) { |
| 262 | if (refState === "false") { |
nothing calls this directly
no test coverage detected