node-addon-api 1.7.2 → 3.0.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/.travis.yml +3 -9
- package/CHANGELOG.md +154 -9
- package/README.md +58 -9
- package/benchmark/README.md +47 -0
- package/benchmark/binding.gyp +25 -0
- package/benchmark/function_args.cc +153 -0
- package/benchmark/function_args.js +52 -0
- package/benchmark/index.js +34 -0
- package/benchmark/property_descriptor.cc +60 -0
- package/benchmark/property_descriptor.js +29 -0
- package/common.gypi +21 -0
- package/doc/array_buffer.md +1 -1
- package/doc/async_context.md +10 -0
- package/doc/async_operations.md +1 -1
- package/doc/async_worker.md +56 -26
- package/doc/async_worker_variants.md +456 -0
- package/doc/basic_types.md +8 -0
- package/doc/bigint.md +2 -1
- package/doc/class_property_descriptor.md +5 -6
- package/doc/cmake-js.md +58 -9
- package/doc/creating_a_release.md +5 -5
- package/doc/date.md +68 -0
- package/doc/env.md +14 -0
- package/doc/function.md +108 -1
- package/doc/object.md +74 -1
- package/doc/object_lifetime_management.md +1 -1
- package/doc/object_wrap.md +291 -4
- package/doc/prebuild_tools.md +1 -1
- package/doc/property_descriptor.md +64 -9
- package/doc/setup.md +0 -1
- package/doc/string.md +1 -1
- package/doc/symbol.md +1 -1
- package/doc/threadsafe_function.md +18 -1
- package/doc/value.md +10 -1
- package/except.gypi +16 -0
- package/index.js +5 -42
- package/napi-inl.h +1048 -147
- package/napi.h +424 -49
- package/node_api.gyp +9 -0
- package/noexcept.gypi +16 -0
- package/{src/nothing.c → nothing.c} +0 -0
- package/package.json +244 -47
- package/tools/README.md +4 -4
- package/tools/conversion.js +0 -4
- package/external-napi/node_api.h +0 -7
- package/src/node_api.cc +0 -3655
- package/src/node_api.gyp +0 -21
- package/src/node_api.h +0 -588
- package/src/node_api_types.h +0 -115
- package/src/node_internals.cc +0 -142
- package/src/node_internals.h +0 -157
- package/src/util-inl.h +0 -38
- package/src/util.h +0 -7
package/node_api.gyp
ADDED
package/noexcept.gypi
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
|
|
3
|
+
'cflags': [ '-fno-exceptions' ],
|
|
4
|
+
'cflags_cc': [ '-fno-exceptions' ],
|
|
5
|
+
'msvs_settings': {
|
|
6
|
+
'VCCLCompilerTool': {
|
|
7
|
+
'ExceptionHandling': 0,
|
|
8
|
+
'EnablePREfast': 'true',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
'xcode_settings': {
|
|
12
|
+
'CLANG_CXX_LIBRARY': 'libc++',
|
|
13
|
+
'MACOSX_DEPLOYMENT_TARGET': '10.7',
|
|
14
|
+
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -3,60 +3,255 @@
|
|
|
3
3
|
"url": "https://github.com/nodejs/node-addon-api/issues"
|
|
4
4
|
},
|
|
5
5
|
"contributors": [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
6
|
+
{
|
|
7
|
+
"name": "Abhishek Kumar Singh",
|
|
8
|
+
"url": "https://github.com/abhi11210646"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "Alba Mendez",
|
|
12
|
+
"url": "https://github.com/jmendeth"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "András Timár, Dr",
|
|
16
|
+
"url": "https://github.com/timarandras"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "Andrew Petersen",
|
|
20
|
+
"url": "https://github.com/kirbysayshi"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Anisha Rohra",
|
|
24
|
+
"url": "https://github.com/anisha-rohra"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "Anna Henningsen",
|
|
28
|
+
"url": "https://github.com/addaleax"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "Arnaud Botella",
|
|
32
|
+
"url": "https://github.com/BotellaA"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "Arunesh Chandra",
|
|
36
|
+
"url": "https://github.com/aruneshchandra"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Azlan Mukhtar",
|
|
40
|
+
"url": "https://github.com/azlan"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Ben Berman",
|
|
44
|
+
"url": "https://github.com/rivertam"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "Benjamin Byholm",
|
|
48
|
+
"url": "https://github.com/kkoopa"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "Bill Gallafent",
|
|
52
|
+
"url": "https://github.com/gallafent"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "Bruce A. MacNaughton",
|
|
56
|
+
"url": "https://github.com/bmacnaughton"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Cory Mickelson",
|
|
60
|
+
"url": "https://github.com/corymickelson"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "David Halls",
|
|
64
|
+
"url": "https://github.com/davedoesdev"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "Dmitry Ashkadov",
|
|
68
|
+
"url": "https://github.com/dmitryash"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "Dongjin Na",
|
|
72
|
+
"url": "https://github.com/nadongguri"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "Eric Bickle",
|
|
76
|
+
"url": "https://github.com/ebickle"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "Gabriel Schulhof",
|
|
80
|
+
"url": "https://github.com/gabrielschulhof"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "Guenter Sandner",
|
|
84
|
+
"url": "https://github.com/gms1"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "Gus Caplan",
|
|
88
|
+
"url": "https://github.com/devsnek"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "Hitesh Kanwathirtha",
|
|
92
|
+
"url": "https://github.com/digitalinfinity"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "ikokostya",
|
|
96
|
+
"url": "https://github.com/ikokostya"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "Jake Barnes",
|
|
100
|
+
"url": "https://github.com/DuBistKomisch"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "Jake Yoon",
|
|
104
|
+
"url": "https://github.com/yjaeseok"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "Jason Ginchereau",
|
|
108
|
+
"url": "https://github.com/jasongin"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "Jim Schlight",
|
|
112
|
+
"url": "https://github.com/jschlight"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "Jinho Bang",
|
|
116
|
+
"url": "https://github.com/romandev"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "joshgarde",
|
|
120
|
+
"url": "https://github.com/joshgarde"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "Kelvin",
|
|
124
|
+
"url": "https://github.com/kelvinhammond"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "Kevin Eady",
|
|
128
|
+
"url": "https://github.com/KevinEady"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "Konstantin Tarkus",
|
|
132
|
+
"url": "https://github.com/koistya"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "Kyle Farnung",
|
|
136
|
+
"url": "https://github.com/kfarnung"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "legendecas",
|
|
140
|
+
"url": "https://github.com/legendecas"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "Luciano Martorella",
|
|
144
|
+
"url": "https://github.com/lmartorella"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "Mathias Küsel",
|
|
148
|
+
"url": "https://github.com/mathiask88"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "Matteo Collina",
|
|
152
|
+
"url": "https://github.com/mcollina"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "Michael Dawson",
|
|
156
|
+
"url": "https://github.com/mhdawson"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "Michael Price",
|
|
160
|
+
"url": "https://github.com/mikepricedev"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "Michele Campus",
|
|
164
|
+
"url": "https://github.com/kYroL01"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "Mikhail Cheshkov",
|
|
168
|
+
"url": "https://github.com/mcheshkov"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "Nicola Del Gobbo",
|
|
172
|
+
"url": "https://github.com/NickNaso"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "Nick Soggin",
|
|
176
|
+
"url": "https://github.com/iSkore"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "Nurbol Alpysbayev",
|
|
180
|
+
"url": "https://github.com/anurbol"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "Philipp Renoth",
|
|
184
|
+
"url": "https://github.com/DaAitch"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "Rolf Timmermans",
|
|
188
|
+
"url": "https://github.com/rolftimmermans"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "Ross Weir",
|
|
192
|
+
"url": "https://github.com/ross-weir"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "Ryuichi Okumura",
|
|
196
|
+
"url": "https://github.com/okuryu"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "Sampson Gao",
|
|
200
|
+
"url": "https://github.com/sampsongao"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "Sam Roberts",
|
|
204
|
+
"url": "https://github.com/sam-github"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "Taylor Woll",
|
|
208
|
+
"url": "https://github.com/boingoing"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "Thomas Gentilhomme",
|
|
212
|
+
"url": "https://github.com/fraxken"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "Tim Rach",
|
|
216
|
+
"url": "https://github.com/timrach"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "Tobias Nießen",
|
|
220
|
+
"url": "https://github.com/tniessen"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "Tux3",
|
|
224
|
+
"url": "https://github.com/tux3"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "Yohei Kishimoto",
|
|
228
|
+
"url": "https://github.com/morokosi"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "Yulong Wang",
|
|
232
|
+
"url": "https://github.com/fs-eire"
|
|
233
|
+
}
|
|
51
234
|
],
|
|
52
235
|
"dependencies": {},
|
|
53
236
|
"description": "Node.js API (N-API)",
|
|
54
237
|
"devDependencies": {
|
|
238
|
+
"benchmark": "^2.1.4",
|
|
55
239
|
"safe-buffer": "^5.1.1"
|
|
56
240
|
},
|
|
57
241
|
"directories": {},
|
|
242
|
+
"gypfile": false,
|
|
58
243
|
"homepage": "https://github.com/nodejs/node-addon-api",
|
|
59
|
-
"keywords": [
|
|
244
|
+
"keywords": [
|
|
245
|
+
"n-api",
|
|
246
|
+
"napi",
|
|
247
|
+
"addon",
|
|
248
|
+
"native",
|
|
249
|
+
"bindings",
|
|
250
|
+
"c",
|
|
251
|
+
"c++",
|
|
252
|
+
"nan",
|
|
253
|
+
"node-addon-api"
|
|
254
|
+
],
|
|
60
255
|
"license": "MIT",
|
|
61
256
|
"main": "index.js",
|
|
62
257
|
"name": "node-addon-api",
|
|
@@ -67,6 +262,8 @@
|
|
|
67
262
|
"url": "git://github.com/nodejs/node-addon-api.git"
|
|
68
263
|
},
|
|
69
264
|
"scripts": {
|
|
265
|
+
"prebenchmark": "node-gyp rebuild -C benchmark",
|
|
266
|
+
"benchmark": "node benchmark",
|
|
70
267
|
"pretest": "node-gyp rebuild -C test",
|
|
71
268
|
"test": "node test",
|
|
72
269
|
"predev": "node-gyp rebuild -C test --debug",
|
|
@@ -75,5 +272,5 @@
|
|
|
75
272
|
"dev:incremental": "node test",
|
|
76
273
|
"doc": "doxygen doc/Doxyfile"
|
|
77
274
|
},
|
|
78
|
-
"version": "
|
|
275
|
+
"version": "3.0.0"
|
|
79
276
|
}
|
package/tools/README.md
CHANGED
|
@@ -49,10 +49,10 @@ Napi::FunctionReference constructor;
|
|
|
49
49
|
void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) {
|
|
50
50
|
Napi::HandleScope scope(env);
|
|
51
51
|
Napi::Function ctor = DefineClass(env, "Canvas", {
|
|
52
|
-
InstanceMethod
|
|
53
|
-
InstanceMethod
|
|
54
|
-
InstanceAccessor
|
|
55
|
-
StaticMethod
|
|
52
|
+
InstanceMethod<&[ClassName]::Func1>("Func1"),
|
|
53
|
+
InstanceMethod<&[ClassName]::Func2>("Func2"),
|
|
54
|
+
InstanceAccessor<&[ClassName]::ValueGetter>("Value"),
|
|
55
|
+
StaticMethod<&[ClassName]::StaticMethod>("MethodName"),
|
|
56
56
|
InstanceValue("Value", Napi::[Type]::New(env, value)),
|
|
57
57
|
});
|
|
58
58
|
|
package/tools/conversion.js
CHANGED
|
@@ -24,8 +24,6 @@ if (disable != "--disable" && dir != "--disable") {
|
|
|
24
24
|
'binding.gyp': [
|
|
25
25
|
[ /([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'<!@(node -p "require(\\\'node-addon-api\\\').include")\',' ],
|
|
26
26
|
[ /([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "<!@(node -p \\"require(\'node-addon-api\').include\\")",' ],
|
|
27
|
-
[ /([ ]*)'dependencies': \[/g, '$1\'dependencies\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').gyp")\','],
|
|
28
|
-
[ /([ ]*)"dependencies": \[/g, '$1"dependencies": [\n$1 "<!(node -p \'require(\\\"node-addon-api\\\").gyp\')",'],
|
|
29
27
|
[ /[ ]*("|')<!\(node -e ("|'|\\"|\\')require\(("|'|\\"|\\')nan("|'|\\"|\\')\)("|'|\\"|\\')\)("|')(,|)[\r\n]/g, '' ],
|
|
30
28
|
[ /([ ]*)("|')target_name("|'): ("|')(.+?)("|'),/g, '$1$2target_name$2: $4$5$6,\n $2cflags!$2: [ $2-fno-exceptions$2 ],\n $2cflags_cc!$2: [ $2-fno-exceptions$2 ],\n $2xcode_settings$2: { $2GCC_ENABLE_CPP_EXCEPTIONS$2: $2YES$2,\n $2CLANG_CXX_LIBRARY$2: $2libc++$2,\n $2MACOSX_DEPLOYMENT_TARGET$2: $210.7$2,\n },\n $2msvs_settings$2: {\n $2VCCLCompilerTool$2: { $2ExceptionHandling$2: 1 },\n },' ],
|
|
31
29
|
]
|
|
@@ -39,8 +37,6 @@ if (disable != "--disable" && dir != "--disable") {
|
|
|
39
37
|
'binding.gyp': [
|
|
40
38
|
[ /([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'<!@(node -p "require(\\\'node-addon-api\\\').include")\',' ],
|
|
41
39
|
[ /([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "<!@(node -p \'require(\\\"node-addon-api\\\").include\')",' ],
|
|
42
|
-
[ /([ ]*)'dependencies': \[/g, '$1\'dependencies\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').gyp")\','],
|
|
43
|
-
[ /([ ]*)"dependencies": \[/g, '$1"dependencies": [\n$1 "<!(node -p \'require(\\\"node-addon-api\\\").gyp\')",'],
|
|
44
40
|
[ /[ ]*("|')<!\(node -e ("|'|\\"|\\')require\(("|'|\\"|\\')nan("|'|\\"|\\')\)("|'|\\"|\\')\)("|')(,|)[\r\n]/g, '' ],
|
|
45
41
|
[ /([ ]*)("|')target_name("|'): ("|')(.+?)("|'),/g, '$1$2target_name$2: $4$5$6,\n $2cflags!$2: [ $2-fno-exceptions$2 ],\n $2cflags_cc!$2: [ $2-fno-exceptions$2 ],\n $2defines$2: [ $2NAPI_DISABLE_CPP_EXCEPTIONS$2 ],\n $2conditions$2: [\n [\'OS==\"win\"\', { $2defines$2: [ $2_HAS_EXCEPTIONS=1$2 ] }]\n ]' ],
|
|
46
42
|
]
|