node/benchmark/misc/function_call/binding.cc

19 lines
334 B
C++
Raw Normal View History

2010-09-24 10:55:26 +08:00
#include <v8.h>
#include <node.h>
using namespace v8;
2010-09-24 17:21:17 +08:00
static int c = 0;
2010-09-24 10:55:26 +08:00
static Handle<Value> Hello(const Arguments& args) {
HandleScope scope;
2010-09-24 17:21:17 +08:00
return scope.Close(Integer::New(c++));
2010-09-24 10:55:26 +08:00
}
extern "C" void init (Handle<Object> target) {
HandleScope scope;
NODE_SET_METHOD(target, "hello", Hello);
}
2013-02-12 10:22:43 +08:00
NODE_MODULE(binding, init);