* Parses a chunk of data and calls the corresponding callbacks. * * @param chunk Chunk to parse.
(chunk)
| 1958 | * @param chunk Chunk to parse. |
| 1959 | */ |
| 1960 | write(chunk) { |
| 1961 | var _a, _b; |
| 1962 | if (this.ended) { |
| 1963 | (_b = (_a = this.cbs).onerror) === null || _b === void 0 |
| 1964 | ? void 0 |
| 1965 | : _b.call(_a, new Error(".write() after done!")); |
| 1966 | return; |
| 1967 | } |
| 1968 | this.buffers.push(chunk); |
| 1969 | if (this.tokenizer.running) { |
| 1970 | this.tokenizer.write(chunk); |
| 1971 | this.writeIndex++; |
| 1972 | } |
| 1973 | } |
| 1974 | /** |
| 1975 | * Parses the end of the buffer and clears the stack, calls onend. |
| 1976 | * |
no test coverage detected