diff --git a/lib/saxes.js b/lib/saxes.js index 1a5774d2..552ca064 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -995,8 +995,10 @@ class SaxesParser { switch (c) { case LESS: this.state = S_OPEN_WAKA; + // We could naively call closeText but in this state, it is not normal + // to have text be filled with any data. if (this.text.length !== 0) { - this.closeText(); + throw new Error("no-empty text at start"); } break; case EOC: