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 <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • 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.