From a5d8a8f7a146519ea59f34d9a2b5a5abfd3e8ac7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 29 Jul 2024 19:55:10 +0200 Subject: [PATCH] src: expose LookupAndCompile with parameters PR-URL: https://github.com/nodejs/node/pull/53886 Reviewed-By: Joyee Cheung Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell --- src/node_builtins.cc | 8 ++++++++ src/node_builtins.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/src/node_builtins.cc b/src/node_builtins.cc index 1702ac0ac5332e..97dde02295c975 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -489,6 +489,14 @@ MaybeLocal BuiltinLoader::CompileAndCall(Local context, return fn->Call(context, undefined, argc, argv); } +MaybeLocal BuiltinLoader::LookupAndCompile( + Local context, + const char* id, + std::vector>* parameters, + Realm* optional_realm) { + return LookupAndCompileInternal(context, id, parameters, optional_realm); +} + bool BuiltinLoader::CompileAllBuiltinsAndCopyCodeCache( Local context, const std::vector& eager_builtins, diff --git a/src/node_builtins.h b/src/node_builtins.h index 75a7f3dd89e096..1cb85b9058d065 100644 --- a/src/node_builtins.h +++ b/src/node_builtins.h @@ -97,6 +97,12 @@ class NODE_EXTERN_PRIVATE BuiltinLoader { const char* id, Realm* optional_realm); + v8::MaybeLocal LookupAndCompile( + v8::Local context, + const char* id, + std::vector>* parameters, + Realm* optional_realm); + v8::MaybeLocal CompileAndCall(v8::Local context, const char* id, int argc,