Explorar o código

use globalThis instead of window

Gildas %!s(int64=5) %!d(string=hai) anos
pai
achega
633691f948
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  1. 5 5
      lib/single-file/single-file-core.js

+ 5 - 5
lib/single-file/single-file-core.js

@@ -21,14 +21,14 @@
  *   Source.
  *   Source.
  */
  */
 
 
-/* global window */
+/* global window, globalThis */
 
 
-this.singlefile.lib.core = this.singlefile.lib.core || (() => {
+this.singlefile.lib.core = this.singlefile.lib.core || (globalThis => {
 
 
 	const DEBUG = false;
 	const DEBUG = false;
 
 
-	const Set = window.Set;
-	const Map = window.Map;
+	const Set = globalThis.Set;
+	const Map = globalThis.Map;
 
 
 	let util, cssTree;
 	let util, cssTree;
 
 
@@ -2229,4 +2229,4 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 
 
 	return { getClass };
 	return { getClass };
 
 
-})();
+})(typeof globalThis == "object" ? globalThis : window);