mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 17:26:24 +00:00

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>
27 lines
608 B
C++
27 lines
608 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
using v8::Function;
|
|
using v8::FunctionCallbackInfo;
|
|
using v8::Local;
|
|
using v8::HandleScope;
|
|
using v8::Isolate;
|
|
using v8::Object;
|
|
using v8::Value;
|
|
|
|
void Method(const FunctionCallbackInfo<Value>& args) {
|
|
Isolate* isolate = args.GetIsolate();
|
|
HandleScope scope(isolate);
|
|
node::MakeCallback(isolate,
|
|
isolate->GetCurrentContext()->Global(),
|
|
args[0].As<Function>(),
|
|
0,
|
|
NULL);
|
|
}
|
|
|
|
void init(Local<Object> target) {
|
|
NODE_SET_METHOD(target, "method", Method);
|
|
}
|
|
|
|
NODE_MODULE(binding, init);
|