Skip to content

Commit 21ac07e

Browse files
committed
fixup! node-api: add nested object wrap and napi_ref test
1 parent 161b8e3 commit 21ac07e

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

test/js-native-api/6_object_wrap/myobject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
2-
#define JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
1+
#ifndef TEST_JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
2+
#define TEST_JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
33

44
#include <js_native_api.h>
55

@@ -25,4 +25,4 @@ class MyObject {
2525
napi_ref wrapper_;
2626
};
2727

28-
#endif // JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
28+
#endif // TEST_JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_

test/js-native-api/6_object_wrap/nested_wrap.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#include "../common.h"
33
#include "../entry_point.h"
44

5-
napi_ref NestedWrap::constructor;
5+
napi_ref NestedWrap::constructor{};
66
static int finalization_count = 0;
77

8-
NestedWrap::NestedWrap() : env_(nullptr), wrapper_(nullptr), nested_(nullptr) {}
8+
NestedWrap::NestedWrap() {}
99

1010
NestedWrap::~NestedWrap() {
1111
napi_delete_reference(env_, wrapper_);

test/js-native-api/6_object_wrap/nested_wrap.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef JS_NATIVE_API_6_OBJECT_WRAP_NESTED_WRAP_H_
2-
#define JS_NATIVE_API_6_OBJECT_WRAP_NESTED_WRAP_H_
1+
#ifndef TEST_JS_NATIVE_API_6_OBJECT_WRAP_NESTED_WRAP_H_
2+
#define TEST_JS_NATIVE_API_6_OBJECT_WRAP_NESTED_WRAP_H_
33

44
#include <js_native_api.h>
55

@@ -25,9 +25,9 @@ class NestedWrap {
2525

2626
static napi_ref constructor;
2727

28-
napi_env env_;
29-
napi_ref wrapper_;
30-
napi_ref nested_;
28+
napi_env env_{};
29+
napi_ref wrapper_{};
30+
napi_ref nested_{};
3131
};
3232

33-
#endif // JS_NATIVE_API_6_OBJECT_WRAP_NESTED_WRAP_H_
33+
#endif // TEST_JS_NATIVE_API_6_OBJECT_WRAP_NESTED_WRAP_H_

0 commit comments

Comments
 (0)