0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/benchmark/misc/function_call/binding.cc
Michaël Zasso 4abc896a82 src: replace usage of v8::Handle with v8::Local
v8::Handle is deprecated: https://codereview.chromium.org/1224623004

PR-URL: https://github.com/nodejs/io.js/pull/2202
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-09-06 21:38:05 +10:00

18 lines
330 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 (Local<Object> target) {
HandleScope scope(Isolate::GetCurrent());
NODE_SET_METHOD(target, "hello", Hello);
}
NODE_MODULE(binding, init);