Bug fix: Node.js was being treated as a web worker context.
This commit is contained in:
@@ -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 || {};
|
||||
|
||||
@@ -161,7 +161,7 @@ class HTML5Platform extends PlatformTarget
|
||||
var script = File.getContent(dependency.path);
|
||||
if (!dependency.webWorker)
|
||||
{
|
||||
script = 'if(typeof window != "undefined") {\n' + script + "\n}";
|
||||
script = 'if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { $script }';
|
||||
}
|
||||
context.embeddedLibraries.push(script);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user