From 4524c20b48abe08e69c25a7382a289592d147496 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 13 Jan 2021 17:26:33 +0100 Subject: update dependencies, apply new linter fixes --- src/polyfills/innerHTML.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/polyfills') diff --git a/src/polyfills/innerHTML.js b/src/polyfills/innerHTML.js index 138277e..4f4140b 100644 --- a/src/polyfills/innerHTML.js +++ b/src/polyfills/innerHTML.js @@ -5,8 +5,8 @@ if (SVGElement.prototype.innerHTML) return } catch (e) { return } - var serializeXML = function (node, output) { - var nodeType = node.nodeType + const serializeXML = function (node, output) { + const nodeType = node.nodeType if (nodeType === 3) { output.push(node.textContent.replace(/&/, '&').replace(/', '>')) } else if (nodeType === 1) { @@ -32,8 +32,8 @@ Object.defineProperty(SVGElement.prototype, 'innerHTML', { get: function () { - var output = [] - var childNode = this.firstChild + const output = [] + let childNode = this.firstChild while (childNode) { serializeXML(childNode, output) childNode = childNode.nextSibling @@ -46,13 +46,13 @@ } try { - var dXML = new DOMParser() + const dXML = new DOMParser() dXML.async = false - var sXML = '' + markupText + '' - var svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement + const sXML = '' + markupText + '' + const svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement - var childNode = svgDocElement.firstChild + let childNode = svgDocElement.firstChild while (childNode) { this.appendChild(this.ownerDocument.importNode(childNode, true)) childNode = childNode.nextSibling @@ -65,7 +65,7 @@ Object.defineProperty(SVGElement.prototype, 'outerHTML', { get: function () { - var output = [] + const output = [] serializeXML(this, output) return output.join('') }, @@ -75,13 +75,13 @@ } try { - var dXML = new DOMParser() + const dXML = new DOMParser() dXML.async = false - var sXML = '' + markupText + '' - var svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement + const sXML = '' + markupText + '' + const svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement - var childNode = svgDocElement.firstChild + let childNode = svgDocElement.firstChild while (childNode) { this.parentNode.insertBefore(this.ownerDocument.importNode(childNode, true), this) // this.appendChild(this.ownerDocument.importNode(childNode, true)); -- cgit v1.2.3