Bug fix: Node.js was being treated as a web worker context.

This commit is contained in:
Joseph Cloutier
2024-06-10 14:07:22 -04:00
parent fc393eabd1
commit 8066037cdd
2 changed files with 3 additions and 6 deletions

View File

@@ -1,10 +1,7 @@
(function ($hx_exports, $global) { "use strict"; var $hx_script = (function (exports, global) { ::SOURCE_FILE::
});
::if false::
If `window` is undefined, it means this script is running as a web worker.
In that case, there's no need for exports, and all we need to do is run the
static initializers.
::end::if(typeof window == "undefined") {
if (typeof self !== "undefined" && self.constructor.name.includes("Worker")) {
// No need for exports in a worker context, just initialize statics.
$hx_script({}, $global);
} else {
$hx_exports.lime = $hx_exports.lime || {};