From 2c7f4f474bfbb19b7ae6597112cca41141bf71a4 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 13 Jan 2019 23:44:09 +0800 Subject: process: allow StartExecution() to take a main script ID The idea is to allow the C++ layer to run arbitrary scripts as the main script. This paves the way for - cctest of the execution of Node.js instances - Earlier handling of per-process CLI options that affect execution modes (those usually do not make sense for the embedders). - Targets like mkcodecache or mksnapshot. Also moves the handling of `_third_party_main.js` into C++. PR-URL: https://github.com/nodejs/node/pull/25474 Reviewed-By: Anna Henningsen Reviewed-By: Minwoo Jung --- src/node_native_module.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/node_native_module.cc') diff --git a/src/node_native_module.cc b/src/node_native_module.cc index 1b1a5e8ec1..00775885d6 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -61,6 +61,10 @@ Local ToJsSet(Local context, return out; } +bool NativeModuleLoader::Exists(const char* id) { + return source_.find(id) != source_.end(); +} + void NativeModuleLoader::GetCacheUsage( const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); -- cgit v1.2.3