blob: b8cedd7018f5ee112fd1901eb958582a3eda0a44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <v8.h>
#include <node.h>
using namespace v8;
static int c = 0;
void Hello(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(c++);
}
extern "C" void init (Handle<Object> target) {
HandleScope scope(Isolate::GetCurrent());
NODE_SET_METHOD(target, "hello", Hello);
}
NODE_MODULE(binding, init);
|