Commit e6b3bfe
n-api: refactor a previous commit
This is a refactoring of #27628
following #28505.
This change factors out functions `add_last_status()` and
`add_returned_status()` so they may be reused in the tests for passing
information about the last error status and/or a returned `napi_status`
to JavaScript.
PR-URL: #28848
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>1 parent ffc7a00 commit e6b3bfeCopy full SHA for e6b3bfe
File tree
Expand file treeCollapse file tree
7 files changed
+154
-201
lines changedOpen diff view settings
Filter options
- test/js-native-api
- test_constructor
- test_object
Expand file treeCollapse file tree
7 files changed
+154
-201
lines changedOpen diff view settings
Collapse file
test/js-native-api/common.c
Copy file name to clipboard+51Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 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 | + |
| 51 | + |
Collapse file
test/js-native-api/common.h
Copy file name to clipboardExpand all lines: test/js-native-api/common.h+11Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
1 | 3 | |
2 | 4 | |
3 | 5 | |
| ||
58 | 60 | |
59 | 61 | |
60 | 62 | |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
Collapse file
test/js-native-api/test_constructor/binding.gyp
Copy file name to clipboardExpand all lines: test/js-native-api/test_constructor/binding.gyp+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
7 | 8 | |
8 | 9 | |
|
Collapse file
test/js-native-api/test_constructor/test_constructor.c
Copy file name to clipboardExpand all lines: test/js-native-api/test_constructor/test_constructor.c+12-42Lines changed: 12 additions & 42 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
5 | | - |
6 | 4 | |
7 | 5 | |
8 | 6 | |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | 7 | |
29 | 8 | |
30 | 9 | |
31 | | - |
32 | | - |
| 10 | + |
33 | 11 | |
34 | 12 | |
35 | 13 | |
| ||
52 | 30 | |
53 | 31 | |
54 | 32 | |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
69 | 39 | |
70 | 40 | |
71 | 41 | |
| ||
76 | 46 | |
77 | 47 | |
78 | 48 | |
79 | | - |
| 49 | + |
80 | 50 | |
81 | 51 | |
82 | 52 | |
| ||
87 | 57 | |
88 | 58 | |
89 | 59 | |
90 | | - |
| 60 | + |
91 | 61 | |
92 | 62 | |
93 | 63 | |
| ||
98 | 68 | |
99 | 69 | |
100 | 70 | |
101 | | - |
| 71 | + |
102 | 72 | |
103 | 73 | |
104 | 74 | |
| ||
109 | 79 | |
110 | 80 | |
111 | 81 | |
112 | | - |
| 82 | + |
113 | 83 | |
114 | 84 | |
115 | 85 | |
| ||
121 | 91 | |
122 | 92 | |
123 | 93 | |
124 | | - |
| 94 | + |
125 | 95 | |
126 | 96 | |
127 | 97 | |
|
Collapse file
test/js-native-api/test_object/binding.gyp
Copy file name to clipboardExpand all lines: test/js-native-api/test_object/binding.gyp+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
7 | 8 | |
8 | 9 | |
|
Collapse file
test/js-native-api/test_object/test.js
Copy file name to clipboardExpand all lines: test/js-native-api/test_object/test.js+12-12Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
229 | 229 | |
230 | 230 | |
231 | 231 | |
232 | | - |
233 | | - |
234 | | - |
235 | | - |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
236 | 236 | |
237 | 237 | |
238 | 238 | |
239 | 239 | |
240 | 240 | |
241 | | - |
242 | | - |
243 | | - |
244 | | - |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
245 | 245 | |
246 | 246 | |
247 | 247 | |
248 | 248 | |
249 | 249 | |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
254 | 254 | |
0 commit comments