From 5a1de0261d1c2d859241f75293ea09da3afd4631 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 16 Jan 2024 19:42:23 +0200 Subject: [PATCH] Fix running on Node 20.11 CompileFunctionInContext was removed. See https://github.com/nodejs/node-v8/issues/214. Fixes #436. --- src/module/context_handle.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/context_handle.cc b/src/module/context_handle.cc index 139c1073..200696c9 100644 --- a/src/module/context_handle.cc +++ b/src/module/context_handle.cc @@ -197,7 +197,7 @@ class EvalClosureRunner : public CodeCompilerHolder, public ThreePhaseTask { // Invoke `new Function` to compile script auto source = GetSource(); auto function = RunWithAnnotatedErrors([&]() { - return Unmaybe(ScriptCompiler::CompileFunctionInContext( + return Unmaybe(ScriptCompiler::CompileFunction( context, source.get(), argument_names.size(), argument_names.empty() ? nullptr : &argument_names[0], 0, nullptr