From 920d54477922c42f801efc714ab3ae95cde47a5c Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Sat, 14 Dec 2019 10:33:14 -0800 Subject: [PATCH] benchmark: add templated version of Function PR-URL: https://github.com/nodejs/node-addon-api/pull/637 Reviewed-By: Nicola Del Gobbo Reviewed-By: Chengzhong Wu Reviewed-By: Michael Dawson --- benchmark/function_args.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/benchmark/function_args.cc b/benchmark/function_args.cc index 15c6de6fc..7dcc7c781 100644 --- a/benchmark/function_args.cc +++ b/benchmark/function_args.cc @@ -139,6 +139,14 @@ static Napi::Object Init(Napi::Env env, Napi::Object exports) { cplusplus["fourArgFunction"] = Napi::Function::New(env, FourArgFunction); exports["cplusplus"] = cplusplus; + Napi::Object templated = Napi::Object::New(env); + templated["noArgFunction"] = Napi::Function::New(env); + templated["oneArgFunction"] = Napi::Function::New(env); + templated["twoArgFunction"] = Napi::Function::New(env); + templated["threeArgFunction"] = Napi::Function::New(env); + templated["fourArgFunction"] = Napi::Function::New(env); + exports["templated"] = templated; + return exports; }