* Parse a single object at current position. * Returns null if at EOF.
()
| 58 | * Returns null if at EOF. |
| 59 | */ |
| 60 | parseObject(): ParseResult | null { |
| 61 | if (++this.depth > ObjectParser.MAX_DEPTH) { |
| 62 | this.depth--; |
| 63 | throw new ObjectParseError("Maximum nesting depth exceeded"); |
| 64 | } |
| 65 | |
| 66 | try { |
| 67 | this.ensureBufferFilled(); |
| 68 | |
| 69 | if (this.buf1 === null || this.buf1.type === "eof") { |
| 70 | return null; |
| 71 | } |
| 72 | |
| 73 | return this.parseValue(); |
| 74 | } finally { |
| 75 | this.depth--; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | private ensureBufferFilled(): void { |
| 80 | if (this.buf1 === null) { |
no test coverage detected