upgrade readability

This commit is contained in:
zadam
2022-02-19 19:35:39 +01:00
parent 9cf88d9697
commit 20a4e2eb08
4 changed files with 518 additions and 190 deletions

View File

@@ -278,7 +278,7 @@
var whitespace = [" ", "\t", "\n", "\r"];
// See http://www.w3schools.com/dom/dom_nodetype.asp
// See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
var nodeTypes = {
ELEMENT_NODE: 1,
ATTRIBUTE_NODE: 2,
@@ -705,7 +705,6 @@
}
// Using Array.join() avoids the overhead from lazy string concatenation.
// See http://blog.cdleary.com/2012/01/string-representation-in-spidermonkey/#ropes
var arr = [];
getHTML(this);
return arr.join("");
@@ -875,7 +874,11 @@
JSDOMParser.prototype = {
error: function(m) {
dump("JSDOMParser error: " + m + "\n");
if (typeof dump !== "undefined") {
dump("JSDOMParser error: " + m + "\n");
} else if (typeof console !== "undefined") {
console.log("JSDOMParser error: " + m + "\n");
}
this.errorState += m + "\n";
},
@@ -1187,3 +1190,7 @@
global.JSDOMParser = JSDOMParser;
})(this);
if (typeof module === "object") {
module.exports = this.JSDOMParser;
}