diff options
author | Gus Caplan <me@gus.host> | 2018-01-14 10:35:51 +0300 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2018-01-31 04:00:57 +0300 |
commit | 0993fbe5b213d0fe746c3162bcda85f6c66bb552 (patch) | |
tree | f0a1ffef2ab24f1da963a23a43f3dd58eed5bba0 /src/module_wrap.h | |
parent | 2033a9f4362ee46b0fbddf9caf9cf6238391561e (diff) |
vm: add modules
Adds vm.Module, which wraps around ModuleWrap to provide an interface
for developers to work with modules in a more reflective manner.
Co-authored-by: Timothy Gu <timothygu99@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/17560
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/module_wrap.h')
-rw-r--r-- | src/module_wrap.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/module_wrap.h b/src/module_wrap.h index ec4d6bf5772..bedf665165c 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h @@ -36,8 +36,11 @@ class ModuleWrap : public BaseObject { static void Instantiate(const v8::FunctionCallbackInfo<v8::Value>& args); static void Evaluate(const v8::FunctionCallbackInfo<v8::Value>& args); static void Namespace(const v8::FunctionCallbackInfo<v8::Value>& args); - static void GetUrl(v8::Local<v8::String> property, - const v8::PropertyCallbackInfo<v8::Value>& info); + static void GetStatus(const v8::FunctionCallbackInfo<v8::Value>& args); + static void GetError(const v8::FunctionCallbackInfo<v8::Value>& args); + static void GetStaticDependencySpecifiers( + const v8::FunctionCallbackInfo<v8::Value>& args); + static void Resolve(const v8::FunctionCallbackInfo<v8::Value>& args); static void SetImportModuleDynamicallyCallback( const v8::FunctionCallbackInfo<v8::Value>& args); @@ -50,6 +53,7 @@ class ModuleWrap : public BaseObject { v8::Persistent<v8::String> url_; bool linked_ = false; std::unordered_map<std::string, v8::Persistent<v8::Promise>> resolve_cache_; + v8::Persistent<v8::Context> context_; }; } // namespace loader |