Преглед изворни кода

moved DocUtil declaration out of getClass

Gildas пре 7 година
родитељ
комит
8a155dd136
2 измењених фајлова са 4 додато и 8 уклоњено
  1. 2 4
      lib/single-file/single-file-browser.js
  2. 2 4
      node-jsdom/single-file-jsdom.js

+ 2 - 4
lib/single-file/single-file-browser.js

@@ -61,12 +61,10 @@ this.SingleFileBrowser = this.SingleFileBrowser || (() => {
 		digestText,
 		parseURL
 	};
+	const DocUtil = DocUtilCore.getClass(modules, domUtil);
 	let fetchResource;
 	return {
-		getClass: () => {
-			const DocUtil = DocUtilCore.getClass(modules, domUtil);
-			return SingleFileCore.getClass(DocUtil, cssTree);
-		}
+		getClass: () => SingleFileCore.getClass(DocUtil, cssTree)
 	};
 
 	async function getResourceContent(resourceURL) {

+ 2 - 4
node-jsdom/single-file-jsdom.js

@@ -76,11 +76,9 @@ const domUtil = {
 	digestText,
 	parseURL
 };
+const DocUtil = this.DocUtilCore.getClass(modules, domUtil);
 
-exports.getClass = () => {
-	const DocUtil = this.DocUtilCore.getClass(modules, domUtil);
-	return this.SingleFileCore.getClass(DocUtil, this.cssTree);
-};
+exports.getClass = () => this.SingleFileCore.getClass(DocUtil, this.cssTree);
 
 function parseDocContent(content) {
 	return (new JSDOM(content, {