#ifndef SRC_MODULE_WRAP_H_ #define SRC_MODULE_WRAP_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include #include #include #include "node_url.h" #include "base_object-inl.h" namespace node { namespace loader { v8::Maybe Resolve(Environment* env, const std::string& specifier, const url::URL& base, bool read_pkg_json = false); class ModuleWrap : public BaseObject { public: static const std::string EXTENSIONS[]; static void Initialize(v8::Local target, v8::Local unused, v8::Local context); private: ModuleWrap(Environment* env, v8::Local object, v8::Local module, v8::Local url); ~ModuleWrap(); static void New(const v8::FunctionCallbackInfo& args); static void Link(const v8::FunctionCallbackInfo& args); static void Instantiate(const v8::FunctionCallbackInfo& args); static void Evaluate(const v8::FunctionCallbackInfo& args); static void Namespace(const v8::FunctionCallbackInfo& args); static void GetUrl(v8::Local property, const v8::PropertyCallbackInfo& info); static void Resolve(const v8::FunctionCallbackInfo& args); static v8::MaybeLocal ResolveCallback( v8::Local context, v8::Local specifier, v8::Local referrer); v8::Persistent module_; v8::Persistent url_; bool linked_ = false; std::unordered_map> resolve_cache_; }; } // namespace loader } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_MODULE_WRAP_H_