node/benchmark/napi/function_call/binding.cc
Gabriel Schulhof 39e4d82c70 benchmark: fix build warnings
The napi/* benchmarks were using an incorrect signature for the V8
add-on init function. This was causing a warning.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: https://github.com/nodejs/node/pull/36157
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2020-11-19 19:01:38 -08:00

17 lines
366 B
C++

#include <v8.h>
#include <node.h>
static int c = 0;
void Hello(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(c++);
}
void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> module,
void* data) {
NODE_SET_METHOD(target, "hello", Hello);
}
NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)