mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
4abc896a82
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>
18 lines
330 B
C++
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);
|