summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-06-21 12:20:23 -0700
committerisaacs <i@izs.me>2012-06-21 12:29:33 -0700
commit48c3d2004180dda8d0d32386299dd918a0804389 (patch)
tree8b2c1a539305787edcd70de9b133c3168305ec13
parent5b39929d47f962fccafb4116f3c177ddc4fd3269 (diff)
downloadnode-new-48c3d2004180dda8d0d32386299dd918a0804389.tar.gz
Apply --no-deprecation to C++ warnings as well
-rw-r--r--src/ev-emul.h2
-rw-r--r--src/node.cc4
-rw-r--r--src/node_internals.h2
-rw-r--r--src/node_io_watcher.cc6
4 files changed, 10 insertions, 4 deletions
diff --git a/src/ev-emul.h b/src/ev-emul.h
index 4355b4ef6b..404e77901a 100644
--- a/src/ev-emul.h
+++ b/src/ev-emul.h
@@ -88,7 +88,7 @@ extern "C" {
#define __uv_warn_of(old_, new_) \
do { \
- if (__uv_warn_##old_) break; \
+ if (__uv_warn_##old_ || no_deprecation) break; \
__uv_warn_##old_ = 1; \
fputs("WARNING: " #old_ " is deprecated, use " #new_ "\n", stderr); \
} \
diff --git a/src/node.cc b/src/node.cc
index 94cc2a5f48..e0a0c72273 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -120,7 +120,6 @@ static Persistent<String> disposed_symbol;
static bool print_eval = false;
static bool force_repl = false;
-static bool no_deprecation = false;
static bool trace_deprecation = false;
static char *eval_string = NULL;
static int option_end_index = 0;
@@ -129,6 +128,9 @@ static bool debug_wait_connect = false;
static int debug_port=5858;
static int max_stack_size = 0;
+// used by C++ modules as well
+bool no_deprecation = false;
+
static uv_check_t check_tick_watcher;
static uv_prepare_t prepare_tick_watcher;
static uv_idle_t tick_spinner;
diff --git a/src/node_internals.h b/src/node_internals.h
index 80aa4e5366..3f9eec2193 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -28,6 +28,8 @@
namespace node {
+extern bool no_deprecation;
+
#ifdef _WIN32
// emulate snprintf() on windows, _snprintf() doesn't zero-terminate the buffer
// on overflow...
diff --git a/src/node_io_watcher.cc b/src/node_io_watcher.cc
index 8812944d61..f238d60e2d 100644
--- a/src/node_io_watcher.cc
+++ b/src/node_io_watcher.cc
@@ -80,12 +80,14 @@ void IOWatcher::Callback(EV_P_ ev_io *w, int revents) {
// io.start();
//
Handle<Value> IOWatcher::New(const Arguments& args) {
- fprintf(stderr, "WARNING: don't use IOWatcher, it'll be removed in v0.9\n");
-
if (!args.IsConstructCall()) {
return FromConstructorTemplate(constructor_template, args);
}
+ if (!no_deprecation) {
+ fprintf(stderr, "WARNING: don't use IOWatcher, it'll be removed in v0.9\n");
+ }
+
HandleScope scope;
IOWatcher *s = new IOWatcher();
s->Wrap(args.This());