Skip to content

Commit

Permalink
benchmark: add templated version of Function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gabriel Schulhof committed Jan 6, 2020
1 parent 03759f7 commit 920d544
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions benchmark/function_args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<NoArgFunction>(env);
templated["oneArgFunction"] = Napi::Function::New<OneArgFunction>(env);
templated["twoArgFunction"] = Napi::Function::New<TwoArgFunction>(env);
templated["threeArgFunction"] = Napi::Function::New<ThreeArgFunction>(env);
templated["fourArgFunction"] = Napi::Function::New<FourArgFunction>(env);
exports["templated"] = templated;

return exports;
}

Expand Down

0 comments on commit 920d544

Please sign in to comment.