1
0
Эх сурвалжийг харах

moved DocUtil declaration out of getClass

Gildas 7 жил өмнө
parent
commit
8a155dd136

+ 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, {