src: add LoadEnvironment() variant taking a string

Allow passing a string as the main module rather than using
the callback variant.

PR-URL: https://github.com/nodejs/node/pull/30467
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
Anna Henningsen
2019-11-19 15:42:09 +01:00
parent c44edec4da
commit 7dead8440c
10 changed files with 94 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ class NativeModuleEnv {
// Returns config.gypi as a JSON string
static v8::Local<v8::String> GetConfigString(v8::Isolate* isolate);
static bool Exists(const char* id);
static bool Add(const char* id, const UnionBytes& source);
// Loads data into NativeModuleLoader::.instance.code_cache_
// Generated by mkcodecache as node_code_cache.cc when