mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
3e1b1dd4a9
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
27 lines
610 B
C++
27 lines
610 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
using v8::Function;
|
|
using v8::FunctionCallbackInfo;
|
|
using v8::Handle;
|
|
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(Handle<Object> target) {
|
|
NODE_SET_METHOD(target, "method", Method);
|
|
}
|
|
|
|
NODE_MODULE(binding, init);
|