node-addon-api 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +242 -2
- package/README.md +106 -62
- package/common.gypi +1 -1
- package/index.js +5 -2
- package/napi-inl.deprecated.h +8 -8
- package/napi-inl.h +1221 -548
- package/napi.h +823 -524
- package/package-support.json +21 -0
- package/package.json +96 -4
- package/tools/README.md +8 -2
- package/tools/clang-format.js +67 -0
- package/tools/conversion.js +4 -4
- package/.editorconfig +0 -8
- package/.travis.yml +0 -59
- package/CODE_OF_CONDUCT.md +0 -4
- package/CONTRIBUTING.md +0 -66
- package/appveyor.yml +0 -48
- package/benchmark/README.md +0 -47
- package/benchmark/binding.gyp +0 -25
- package/benchmark/function_args.cc +0 -153
- package/benchmark/function_args.js +0 -52
- package/benchmark/index.js +0 -34
- package/benchmark/property_descriptor.cc +0 -60
- package/benchmark/property_descriptor.js +0 -29
- package/doc/Doxyfile +0 -2450
- package/doc/array_buffer.md +0 -129
- package/doc/async_context.md +0 -86
- package/doc/async_operations.md +0 -31
- package/doc/async_worker.md +0 -427
- package/doc/async_worker_variants.md +0 -456
- package/doc/basic_types.md +0 -423
- package/doc/bigint.md +0 -93
- package/doc/boolean.md +0 -64
- package/doc/buffer.md +0 -140
- package/doc/callback_scope.md +0 -54
- package/doc/callbackinfo.md +0 -97
- package/doc/checker-tool.md +0 -32
- package/doc/class_property_descriptor.md +0 -117
- package/doc/cmake-js.md +0 -68
- package/doc/conversion-tool.md +0 -28
- package/doc/creating_a_release.md +0 -62
- package/doc/dataview.md +0 -244
- package/doc/date.md +0 -68
- package/doc/env.md +0 -77
- package/doc/error.md +0 -115
- package/doc/error_handling.md +0 -186
- package/doc/escapable_handle_scope.md +0 -82
- package/doc/external.md +0 -59
- package/doc/function.md +0 -401
- package/doc/function_reference.md +0 -238
- package/doc/generator.md +0 -13
- package/doc/handle_scope.md +0 -65
- package/doc/memory_management.md +0 -27
- package/doc/node-gyp.md +0 -82
- package/doc/number.md +0 -163
- package/doc/object.md +0 -275
- package/doc/object_lifetime_management.md +0 -83
- package/doc/object_reference.md +0 -117
- package/doc/object_wrap.md +0 -833
- package/doc/prebuild_tools.md +0 -16
- package/doc/promises.md +0 -74
- package/doc/property_descriptor.md +0 -286
- package/doc/range_error.md +0 -59
- package/doc/reference.md +0 -111
- package/doc/setup.md +0 -81
- package/doc/string.md +0 -89
- package/doc/symbol.md +0 -44
- package/doc/threadsafe_function.md +0 -320
- package/doc/type_error.md +0 -59
- package/doc/typed_array.md +0 -74
- package/doc/typed_array_of.md +0 -133
- package/doc/value.md +0 -278
- package/doc/version_management.md +0 -43
- package/doc/working_with_javascript_values.md +0 -14
package/napi-inl.deprecated.h
CHANGED
|
@@ -11,7 +11,7 @@ PropertyDescriptor::Accessor(const char* utf8name,
|
|
|
11
11
|
Getter getter,
|
|
12
12
|
napi_property_attributes attributes,
|
|
13
13
|
void* /*data*/) {
|
|
14
|
-
|
|
14
|
+
using CbData = details::CallbackData<Getter, Napi::Value>;
|
|
15
15
|
// TODO: Delete when the function is destroyed
|
|
16
16
|
auto callbackData = new CbData({ getter, nullptr });
|
|
17
17
|
|
|
@@ -40,7 +40,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name,
|
|
|
40
40
|
Getter getter,
|
|
41
41
|
napi_property_attributes attributes,
|
|
42
42
|
void* /*data*/) {
|
|
43
|
-
|
|
43
|
+
using CbData = details::CallbackData<Getter, Napi::Value>;
|
|
44
44
|
// TODO: Delete when the function is destroyed
|
|
45
45
|
auto callbackData = new CbData({ getter, nullptr });
|
|
46
46
|
|
|
@@ -71,7 +71,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(const char* utf8name,
|
|
|
71
71
|
Setter setter,
|
|
72
72
|
napi_property_attributes attributes,
|
|
73
73
|
void* /*data*/) {
|
|
74
|
-
|
|
74
|
+
using CbData = details::AccessorCallbackData<Getter, Setter>;
|
|
75
75
|
// TODO: Delete when the function is destroyed
|
|
76
76
|
auto callbackData = new CbData({ getter, setter, nullptr });
|
|
77
77
|
|
|
@@ -102,7 +102,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name,
|
|
|
102
102
|
Setter setter,
|
|
103
103
|
napi_property_attributes attributes,
|
|
104
104
|
void* /*data*/) {
|
|
105
|
-
|
|
105
|
+
using CbData = details::AccessorCallbackData<Getter, Setter>;
|
|
106
106
|
// TODO: Delete when the function is destroyed
|
|
107
107
|
auto callbackData = new CbData({ getter, setter, nullptr });
|
|
108
108
|
|
|
@@ -133,8 +133,8 @@ inline PropertyDescriptor PropertyDescriptor::Function(const char* utf8name,
|
|
|
133
133
|
Callable cb,
|
|
134
134
|
napi_property_attributes attributes,
|
|
135
135
|
void* /*data*/) {
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
|
|
137
|
+
using CbData = details::CallbackData<Callable, ReturnType>;
|
|
138
138
|
// TODO: Delete when the function is destroyed
|
|
139
139
|
auto callbackData = new CbData({ cb, nullptr });
|
|
140
140
|
|
|
@@ -163,8 +163,8 @@ inline PropertyDescriptor PropertyDescriptor::Function(napi_value name,
|
|
|
163
163
|
Callable cb,
|
|
164
164
|
napi_property_attributes attributes,
|
|
165
165
|
void* /*data*/) {
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
|
|
167
|
+
using CbData = details::CallbackData<Callable, ReturnType>;
|
|
168
168
|
// TODO: Delete when the function is destroyed
|
|
169
169
|
auto callbackData = new CbData({ cb, nullptr });
|
|
170
170
|
|