From: Ryan Dahl Date: Tue, 17 Aug 2010 18:24:10 +0000 (-0700) Subject: Add process.versions X-Git-Tag: v0.2.0~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39b432e42a2304f6abc8dca95a0845563f4c8ca0;p=platform%2Fupstream%2Fnodejs.git Add process.versions --- diff --git a/src/node.cc b/src/node.cc index 72dc481bc..4dd19364d 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1544,9 +1544,22 @@ static void Load(int argc, char *argv[]) { // process.version process->Set(String::NewSymbol("version"), String::New(NODE_VERSION)); + // process.installPrefix process->Set(String::NewSymbol("installPrefix"), String::New(NODE_PREFIX)); + Local versions = Object::New(); + char buf[20]; + process->Set(String::NewSymbol("versions"), versions); + // +1 to get rid of the leading 'v' + versions->Set(String::NewSymbol("node"), String::New(NODE_VERSION+1)); + versions->Set(String::NewSymbol("v8"), String::New(V8::GetVersion())); + versions->Set(String::NewSymbol("ares"), String::New(ARES_VERSION_STR)); + snprintf(buf, 20, "%d.%d", ev_version_major(), ev_version_minor()); + versions->Set(String::NewSymbol("ev"), String::New(buf)); + + + // process.platform #define xstr(s) str(s) #define str(s) #s