Sfoglia il codice sorgente

replace string concatenation Array.prototype.join with + operator

Gildas lormeau 14 anni fa
parent
commit
f4d1e44ca0

+ 1 - 0
WebContent/core/scripts/bg/nio.js

@@ -36,6 +36,7 @@
 
 		function throwAwayHighOrderBytes(str) {
 			var i, ret = [];
+			ret.length = str.length;
 			for (i = 0; i < str.length; i++)
 				ret[i] = String.fromCharCode(str.charCodeAt(i) & 0xff);
 			return ret.join("");

+ 4 - 4
WebContent/core/scripts/common/docprocessor.js

@@ -89,9 +89,9 @@
 
 	function getDataURI(data, defaultURL, woURL) {
 		if (data.content)
-			return [ woURL ? "" : "url(", "data:", data.mediaType, ";", data.mediaTypeParam, ",", data.content, woURL ? "" : ")" ].join("");
+			return (woURL ? "" : "url(") +  "data:" + data.mediaType + ";" + data.mediaTypeParam + "," + data.content + (woURL ? "" : ")");
 		else
-			return woURL ? defaultURL : [ "url(", defaultURL, ")" ].join("");
+			return woURL ? defaultURL : "url(" + defaultURL + ")";
 	}
 
 	function removeComments(content) {
@@ -100,7 +100,7 @@
 			start = content.indexOf("/*");
 			end = content.indexOf("*/", start);
 			if (start != -1 && end != -1)
-				content = [ content.substring(0, start), content.substr(end + 2) ].join("");
+				content = content.substring(0, start) + content.substr(end + 2);
 		} while (start != -1 && end != -1);
 		return content;
 	}
@@ -271,7 +271,7 @@
 					if (data.status < 400) {
 						data.content = data.content.replace(/"([^"]*)<\/\s*script\s*>([^"]*)"/gi, '"$1<"+"/script>$2"');
 						data.content = data.content.replace(/'([^']*)<\/\s*script\s*>([^']*)'/gi, "'$1<'+'/script>$2'");
-						node.textContent = [ "\n", data.content, "\n" ].join("");
+						node.textContent = "\n" + data.content + "\n";
 					}
 					node.removeAttribute("src");
 				}, characterSet);

+ 1 - 1
WebContent/core/scripts/common/util.js

@@ -41,7 +41,7 @@
 
 	singlefile.util.getDocContent = function(doc, docElement) {
 		docElement = docElement || doc.documentElement;
-		return [ getDoctype(doc), docElement.outerHTML ].join("");
+		return getDoctype(doc) + docElement.outerHTML;
 	};
 
 })();