From 52a40e0fd5f59b295fe9bb74e7f14b35ca4bf96c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 24 Aug 2011 14:16:35 -0700 Subject: [PATCH] Add process.features.debug; fixes simple/test-executable-path.js --- src/node.cc | 8 ++++++++ test/simple/test-executable-path.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index 5818520..84909c9 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2084,6 +2084,14 @@ static Handle GetFeatures() { HandleScope scope; Local 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 diff --git a/test/simple/test-executable-path.js b/test/simple/test-executable-path.js index 73948b6..1e7224a 100644 --- a/test/simple/test-executable-path.js +++ b/test/simple/test-executable-path.js @@ -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')); -- 2.7.4