2011-12-21 14:03:32 +08:00
|
|
|
#include <node.h>
|
|
|
|
#include <v8.h>
|
|
|
|
|
2015-08-19 02:29:10 +08:00
|
|
|
void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
|
|
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
|
2011-12-21 14:03:32 +08:00
|
|
|
}
|
|
|
|
|
2015-08-19 02:29:10 +08:00
|
|
|
void init(v8::Handle<v8::Object> target) {
|
2011-12-21 14:03:32 +08:00
|
|
|
NODE_SET_METHOD(target, "hello", Method);
|
|
|
|
}
|
2012-02-26 03:18:45 +08:00
|
|
|
|
|
|
|
NODE_MODULE(binding, init);
|