Skip to content

Commit

Permalink
refactor: streamline some of the openTag processing
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Aug 27, 2018
1 parent 7d71059 commit 3d50a1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ class SaxesParser {
*/
openTag(selfClosing) {
const { tag, attribList } = this;
const { attributes } = tag;
const { name: tagName, attributes } = tag;
if (this.xmlnsOpt) {
// emit namespace binding events
const { ns } = tag;
Expand All @@ -1684,7 +1684,7 @@ class SaxesParser {

{
// add namespace info to tag
const { prefix, local } = this.qname(this.tagName);
const { prefix, local } = this.qname(tagName);
tag.prefix = prefix;
tag.local = local;
const uri = tag.uri = this.resolve(prefix) || "";
Expand Down Expand Up @@ -1758,8 +1758,8 @@ class SaxesParser {
const { tags } = this;
if (selfClosing) {
this.emitNodes("onopentag", "onclosetag", tag);
this.tag = tags[tags.length - 1];
if (!this.tag) {
const top = this.tag = tags[tags.length - 1];
if (!top) {
this.closedRoot = true;
}
}
Expand Down

0 comments on commit 3d50a1c

Please sign in to comment.