Created
November 24, 2015 16:49
-
-
Save wraithan/0fe421e6583d92f0b9ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <nan.h> | |
namespace memcheck { | |
using v8::Function; | |
using v8::FunctionTemplate; | |
using v8::Local; | |
using v8::String; | |
using v8::Value; | |
using Nan::Callback; | |
using Nan::GetFunction; | |
using Nan::New; | |
using Nan::Set; | |
NAN_METHOD(GatherData) { | |
Callback *cb = new Callback(info[0].As<Function>()); | |
Local<Value> argv[] = {}; | |
cb->Call(0, argv); | |
} | |
NAN_MODULE_INIT(InitAll) { | |
Set(target, New<String>("gatherData").ToLocalChecked(), | |
GetFunction(New<FunctionTemplate>(GatherData)).ToLocalChecked()); | |
} | |
NODE_MODULE(addon, InitAll) | |
} // namespace memcheck |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment