Skip to content

Commit

Permalink
refactor: clean up openTag code
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Aug 22, 2018
1 parent 998359d commit 2bc3042
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1643,9 +1643,10 @@ class SaxesParser {
*/
openTag(selfClosing) {
const { tag, attribList } = this;
const { attributes } = tag;
if (this.xmlnsOpt) {
// emit namespace binding events
const { ns, attributes } = tag;
const { ns } = tag;
for (const { name, value } of attribList) {
const { prefix, local } = this.qname(name);
if (prefix === "xmlns") {
Expand Down Expand Up @@ -1714,7 +1715,6 @@ class SaxesParser {
}
}
else {
const { attributes } = this.tag;
for (const { name, value } of attribList) {
if (attributes[name]) {
this.fail(`duplicate attribute: ${name}.`);
Expand Down

0 comments on commit 2bc3042

Please sign in to comment.