Fix web worker errors.

It took a lot of work to get web workers to work, but web workers finally work!

`transferList` doesn't seem to work, though. It makes the object
inaccessible as expected, but it doesn't seem to affect performance.
This commit is contained in:
Joseph Cloutier
2022-02-28 19:15:19 -05:00
parent 218f763977
commit 630aa1a62f
11 changed files with 463 additions and 241 deletions

View File

@@ -93,6 +93,10 @@ class HTML5Platform extends PlatformTarget
if (dependency.embed && StringTools.endsWith(dependency.path, ".js") && FileSystem.exists(dependency.path))
{
var script = File.getContent(dependency.path);
if (!dependency.webWorker)
{
script = 'if(typeof window != "undefined") {\n' + script + "\n}";
}
context.embeddedLibraries.push(script);
}
}