summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2013-12-17 00:00:44 +0000
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-01-27 15:52:50 -0800
commit76b98462e589a69d9fd48ccb9fb5f6e96b539715 (patch)
tree7e14eb4c89cdb4a913ca6f9976cf6b62da8b59df /src
parentf4c8020d1068ffba57458b327c62b61b1f29ec63 (diff)
downloadandroid-node-v8-76b98462e589a69d9fd48ccb9fb5f6e96b539715.tar.gz
android-node-v8-76b98462e589a69d9fd48ccb9fb5f6e96b539715.tar.bz2
android-node-v8-76b98462e589a69d9fd48ccb9fb5f6e96b539715.zip
node: register modules from DSO constructors
Built-in modules should be automatically registered, replacing the static module list. Add-on modules should also be automatically registered via DSO constructors. This improves flexibility in adding built-in modules and is also a prerequisite to pure-C addon modules.
Diffstat (limited to 'src')
-rw-r--r--src/cares_wrap.cc2
-rw-r--r--src/fs_event_wrap.cc2
-rw-r--r--src/node.cc120
-rw-r--r--src/node.h96
-rw-r--r--src/node_buffer.cc2
-rw-r--r--src/node_contextify.cc2
-rw-r--r--src/node_crypto.cc5
-rw-r--r--src/node_extensions.cc68
-rw-r--r--src/node_extensions.h57
-rw-r--r--src/node_file.cc5
-rw-r--r--src/node_http_parser.cc5
-rw-r--r--src/node_os.cc2
-rw-r--r--src/node_version.h2
-rw-r--r--src/node_zlib.cc5
-rw-r--r--src/pipe_wrap.cc2
-rw-r--r--src/process_wrap.cc2
-rw-r--r--src/signal_wrap.cc2
-rw-r--r--src/smalloc.cc2
-rw-r--r--src/tcp_wrap.cc2
-rw-r--r--src/timer_wrap.cc2
-rw-r--r--src/tls_wrap.cc2
-rw-r--r--src/tty_wrap.cc2
-rw-r--r--src/udp_wrap.cc2
-rw-r--r--src/uv.cc2
24 files changed, 159 insertions, 234 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
index ade6f1382a..bc59513d1b 100644
--- a/src/cares_wrap.cc
+++ b/src/cares_wrap.cc
@@ -1177,4 +1177,4 @@ static void Initialize(Handle<Object> target,
} // namespace cares_wrap
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_cares_wrap, node::cares_wrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(cares_wrap, node::cares_wrap::Initialize)
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index 79538b747b..3a3559cf8a 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -193,4 +193,4 @@ void FSEventWrap::Close(const FunctionCallbackInfo<Value>& args) {
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_fs_event_wrap, node::FSEventWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(fs_event_wrap, node::FSEventWrap::Initialize)
diff --git a/src/node.cc b/src/node.cc
index 0b3697d71e..c1ecdcd30a 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -130,6 +130,9 @@ static bool use_debug_agent = false;
static bool debug_wait_connect = false;
static int debug_port = 5858;
static bool v8_is_profiling = false;
+static node_module* modpending;
+static node_module* modlist_builtin;
+static node_module* modlist_addon;
// used by C++ modules as well
bool no_deprecation = false;
@@ -1882,6 +1885,29 @@ void Hrtime(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(tuple);
}
+extern "C" void node_module_register(void* m) {
+ struct node_module* mp = reinterpret_cast<struct node_module*>(m);
+
+ if (mp->nm_flags & NM_F_BUILTIN) {
+ mp->nm_link = modlist_builtin;
+ modlist_builtin = mp;
+ } else {
+ assert(modpending == NULL);
+ modpending = mp;
+ }
+}
+
+struct node_module* get_builtin_module(const char* name) {
+ struct node_module* mp;
+
+ for (mp = modlist_builtin; mp != NULL; mp = mp->nm_link) {
+ if (strcmp(mp->nm_modname, name) == 0)
+ break;
+ }
+
+ assert(mp == NULL || (mp->nm_flags & NM_F_BUILTIN) != 0);
+ return (mp);
+}
typedef void (UV_DYNAMIC* extInit)(Handle<Object> exports);
@@ -1894,12 +1920,12 @@ typedef void (UV_DYNAMIC* extInit)(Handle<Object> exports);
void DLOpen(const FunctionCallbackInfo<Value>& args) {
HandleScope handle_scope(args.GetIsolate());
Environment* env = Environment::GetCurrent(args.GetIsolate());
- char symbol[1024], *base, *pos;
+ struct node_module* mp;
uv_lib_t lib;
- int r;
if (args.Length() < 2) {
- return ThrowError("process.dlopen takes exactly 2 arguments.");
+ ThrowError("process.dlopen takes exactly 2 arguments.");
+ return;
}
Local<Object> module = args[0]->ToObject(); // Cast
@@ -1918,68 +1944,43 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
return;
}
- String::Utf8Value path(args[1]);
- base = *path;
-
- /* Find the shared library filename within the full path. */
-#ifdef __POSIX__
- pos = strrchr(base, '/');
- if (pos != NULL) {
- base = pos + 1;
- }
-#else // Windows
- for (;;) {
- pos = strpbrk(base, "\\/:");
- if (pos == NULL) {
- break;
- }
- base = pos + 1;
- }
-#endif // __POSIX__
-
- /* Strip the .node extension. */
- pos = strrchr(base, '.');
- if (pos != NULL) {
- *pos = '\0';
- }
-
- /* Add the `_module` suffix to the extension name. */
- r = snprintf(symbol, sizeof symbol, "%s_module", base);
- if (r <= 0 || static_cast<size_t>(r) >= sizeof symbol) {
- return ThrowError("Out of memory.");
- }
-
- /* Replace dashes with underscores. When loading foo-bar.node,
- * look for foo_bar_module, not foo-bar_module.
+ /*
+ * Objects containing v14 or later modules will have registered themselves
+ * on the pending list. Activate all of them now. At present, only one
+ * module per object is supported.
*/
- for (pos = symbol; *pos != '\0'; ++pos) {
- if (*pos == '-')
- *pos = '_';
- }
+ mp = modpending;
+ modpending = NULL;
- node_module_struct *mod;
- if (uv_dlsym(&lib, symbol, reinterpret_cast<void**>(&mod))) {
- char errmsg[1024];
- snprintf(errmsg, sizeof(errmsg), "Symbol %s not found.", symbol);
- return ThrowError(errmsg);
+ if (mp == NULL) {
+ ThrowError("Module did not self-register.");
+ return;
}
-
- if (mod->version != NODE_MODULE_VERSION) {
+ if (mp->nm_version != NODE_MODULE_VERSION) {
char errmsg[1024];
snprintf(errmsg,
sizeof(errmsg),
"Module version mismatch. Expected %d, got %d.",
- NODE_MODULE_VERSION, mod->version);
- return ThrowError(errmsg);
+ NODE_MODULE_VERSION, mp->nm_version);
+ ThrowError(errmsg);
+ return;
+ }
+ if (mp->nm_flags & NM_F_BUILTIN) {
+ ThrowError("Built-in module self-registered.");
+ return;
}
- // Execute the C++ module
- if (mod->register_context_func != NULL) {
- mod->register_context_func(exports, module, env->context());
- } else if (mod->register_func != NULL) {
- mod->register_func(exports, module);
+ mp->nm_dso_handle = lib.handle;
+ mp->nm_link = modlist_addon;
+ modlist_addon = mp;
+
+ if (mp->nm_context_register_func != NULL) {
+ mp->nm_context_register_func(exports, module, env->context(), mp->nm_priv);
+ } else if (mp->nm_register_func != NULL) {
+ mp->nm_register_func(exports, module, mp->nm_priv);
} else {
- return ThrowError("Module has no declared entry point.");
+ ThrowError("Module has no declared entry point.");
+ return;
}
// Tell coverity that 'handle' should not be freed when we return.
@@ -2082,14 +2083,15 @@ static void Binding(const FunctionCallbackInfo<Value>& args) {
uint32_t l = modules->Length();
modules->Set(l, OneByteString(node_isolate, buf));
- node_module_struct* mod = get_builtin_module(*module_v);
+ node_module* mod = get_builtin_module(*module_v);
if (mod != NULL) {
exports = Object::New();
// Internal bindings don't have a "module" object, only exports.
- assert(mod->register_func == NULL);
- assert(mod->register_context_func != NULL);
+ assert(mod->nm_register_func == NULL);
+ assert(mod->nm_context_register_func != NULL);
Local<Value> unused = Undefined(env->isolate());
- mod->register_context_func(exports, unused, env->context());
+ mod->nm_context_register_func(exports, unused,
+ env->context(), mod->nm_priv);
cache->Set(module, exports);
} else if (!strcmp(*module_v, "constants")) {
exports = Object::New();
diff --git a/src/node.h b/src/node.h
index 8c08ab6c2d..0dc21c33a4 100644
--- a/src/node.h
+++ b/src/node.h
@@ -205,28 +205,32 @@ const char *signo_string(int errorno);
typedef void (*addon_register_func)(
v8::Handle<v8::Object> exports,
- v8::Handle<v8::Value> module);
+ v8::Handle<v8::Value> module,
+ void* priv);
typedef void (*addon_context_register_func)(
v8::Handle<v8::Object> exports,
v8::Handle<v8::Value> module,
- v8::Handle<v8::Context> context);
-
-struct node_module_struct {
- int version;
- void *dso_handle;
- const char *filename;
- node::addon_register_func register_func;
- node::addon_context_register_func register_context_func;
- const char *modname;
+ v8::Handle<v8::Context> context,
+ void* priv);
+
+#define NM_F_BUILTIN 0x01
+
+struct node_module {
+ int nm_version;
+ unsigned int nm_flags;
+ void* nm_dso_handle;
+ const char* nm_filename;
+ node::addon_register_func nm_register_func;
+ node::addon_context_register_func nm_context_register_func;
+ const char* nm_modname;
+ void* nm_priv;
+ struct node_module* nm_link;
};
-node_module_struct* get_builtin_module(const char *name);
+node_module* get_builtin_module(const char *name);
-#define NODE_STANDARD_MODULE_STUFF \
- NODE_MODULE_VERSION, \
- NULL, \
- __FILE__
+extern "C" NODE_EXTERN void node_module_register(void* mod);
#ifdef _WIN32
# define NODE_MODULE_EXPORT __declspec(dllexport)
@@ -234,30 +238,70 @@ node_module_struct* get_builtin_module(const char *name);
# define NODE_MODULE_EXPORT /* empty */
#endif
-#define NODE_MODULE(modname, regfunc) \
+#if defined(_MSC_VER)
+#pragma section(".CRT$XCU", read)
+#define NODE_C_CTOR(fn) \
+ static void __cdecl fn(void); \
+ __declspec(allocate(".CRT$XCU")) static void (__cdecl*fn ## _)(void) = fn; \
+ static void __cdecl fn(void)
+#else
+#define NODE_C_CTOR(fn) \
+ static void fn(void) __attribute__((constructor)); \
+ static void fn(void)
+#endif
+
+#define NODE_MODULE_X(modstr, regfunc, priv, flags) \
extern "C" { \
- NODE_MODULE_EXPORT node::node_module_struct modname ## _module = \
+ static node::node_module _module = \
{ \
- NODE_STANDARD_MODULE_STUFF, \
+ NODE_MODULE_VERSION, \
+ flags, \
+ NULL, \
+ __FILE__, \
(node::addon_register_func) (regfunc), \
NULL, \
- NODE_STRINGIFY(modname) \
+ modstr, \
+ priv, \
+ NULL \
}; \
+ NODE_C_CTOR(_register) { \
+ node_module_register(&_module); \
+ } \
}
-#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \
+#define NODE_MODULE_CONTEXT_AWARE_X(modstr, regfunc, priv, flags) \
extern "C" { \
- NODE_MODULE_EXPORT node::node_module_struct modname ## _module = \
+ static node::node_module _module = \
{ \
- NODE_STANDARD_MODULE_STUFF, \
+ NODE_MODULE_VERSION, \
+ flags, \
NULL, \
- (regfunc), \
- NODE_STRINGIFY(modname) \
+ __FILE__, \
+ NULL, \
+ (node::addon_context_register_func) (regfunc), \
+ modstr, \
+ priv, \
+ NULL \
}; \
+ NODE_C_CTOR(_register) { \
+ node_module_register(&_module); \
+ } \
}
-#define NODE_MODULE_DECL(modname) \
- extern "C" node::node_module_struct modname ## _module;
+#define NODE_MODULE(modname, regfunc) \
+ NODE_MODULE_X(NODE_STRINGIFY(modname), regfunc, NULL, 0)
+
+#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \
+ NODE_MODULE_CONTEXT_AWARE_X(NODE_STRINGIFY(modname), regfunc, NULL, 0)
+
+#define NODE_MODULE_CONTEXT_AWARE_BUILTIN(modname, regfunc) \
+ NODE_MODULE_CONTEXT_AWARE_X(NODE_STRINGIFY(modname), \
+ regfunc, NULL, NM_F_BUILTIN)
+
+/*
+ * For backward compatibility in add-on modules.
+ */
+#define NODE_MODULE_DECL /* nothing */
/* Called after the event loop exits but before the VM is disposed.
* Callbacks are run in reverse order of registration, i.e. newest first.
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index c16129e0ce..5a3803e978 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -665,4 +665,4 @@ void Initialize(Handle<Object> target,
} // namespace Buffer
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_buffer, node::Buffer::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(buffer, node::Buffer::Initialize)
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index b3316f54d2..d17899e117 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -628,4 +628,4 @@ void InitContextify(Handle<Object> target,
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_contextify, node::InitContextify);
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(contextify, node::InitContextify);
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 4d1303e5c5..987e2cfa49 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -4210,7 +4210,8 @@ void SetEngine(const FunctionCallbackInfo<Value>& args) {
// FIXME(bnoordhuis) Handle global init correctly.
void InitCrypto(Handle<Object> target,
Handle<Value> unused,
- Handle<Context> context) {
+ Handle<Context> context,
+ void* priv) {
static uv_once_t init_once = UV_ONCE_INIT;
uv_once(&init_once, InitCryptoOnce);
@@ -4239,4 +4240,4 @@ void InitCrypto(Handle<Object> target,
} // namespace crypto
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_crypto, node::crypto::InitCrypto)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(crypto, node::crypto::InitCrypto)
diff --git a/src/node_extensions.cc b/src/node_extensions.cc
deleted file mode 100644
index a4a2cab266..0000000000
--- a/src/node_extensions.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-#include "node.h"
-#include "node_version.h"
-#include "node_extensions.h"
-#include <string.h>
-#include <stdio.h>
-
-#undef NODE_EXT_LIST_START
-#undef NODE_EXT_LIST_ITEM
-#undef NODE_EXT_LIST_END
-
-#define NODE_EXT_LIST_START
-#define NODE_EXT_LIST_ITEM NODE_MODULE_DECL
-#define NODE_EXT_LIST_END
-
-NODE_EXT_LIST(NODE_EXT_LIST_START, NODE_EXT_LIST_ITEM, NODE_EXT_LIST_END)
-
-#undef NODE_EXT_LIST_START
-#undef NODE_EXT_LIST_ITEM
-#undef NODE_EXT_LIST_END
-
-#define NODE_EXT_STRING(x) &x ## _module,
-#define NODE_EXT_LIST_START node::node_module_struct *node_module_list[] = {
-#define NODE_EXT_LIST_ITEM NODE_EXT_STRING
-#define NODE_EXT_LIST_END NULL};
-
-NODE_EXT_LIST(NODE_EXT_LIST_START, NODE_EXT_LIST_ITEM, NODE_EXT_LIST_END)
-
-namespace node {
-
-node_module_struct* get_builtin_module(const char *name) {
- char buf[128];
- node_module_struct *cur = NULL;
- snprintf(buf, sizeof(buf), "node_%s", name);
- /* TODO: you could look these up in a hash, but there are only
- * a few, and once loaded they are cached. */
- for (int i = 0; node_module_list[i] != NULL; i++) {
- cur = node_module_list[i];
- if (strcmp(cur->modname, buf) == 0) {
- return cur;
- }
- }
-
- return NULL;
-}
-
-} // namespace node
diff --git a/src/node_extensions.h b/src/node_extensions.h
deleted file mode 100644
index 662596fdd4..0000000000
--- a/src/node_extensions.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#ifndef SRC_NODE_EXTENSIONS_H_
-#define SRC_NODE_EXTENSIONS_H_
-
-#if HAVE_OPENSSL
-# define NODE_EXT_LIST_SSL(ITEM) \
- ITEM(node_crypto) \
- ITEM(node_tls_wrap)
-#else
-# define NODE_EXT_LIST_SSL(ITEM)
-#endif // HAVE_OPENSSL
-
-#define NODE_EXT_LIST(START, ITEM, END) \
- START \
- ITEM(node_buffer) \
- NODE_EXT_LIST_SSL(ITEM) \
- ITEM(node_contextify) \
- ITEM(node_fs) \
- ITEM(node_http_parser) \
- ITEM(node_os) \
- ITEM(node_smalloc) \
- ITEM(node_zlib) \
- \
- ITEM(node_uv) \
- ITEM(node_timer_wrap) \
- ITEM(node_tcp_wrap) \
- ITEM(node_udp_wrap) \
- ITEM(node_pipe_wrap) \
- ITEM(node_cares_wrap) \
- ITEM(node_tty_wrap) \
- ITEM(node_process_wrap) \
- ITEM(node_fs_event_wrap) \
- ITEM(node_signal_wrap) \
- \
- END \
-
-#endif // SRC_NODE_EXTENSIONS_H_
diff --git a/src/node_file.cc b/src/node_file.cc
index 8a7f80bf3b..109eea879b 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -1053,7 +1053,8 @@ static void FUTimes(const FunctionCallbackInfo<Value>& args) {
void InitFs(Handle<Object> target,
Handle<Value> unused,
- Handle<Context> context) {
+ Handle<Context> context,
+ void* priv) {
Environment* env = Environment::GetCurrent(context);
// Initialize the stats object
@@ -1097,4 +1098,4 @@ void InitFs(Handle<Object> target,
} // end namespace node
-NODE_MODULE_CONTEXT_AWARE(node_fs, node::InitFs)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(fs, node::InitFs)
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index 738358be63..1d92f65426 100644
--- a/src/node_http_parser.cc
+++ b/src/node_http_parser.cc
@@ -563,7 +563,8 @@ const struct http_parser_settings Parser::settings = {
void InitHttpParser(Handle<Object> target,
Handle<Value> unused,
- Handle<Context> context) {
+ Handle<Context> context,
+ void* priv) {
Local<FunctionTemplate> t = FunctionTemplate::New(Parser::New);
t->InstanceTemplate()->SetInternalFieldCount(1);
t->SetClassName(FIXED_ONE_BYTE_STRING(node_isolate, "HTTPParser"));
@@ -600,4 +601,4 @@ void InitHttpParser(Handle<Object> target,
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_http_parser, node::InitHttpParser)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(http_parser, node::InitHttpParser)
diff --git a/src/node_os.cc b/src/node_os.cc
index 14dc6e088f..9c4796b700 100644
--- a/src/node_os.cc
+++ b/src/node_os.cc
@@ -302,4 +302,4 @@ void Initialize(Handle<Object> target,
} // namespace os
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_os, node::os::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(os, node::os::Initialize)
diff --git a/src/node_version.h b/src/node_version.h
index a826741ec8..09d1aeb422 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -64,6 +64,6 @@
* an API is broken in the C++ side, including in v8 or
* other dependencies.
*/
-#define NODE_MODULE_VERSION 13 /* v0.12 */
+#define NODE_MODULE_VERSION 14 /* v0.12 */
#endif /* SRC_NODE_VERSION_H_ */
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index f3da76c37d..16372bd811 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -550,7 +550,8 @@ class ZCtx : public AsyncWrap {
void InitZlib(Handle<Object> target,
Handle<Value> unused,
- Handle<Context> context) {
+ Handle<Context> context,
+ void* priv) {
Local<FunctionTemplate> z = FunctionTemplate::New(ZCtx::New);
z->InstanceTemplate()->SetInternalFieldCount(1);
@@ -608,4 +609,4 @@ void InitZlib(Handle<Object> target,
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_zlib, node::InitZlib)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(zlib, node::InitZlib)
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 44f8dc903e..517d97ccb8 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -288,4 +288,4 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_pipe_wrap, node::PipeWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(pipe_wrap, node::PipeWrap::Initialize)
diff --git a/src/process_wrap.cc b/src/process_wrap.cc
index 2ced3dee6d..5592cfeaa5 100644
--- a/src/process_wrap.cc
+++ b/src/process_wrap.cc
@@ -293,4 +293,4 @@ class ProcessWrap : public HandleWrap {
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_process_wrap, node::ProcessWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(process_wrap, node::ProcessWrap::Initialize)
diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc
index 821b6dc580..74eb830aac 100644
--- a/src/signal_wrap.cc
+++ b/src/signal_wrap.cc
@@ -114,4 +114,4 @@ class SignalWrap : public HandleWrap {
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_signal_wrap, node::SignalWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(signal_wrap, node::SignalWrap::Initialize)
diff --git a/src/smalloc.cc b/src/smalloc.cc
index c0b7b35c79..7b8e433361 100644
--- a/src/smalloc.cc
+++ b/src/smalloc.cc
@@ -496,4 +496,4 @@ void Initialize(Handle<Object> exports,
} // namespace smalloc
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_smalloc, node::smalloc::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(smalloc, node::smalloc::Initialize)
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index 38c21ece33..99d71bffe5 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -465,4 +465,4 @@ Local<Object> AddressToJS(Environment* env,
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_tcp_wrap, node::TCPWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(tcp_wrap, node::TCPWrap::Initialize)
diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc
index 7a0116ee41..e82f9036d1 100644
--- a/src/timer_wrap.cc
+++ b/src/timer_wrap.cc
@@ -157,4 +157,4 @@ class TimerWrap : public HandleWrap {
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_timer_wrap, node::TimerWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(timer_wrap, node::TimerWrap::Initialize)
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 14ea95c002..6d9425c040 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -802,4 +802,4 @@ void TLSCallbacks::Initialize(Handle<Object> target,
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_tls_wrap, node::TLSCallbacks::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(tls_wrap, node::TLSCallbacks::Initialize)
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index 0f7e390748..b1a354ac33 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -180,4 +180,4 @@ TTYWrap::TTYWrap(Environment* env, Handle<Object> object, int fd, bool readable)
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_tty_wrap, node::TTYWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(tty_wrap, node::TTYWrap::Initialize)
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc
index 93b030faa2..b5ae878dd1 100644
--- a/src/udp_wrap.cc
+++ b/src/udp_wrap.cc
@@ -436,4 +436,4 @@ uv_udp_t* UDPWrap::UVHandle() {
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_udp_wrap, node::UDPWrap::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(udp_wrap, node::UDPWrap::Initialize)
diff --git a/src/uv.cc b/src/uv.cc
index 988fc70299..32d6a86845 100644
--- a/src/uv.cc
+++ b/src/uv.cc
@@ -62,4 +62,4 @@ void Initialize(Handle<Object> target,
} // namespace uv
} // namespace node
-NODE_MODULE_CONTEXT_AWARE(node_uv, node::uv::Initialize)
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(uv, node::uv::Initialize)