Skip to content

Commit

Permalink
squash: group functions by class and fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Jul 6, 2020
1 parent 3cc92be commit 4283b2c
Show file tree
Hide file tree
Showing 4 changed files with 453 additions and 453 deletions.
86 changes: 43 additions & 43 deletions benchmark/function_args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,49 +82,49 @@ class FunctionArgs : public Napi::Addon<FunctionArgs> {
public:
FunctionArgs(Napi::Env env, Napi::Object exports) {
// Define the core bindings using plain N-API.
napi_value no_arg_function, one_arg_function, two_arg_function,
three_arg_function, four_arg_function;
napi_status status;

status = napi_create_function(env,
"noArgFunction",
NAPI_AUTO_LENGTH,
NoArgFunction_Core,
nullptr,
&no_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"oneArgFunction",
NAPI_AUTO_LENGTH,
OneArgFunction_Core,
nullptr,
&one_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"twoArgFunction",
NAPI_AUTO_LENGTH,
TwoArgFunction_Core,
nullptr,
&two_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"threeArgFunction",
NAPI_AUTO_LENGTH,
ThreeArgFunction_Core,
nullptr,
&three_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"fourArgFunction",
NAPI_AUTO_LENGTH,
FourArgFunction_Core,
nullptr,
&four_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);
napi_value no_arg_function, one_arg_function, two_arg_function,
three_arg_function, four_arg_function;
napi_status status;

status = napi_create_function(env,
"noArgFunction",
NAPI_AUTO_LENGTH,
NoArgFunction_Core,
nullptr,
&no_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"oneArgFunction",
NAPI_AUTO_LENGTH,
OneArgFunction_Core,
nullptr,
&one_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"twoArgFunction",
NAPI_AUTO_LENGTH,
TwoArgFunction_Core,
nullptr,
&two_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"threeArgFunction",
NAPI_AUTO_LENGTH,
ThreeArgFunction_Core,
nullptr,
&three_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

status = napi_create_function(env,
"fourArgFunction",
NAPI_AUTO_LENGTH,
FourArgFunction_Core,
nullptr,
&four_arg_function);
NAPI_THROW_IF_FAILED_VOID(env, status);

DefineAddon(exports, {
InstanceValue("core", DefineProperties(Napi::Object::New(env), {
Expand Down
46 changes: 23 additions & 23 deletions benchmark/property_descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,32 @@ static void Setter(const Napi::CallbackInfo& info) {
class PropDescBenchmark : public Napi::Addon<PropDescBenchmark> {
public:
PropDescBenchmark(Napi::Env env, Napi::Object exports) {
napi_status status;
napi_property_descriptor core_prop = {
"core",
nullptr,
nullptr,
Getter_Core,
Setter_Core,
nullptr,
napi_enumerable,
nullptr
};
napi_status status;
napi_property_descriptor core_prop = {
"core",
nullptr,
nullptr,
Getter_Core,
Setter_Core,
nullptr,
napi_enumerable,
nullptr
};

status = napi_define_properties(env, exports, 1, &core_prop);
NAPI_THROW_IF_FAILED_VOID(env, status);
status = napi_define_properties(env, exports, 1, &core_prop);
NAPI_THROW_IF_FAILED_VOID(env, status);

exports.DefineProperty(
Napi::PropertyDescriptor::Accessor(env,
exports,
"cplusplus",
Getter,
Setter,
napi_enumerable));
exports.DefineProperty(
Napi::PropertyDescriptor::Accessor(env,
exports,
"cplusplus",
Getter,
Setter,
napi_enumerable));

exports.DefineProperty(
Napi::PropertyDescriptor::Accessor<Getter, Setter>("templated",
napi_enumerable));
exports.DefineProperty(
Napi::PropertyDescriptor::Accessor<Getter, Setter>("templated",
napi_enumerable));

DefineAddon(exports, {
InstanceAccessor("instance",
Expand Down
Loading

0 comments on commit 4283b2c

Please sign in to comment.