Skip to content

Commit

Permalink
Fix errors after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sampson Gao committed Sep 15, 2017
1 parent c0b202c commit cf0f4fa
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/addons-napi/4_object_factory/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ napi_value CreateObject(napi_env env, napi_callback_info info) {

napi_value Init(napi_env env, napi_value exports) {
NAPI_CALL(env,
napi_create_function(env, "exports", CreateObject, NULL, &exports));
napi_create_function(env, "exports", -1, CreateObject, NULL, &exports));
return exports;
}

Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/5_function_factory/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ napi_value CreateFunction(napi_env env, napi_callback_info info) {

napi_value Init(napi_env env, napi_value exports) {
NAPI_CALL(env,
napi_create_function(env, "exports", CreateFunction, NULL, &exports));
napi_create_function(env, "exports", -1, CreateFunction, NULL, &exports));
return exports;
}

Expand Down
3 changes: 1 addition & 2 deletions test/addons-napi/6_object_wrap/myobject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ void MyObject::Init(napi_env env, napi_value exports) {

napi_value cons;
NAPI_CALL_RETURN_VOID(env,
napi_define_class(env, "MyObject", New, nullptr, 3, properties, &cons));
napi_define_class(env, "MyObject", -1, New, nullptr, 3, properties, &cons));
napi_define_class(env, "MyObject", -1, New, nullptr, 3, properties, &cons));

NAPI_CALL_RETURN_VOID(env, napi_create_reference(env, cons, 1, &constructor));

Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/7_factory_wrap/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ napi_value Init(napi_env env, napi_value exports) {
NAPI_CALL(env, MyObject::Init(env));

NAPI_CALL(env,
napi_create_function(env, "exports", CreateObject, NULL, &exports));
napi_create_function(env, "exports", -1, CreateObject, NULL, &exports));
return exports;
}

Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_constructor/test_constructor.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ napi_value Init(napi_env env, napi_value exports) {

napi_value cons;
NAPI_CALL_RETURN_VOID(env, napi_define_class(env, "MyObject", -1, New,
NULL, sizeof(properties)/sizeof(*properties), properties, &cons));
NULL, sizeof(properties)/sizeof(*properties), properties, &cons));

NAPI_CALL(env, napi_create_reference(env, cons, 1, &constructor_));

Expand Down
14 changes: 6 additions & 8 deletions test/addons-napi/test_constructor/test_constructor_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ napi_value New(napi_env env, napi_callback_info info) {
return _this;
}

void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_value Init(napi_env env, napi_value exports) {
napi_value cons;
NAPI_CALL_RETURN_VOID(env, napi_define_class(env, "MyObject_Extra", 8, New,
NULL, 0, NULL, &cons));
NAPI_CALL(env, napi_define_class(
env, "MyObject_Extra", 8, New, NULL, 0, NULL, &cons));

NAPI_CALL_RETURN_VOID(env,
napi_set_named_property(env, module, "exports", cons));

NAPI_CALL_RETURN_VOID(env,
napi_create_reference(env, cons, 1, &constructor_));
NAPI_CALL(env,
napi_create_reference(env, cons, 1, &constructor_));
return cons;
}

NAPI_MODULE(addon, Init)
2 changes: 1 addition & 1 deletion test/addons-napi/test_env_sharing/compare_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ napi_value compare(napi_env env, napi_callback_info info) {
}

napi_value Init(napi_env env, napi_value exports) {
NAPI_CALL(env, napi_create_function(env, "exports", compare, NULL, &exports));
NAPI_CALL(env, napi_create_function(env, "exports", -1, compare, NULL, &exports));
return exports;
}

Expand Down
1 change: 1 addition & 0 deletions test/addons-napi/test_function/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ function func4(input) {
return func3(input);
}
assert.strictEqual(test_function.TestCall(func4, 1), 2);

assert.strictEqual(test_function.TestName.name, 'Name');
assert.strictEqual(test_function.TestNameShort.name, 'Name_');

0 comments on commit cf0f4fa

Please sign in to comment.