diff --git a/Directory.Packages.props b/Directory.Packages.props
index 63ec6e8..ca65be1 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -4,10 +4,10 @@
-
-
-
-
+
+
+
+
@@ -32,4 +32,4 @@
-
+
\ No newline at end of file
diff --git a/Trell.Engine/ClearScriptWrappers/EngineWrapper.cs b/Trell.Engine/ClearScriptWrappers/EngineWrapper.cs
index 260e4d8..452daf2 100644
--- a/Trell.Engine/ClearScriptWrappers/EngineWrapper.cs
+++ b/Trell.Engine/ClearScriptWrappers/EngineWrapper.cs
@@ -193,7 +193,7 @@ internal IScriptObject CreateJsStringArray(IList? list) {
return arr;
}
- public IArrayBuffer CreateJsBuffer(byte[] contents) {
+ public IArrayBuffer CreateJsBuffer(ReadOnlySpan contents) {
var buf = (IArrayBuffer)((ScriptObject)this.engine.Evaluate("ArrayBuffer")).Invoke(true, [contents.Length]);
if (contents.Length > 0) {
buf.WriteBytes(contents, 0, (ulong)contents.Length, 0);
@@ -201,7 +201,7 @@ public IArrayBuffer CreateJsBuffer(byte[] contents) {
return buf;
}
- public ScriptObject CreateJsFile(string filename, string type, byte[] contents) {
+ public ScriptObject CreateJsFile(string filename, string type, ReadOnlySpan contents) {
return (ScriptObject)((ScriptObject)this.engine.Evaluate("File")).Invoke(
true,
[
@@ -220,19 +220,20 @@ public ScriptObject CreateJsFile(string filename, string type, byte[] contents)
EnableSourceLoading(work.SourceDirectory);
var limits = this.limits.RestrictBy(work.Limits);
- var docInfo = new DocumentInfo {
- Category = ModuleCategory.Standard
- };
object module;
using (var t = Cancel(this.engine, linked, this.currentContext).After(limits.MaxStartupDuration)) {
- var loadWorkerJs = $"import * as hooks from '{work.WorkerJs}'; hooks;";
- module = this.engine.Evaluate(docInfo, loadWorkerJs);
+ var workerFileName = work.WorkerJs.ToString();
+ var loadWorkerJs = $"import('{workerFileName}')";
+ var loadEvaluation = this.engine.Evaluate(workerFileName, false, loadWorkerJs);
+
+ module = loadEvaluation is Task