Browse Source

build: lint benchmark addon

PR-URL: https://github.com/nodejs/node/pull/16160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
v9.x-staging
Ben Noordhuis 7 years ago
committed by Joyee Cheung
parent
commit
411695e1d2
  1. 1
      Makefile
  2. 9
      benchmark/misc/function_call/binding.cc

1
Makefile

@ -965,6 +965,7 @@ LINT_CPP_EXCLUDE += $(wildcard test/addons-napi/??_*/*.cc test/addons-napi/??_*/
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
benchmark/misc/function_call/binding.cc \
src/*.c \
src/*.cc \
src/*.h \

9
benchmark/misc/function_call/binding.cc

@ -1,17 +1,14 @@
#include <v8.h>
#include <node.h>
using namespace v8;
static int c = 0;
void Hello(const FunctionCallbackInfo<Value>& args) {
void Hello(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(c++);
}
extern "C" void init (Local<Object> target) {
HandleScope scope(Isolate::GetCurrent());
void Initialize(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "hello", Hello);
}
NODE_MODULE(NODE_GYP_MODULE_NAME, init)
NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)

Loading…
Cancel
Save