0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/benchmark/misc/function_call/binding.cc
2013-08-01 15:02:38 -07:00

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);