Commit 5a0efa0
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
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>1 parent 3b2b70d commit 5a0efa0Copy full SHA for 5a0efa0
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 |
|---|---|---|
| ||
579 | 579 | |
580 | 580 | |
581 | 581 | |
| 582 | + |
582 | 583 | |
583 | 584 | |
584 | 585 | |
| ||
2399 | 2400 | |
2400 | 2401 | |
2401 | 2402 | |
| 2403 | + |
| 2404 | + |
| 2405 | + |
| 2406 | + |
| 2407 | + |
| 2408 | + |
| 2409 | + |
| 2410 | + |
| 2411 | + |
| 2412 | + |
| 2413 | + |
| 2414 | + |
| 2415 | + |
2402 | 2416 | |
2403 | 2417 | |
2404 | 2418 | |
| ||
2443 | 2457 | |
2444 | 2458 | |
2445 | 2459 | |
| 2460 | + |
| 2461 | + |
| 2462 | + |
| 2463 | + |
| 2464 | + |
| 2465 | + |
| 2466 | + |
| 2467 | + |
| 2468 | + |
| 2469 | + |
| 2470 | + |
| 2471 | + |
| 2472 | + |
2446 | 2473 | |
2447 | 2474 | |
2448 | 2475 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
401 | 401 | |
402 | 402 | |
403 | 403 | |
| 404 | + |
404 | 405 | |
405 | 406 | |
406 | 407 | |
407 | 408 | |
408 | 409 | |
409 | 410 | |
410 | 411 | |
| 412 | + |
411 | 413 | |
412 | 414 | |
413 | 415 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
98 | 98 | |
99 | 99 | |
100 | 100 | |
101 | | - |
| 101 | + |
| 102 | + |
102 | 103 | |
103 | 104 | |
104 | 105 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
746 | 746 | |
747 | 747 | |
748 | 748 | |
| 749 | + |
749 | 750 | |
750 | 751 | |
751 | 752 | |
| ||
757 | 758 | |
758 | 759 | |
759 | 760 | |
760 | | - |
| 761 | + |
761 | 762 | |
762 | 763 | |
763 | 764 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
950 | 950 | |
951 | 951 | |
952 | 952 | |
| 953 | + |
| 954 | + |
| 955 | + |
| 956 | + |
953 | 957 | |
954 | 958 | |
955 | 959 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
153 | 153 | |
154 | 154 | |
155 | 155 | |
| 156 | + |
156 | 157 | |
157 | 158 | |
158 | 159 | |
159 | 160 | |
160 | 161 | |
161 | 162 | |
162 | 163 | |
| 164 | + |
163 | 165 | |
164 | 166 | |
165 | 167 | |
|
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