| 1444 | } |
| 1445 | |
| 1446 | end(): void { |
| 1447 | if (this.pending !== undefined) { |
| 1448 | this.load(this.pending.join(""), this.pendingStart) |
| 1449 | this.pending = undefined |
| 1450 | } |
| 1451 | this.parse(true) |
| 1452 | if (this.state === PROLOG) throw this.error("Syntax", "no root element", this.received) |
| 1453 | if (this.state === CONTENT) { |
| 1454 | throw this.error("Syntax", `unclosed element <${this.stack[this.stack.length - 1]}>`, this.received) |
| 1455 | } |
| 1456 | } |
| 1457 | |
| 1458 | error(kind: XmlError["kind"], message: string, at: number): XmlError { |
| 1459 | if (at > this.counted) { |