Skip to content

Commit

Permalink
Use globalThis.
Browse files Browse the repository at this point in the history
It's designed to solve exactly this problem, and has been universally available since 2020.

The most likely scenario for `globalThis` to fail is if the user is stuck with an old browser, in which case `self` will be available. `window` will be too, but `self` also works in web workers.
  • Loading branch information
player-03 committed Jun 10, 2024
1 parent 832ac35 commit 2874ac9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/html5/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
define.__amd = define.amd;
define.amd = null;
}
})(typeof exports !== "undefined" ? exports : typeof define === "function" && define.amd ? {} : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this,
typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : this);
})(typeof exports !== "undefined" ? exports : typeof define === "function" && define.amd ? {} : typeof globalThis !== "undefined" ? globalThis : self,
typeof globalThis !== "undefined" ? globalThis : self);

::if embeddedLibraries::::foreach embeddedLibraries::
::__current__::::end::::end::
Expand Down

0 comments on commit 2874ac9

Please sign in to comment.