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