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 committed 2020-03-21 10:57:26 +01:00
1 parent c44edec4da
commit 7dead8440c
10 files changed
+94 -2

No files matched your search

+2
View File
@@ -47,6 +47,8 @@ class NativeModuleLoader {
UnionBytes GetConfig(); // Return data for config.gypi
bool Exists(const char* id);
bool Add(const char* id, const UnionBytes& source);
v8::Local<v8::Object> GetSourceObject(v8::Local<v8::Context> context);
v8::Local<v8::String> GetConfigString(v8::Isolate* isolate);
std::vector<std::string> GetModuleIds();