Add process.features.debug; fixes simple/test-executable-path.js
authorRyan Dahl <ry@tinyclouds.org>
Wed, 24 Aug 2011 21:16:35 +0000 (14:16 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 24 Aug 2011 21:16:35 +0000 (14:16 -0700)
src/node.cc
test/simple/test-executable-path.js

index 5818520..84909c9 100644 (file)
@@ -2084,6 +2084,14 @@ static Handle<Object> GetFeatures() {
   HandleScope scope;
 
   Local<Object> obj = Object::New();
+  obj->Set(String::NewSymbol("debug"),
+#if defined(DEBUG) && DEBUG
+    True()
+#else
+    False()
+#endif
+  );
+
   obj->Set(String::NewSymbol("uv"), Boolean::New(use_uv));
   obj->Set(String::NewSymbol("http1"), Boolean::New(use_http1));
   obj->Set(String::NewSymbol("ipv6"), True()); // TODO ping libuv
index 73948b6..1e7224a 100644 (file)
@@ -23,7 +23,7 @@ var common = require('../common');
 var assert = require('assert');
 var path = require('path');
 
-var isDebug = (process.version.indexOf('debug') >= 0);
+var isDebug = process.features.debug;
 
 var debugPath = path.normalize(path.join(__dirname, '..', '..',
                                          'out', 'Debug', 'node'));