summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan <ry@tinyclouds.org>2009-08-03 17:51:35 +0200
committerRyan <ry@tinyclouds.org>2009-08-03 17:51:35 +0200
commit1bf9be6b374261a7fd4ac2cf5143d36268ed178f (patch)
tree6abc17868e92ac0df782f45e91ea8c13b6e91c48 /src
parente10fbab00fd8325a7d05d1f854292143b8361e1f (diff)
downloadnodejs-1bf9be6b374261a7fd4ac2cf5143d36268ed178f.tar.gz
nodejs-1bf9be6b374261a7fd4ac2cf5143d36268ed178f.tar.bz2
nodejs-1bf9be6b374261a7fd4ac2cf5143d36268ed178f.zip
Add node.version
Diffstat (limited to 'src')
-rw-r--r--src/node.cc2
-rw-r--r--src/node.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc
index f82aff3e3..3989d4783 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -230,6 +230,8 @@ Load (int argc, char *argv[])
global_obj->Set(String::NewSymbol("node"), node_obj);
+ node_obj->Set(String::NewSymbol("version"), String::New(NODE_VERSION));
+
Local<Array> arguments = Array::New(argc);
for (int i = 0; i < argc; i++) {
Local<String> arg = String::New(argv[i]);
diff --git a/src/node.h b/src/node.h
index 1724d9bc3..fd18fa3c3 100644
--- a/src/node.h
+++ b/src/node.h
@@ -10,6 +10,8 @@
namespace node {
+#define NODE_VERSION "0.1.2"
+
#define NODE_DEFINE_CONSTANT(target, constant) \
(target)->Set(v8::String::NewSymbol(#constant), \
v8::Integer::New(constant))