Skip to content

Commit

Permalink
src: add process.versions.iojs
Browse files Browse the repository at this point in the history
This gives user code a forward-compatible means for determining whether
it's running in io.js or Node.js. Also, to ensure backwards
compatibility, it leaves the existing `process.versions.node` alone.
  • Loading branch information
othiym23 committed Jan 18, 2015
1 parent ea7750b commit 39d0732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,9 @@ void SetupProcessObject(Environment* env,
READONLY_PROPERTY(versions,
"node",
OneByteString(env->isolate(), NODE_VERSION + 1));
READONLY_PROPERTY(versions,
"iojs",
OneByteString(env->isolate(), NODE_VERSION + 1));
READONLY_PROPERTY(versions,
"v8",
OneByteString(env->isolate(), V8::GetVersion()));
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-process-versions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require('../common');
var assert = require('assert');

var expected_keys = ['ares', 'http_parser', 'modules', 'node',
var expected_keys = ['ares', 'http_parser', 'iojs', 'modules', 'node',
'openssl', 'uv', 'v8', 'zlib'];

assert.deepEqual(Object.keys(process.versions).sort(), expected_keys);

0 comments on commit 39d0732

Please sign in to comment.