diff --git a/include/ircd/js/task.h b/include/ircd/js/task.h index facd7c7a1..5a8d5878a 100644 --- a/include/ircd/js/task.h +++ b/include/ircd/js/task.h @@ -30,7 +30,7 @@ struct task { uint64_t pid; struct global global; // global / this / root scope object - heap_function main; // main generator wrapper function + heap_script main; // main generator wrapper script struct generator generator; // generator state private: diff --git a/ircd/js.cc b/ircd/js.cc index c631cbac3..950146106 100644 --- a/ircd/js.cc +++ b/ircd/js.cc @@ -175,11 +175,10 @@ try // TODO: options JS::CompileOptions opts(*cx); - JS::AutoObjectVector stack(*cx); // The function must be compiled in this scope and returned as a heap_function // before the compartment destructs. - return heap_function { stack, opts, "main", {}, source }; + return heap_script { opts, source }; }()} ,generator{[this] { @@ -190,7 +189,7 @@ try // The run() closure provides safety for entering the JS engine. value state(run([this] { - return this->main(this->global); + return this->main(); })); // Construct the generator object here on the stack while in a compartment. The