mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
334 B
19 lines
334 B
14 years ago
|
#include <v8.h>
|
||
|
#include <node.h>
|
||
|
|
||
|
using namespace v8;
|
||
|
|
||
14 years ago
|
static int c = 0;
|
||
|
|
||
14 years ago
|
static Handle<Value> Hello(const Arguments& args) {
|
||
|
HandleScope scope;
|
||
14 years ago
|
return scope.Close(Integer::New(c++));
|
||
14 years ago
|
}
|
||
|
|
||
|
extern "C" void init (Handle<Object> target) {
|
||
|
HandleScope scope;
|
||
|
NODE_SET_METHOD(target, "hello", Hello);
|
||
|
}
|
||
12 years ago
|
|
||
|
NODE_MODULE(binding, init);
|