Commit 2dbeb88
node-api: handle no support for external buffers
Refs: electron/electron#35801
Refs: nodejs/abi-stable-node#441
Electron recently dropped support for external
buffers. Provide a way for addon authors to:
- hide the methods to create external buffers so they can
avoid using them if they want the broadest compatibility.
- call the methods that create external buffers at runtime
to check if external buffers are supported and either
use them or not based on the return code.
Signed-off-by: Michael Dawson <mdawson@devrus.com>
PR-URL: #45181
Backport-PR-URL: #45616
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>1 parent 785dc3e commit 2dbeb88Copy full SHA for 2dbeb88
File tree
Expand file treeCollapse file tree
8 files changed
+49
-2
lines changedOpen diff view settings
Filter options
- doc/api
- src
- test
- js-native-api/test_general
- node-api/test_general
Expand file treeCollapse file tree
8 files changed
+49
-2
lines changedOpen diff view settings
Collapse file
+27Lines changed: 27 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
573 | 573 | |
574 | 574 | |
575 | 575 | |
| 576 | + |
576 | 577 | |
577 | 578 | |
578 | 579 | |
| ||
2252 | 2253 | |
2253 | 2254 | |
2254 | 2255 | |
| 2256 | + |
| 2257 | + |
| 2258 | + |
| 2259 | + |
| 2260 | + |
| 2261 | + |
| 2262 | + |
| 2263 | + |
| 2264 | + |
| 2265 | + |
| 2266 | + |
| 2267 | + |
| 2268 | + |
2255 | 2269 | |
2256 | 2270 | |
2257 | 2271 | |
| ||
2295 | 2309 | |
2296 | 2310 | |
2297 | 2311 | |
| 2312 | + |
| 2313 | + |
| 2314 | + |
| 2315 | + |
| 2316 | + |
| 2317 | + |
| 2318 | + |
| 2319 | + |
| 2320 | + |
| 2321 | + |
| 2322 | + |
| 2323 | + |
| 2324 | + |
2298 | 2325 | |
2299 | 2326 | |
2300 | 2327 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
387 | 387 | |
388 | 388 | |
389 | 389 | |
| 390 | + |
390 | 391 | |
391 | 392 | |
392 | 393 | |
393 | 394 | |
394 | 395 | |
395 | 396 | |
396 | 397 | |
| 398 | + |
397 | 399 | |
398 | 400 | |
399 | 401 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
92 | 92 | |
93 | 93 | |
94 | 94 | |
95 | | - |
| 95 | + |
| 96 | + |
96 | 97 | |
97 | 98 | |
98 | 99 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
744 | 744 | |
745 | 745 | |
746 | 746 | |
| 747 | + |
747 | 748 | |
748 | 749 | |
749 | 750 | |
| ||
755 | 756 | |
756 | 757 | |
757 | 758 | |
758 | | - |
| 759 | + |
759 | 760 | |
760 | 761 | |
761 | 762 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
928 | 928 | |
929 | 929 | |
930 | 930 | |
| 931 | + |
| 932 | + |
| 933 | + |
| 934 | + |
931 | 935 | |
932 | 936 | |
933 | 937 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
138 | 138 | |
139 | 139 | |
140 | 140 | |
| 141 | + |
141 | 142 | |
142 | 143 | |
143 | 144 | |
144 | 145 | |
145 | 146 | |
146 | 147 | |
| 148 | + |
147 | 149 | |
148 | 150 | |
149 | 151 | |
|
Collapse file
test/js-native-api/test_general/test_general.c
Copy file name to clipboardExpand all lines: test/js-native-api/test_general/test_general.c+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
1 | 6 | |
2 | 7 | |
3 | 8 | |
|
Collapse file
test/node-api/test_general/test_general.c
Copy file name to clipboardExpand all lines: test/node-api/test_general/test_general.c+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
2 | 7 | |
3 | 8 | |
4 | 9 | |
|
0 commit comments