#ifndef SRC_NODE_NATIVE_MODULE_H_ #define SRC_NODE_NATIVE_MODULE_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node_internals.h" namespace node { namespace native_module { // The native (C++) side of the native module compilation. class NativeModule { public: // For legacy process.binding('natives') which is mutable static void GetNatives(Environment* env, v8::Local exports); // Loads the static JavaScript source code and the cache into Environment static void LoadBindings(Environment* env); // Compile code cache for a specific native module static void CompileCodeCache(const v8::FunctionCallbackInfo& args); // Compile a specific native module as a function static void CompileFunction(const v8::FunctionCallbackInfo& args); private: static v8::Local CompileAsModule(Environment* env, v8::Local id, bool produce_code_cache); // TODO(joyeecheung): make this public and reuse it to compile bootstrappers static v8::Local Compile(Environment* env, v8::Local id, v8::Local parameters[], size_t parameters_count, bool produce_code_cache); }; } // namespace native_module } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_NODE_NATIVE_MODULE_H_