From d7f5748ae50cdd8823eaaa735fc600672cc8f4c1 Mon Sep 17 00:00:00 2001 From: Marly Fleitas 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 15c6de6..7dcc7c7 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; }