node/test/addons/hello-world-function-export/binding.cc
Ben Noordhuis 8f4022e44b test: lint addon tests
Add files in test/addon to the `make cpplint` rule and fix up existing
style issues.  Tests scraped from doc/api/addon.md are filtered out
because those are predominantly for illustrative purposes.

PR-URL: https://github.com/nodejs/node/pull/2427
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-08-18 21:27:43 +02:00

15 lines
411 B
C++

#include <node.h>
#include <v8.h>
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"));
}
void init(v8::Handle<v8::Object> exports, v8::Handle<v8::Object> module) {
NODE_SET_METHOD(module, "exports", Method);
}
NODE_MODULE(binding, init);