From 2bc3042496abc8d4e2639a39d63ab48dd2d32a09 Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Tue, 21 Aug 2018 20:44:28 -0400 Subject: [PATCH] refactor: clean up openTag code --- lib/saxes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/saxes.js b/lib/saxes.js index 94ed8dcc..0217ed8e 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -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") { @@ -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}.`);