* Parses the end of the buffer and clears the stack, calls onend. * * @param chunk Optional final chunk to parse.
(chunk)
| 1977 | * @param chunk Optional final chunk to parse. |
| 1978 | */ |
| 1979 | end(chunk) { |
| 1980 | var _a, _b; |
| 1981 | if (this.ended) { |
| 1982 | (_b = (_a = this.cbs).onerror) === null || _b === void 0 |
| 1983 | ? void 0 |
| 1984 | : _b.call(_a, new Error(".end() after done!")); |
| 1985 | return; |
| 1986 | } |
| 1987 | if (chunk) this.write(chunk); |
| 1988 | this.ended = true; |
| 1989 | this.tokenizer.end(); |
| 1990 | } |
| 1991 | /** |
| 1992 | * Pauses parsing. The parser won't emit events until `resume` is called. |
| 1993 | */ |
no test coverage detected