2013-01-25 07:40:58 +08:00
|
|
|
#include <node.h>
|
|
|
|
#include <v8.h>
|
|
|
|
|
2015-08-19 02:29:10 +08:00
|
|
|
void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
2015-08-19 03:02:52 +08:00
|
|
|
v8::Isolate* isolate = args.GetIsolate();
|
2015-08-19 02:29:10 +08:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
|
2013-01-25 07:40:58 +08:00
|
|
|
}
|
|
|
|
|
2015-08-19 02:29:10 +08:00
|
|
|
void init(v8::Handle<v8::Object> exports, v8::Handle<v8::Object> module) {
|
2013-01-25 07:40:58 +08:00
|
|
|
NODE_SET_METHOD(module, "exports", Method);
|
|
|
|
}
|
|
|
|
|
|
|
|
NODE_MODULE(binding, init);
|