mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 01:47:03 +00:00

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>
15 lines
411 B
C++
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);
|