mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
18 lines
331 B
C++
18 lines
331 B
C++
#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);
|