mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
665 B
31 lines
665 B
#include "node.h"
|
|
#include "v8.h"
|
|
|
|
#include <assert.h>
|
|
|
|
using v8::Function;
|
|
using v8::FunctionCallbackInfo;
|
|
using v8::Isolate;
|
|
using v8::Local;
|
|
using v8::Object;
|
|
using v8::Value;
|
|
|
|
namespace {
|
|
|
|
void MakeCallback(const FunctionCallbackInfo<Value>& args) {
|
|
assert(args[0]->IsObject());
|
|
assert(args[1]->IsFunction());
|
|
Isolate* isolate = args.GetIsolate();
|
|
Local<Object> recv = args[0].As<Object>();
|
|
Local<Function> method = args[1].As<Function>();
|
|
|
|
node::MakeCallback(isolate, recv, method, 0, nullptr);
|
|
}
|
|
|
|
void Initialize(Local<Object> target) {
|
|
NODE_SET_METHOD(target, "makeCallback", MakeCallback);
|
|
}
|
|
|
|
} // namespace
|
|
|
|
NODE_MODULE(binding, Initialize)
|
|
|