Skip to content

Commit 920d544

Browse files
author
Gabriel Schulhof
committed
benchmark: add templated version of Function
PR-URL: #637 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 03759f7 commit 920d544

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

benchmark/function_args.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ static Napi::Object Init(Napi::Env env, Napi::Object exports) {
139139
cplusplus["fourArgFunction"] = Napi::Function::New(env, FourArgFunction);
140140
exports["cplusplus"] = cplusplus;
141141

142+
Napi::Object templated = Napi::Object::New(env);
143+
templated["noArgFunction"] = Napi::Function::New<NoArgFunction>(env);
144+
templated["oneArgFunction"] = Napi::Function::New<OneArgFunction>(env);
145+
templated["twoArgFunction"] = Napi::Function::New<TwoArgFunction>(env);
146+
templated["threeArgFunction"] = Napi::Function::New<ThreeArgFunction>(env);
147+
templated["fourArgFunction"] = Napi::Function::New<FourArgFunction>(env);
148+
exports["templated"] = templated;
149+
142150
return exports;
143151
}
144152

0 commit comments

Comments
 (0)