Skip to content

Commit 52a40e0

Browse files
committed
Add process.features.debug; fixes simple/test-executable-path.js
1 parent 2876141 commit 52a40e0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/node.cc

+8
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,14 @@ static Handle<Object> GetFeatures() {
20842084
HandleScope scope;
20852085

20862086
Local<Object> obj = Object::New();
2087+
obj->Set(String::NewSymbol("debug"),
2088+
#if defined(DEBUG) && DEBUG
2089+
True()
2090+
#else
2091+
False()
2092+
#endif
2093+
);
2094+
20872095
obj->Set(String::NewSymbol("uv"), Boolean::New(use_uv));
20882096
obj->Set(String::NewSymbol("http1"), Boolean::New(use_http1));
20892097
obj->Set(String::NewSymbol("ipv6"), True()); // TODO ping libuv

test/simple/test-executable-path.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var common = require('../common');
2323
var assert = require('assert');
2424
var path = require('path');
2525

26-
var isDebug = (process.version.indexOf('debug') >= 0);
26+
var isDebug = process.features.debug;
2727

2828
var debugPath = path.normalize(path.join(__dirname, '..', '..',
2929
'out', 'Debug', 'node'));

0 commit comments

Comments
 (0)