Welcome to mirror list, hosted at ThFree Co, Russian Federation.

binding.cc « repl-domain-abort « addons « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e7415c317fc89f7fd08aef0034a93089daaf8a86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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> exports) {
  NODE_SET_METHOD(exports, "method", Method);
}

NODE_MODULE(binding, init);