Skip to content

Commit

Permalink
refactor: replace call to closeText with internal error
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Oct 11, 2019
1 parent 2239997 commit 7d15b0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7d15b0c

Please sign in to comment.