mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
node-api: handle no support for external buffers
Refs: https://github.com/electron/electron/issues/35801 Refs: https://github.com/nodejs/abi-stable-node/issues/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: https://github.com/nodejs/node/pull/45181 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
#define NAPI_EXPERIMENTAL
|
||||
// we define NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED here to validate that it can
|
||||
// be used as a form of test itself. It is
|
||||
// not related to any of the other tests
|
||||
// defined in the file
|
||||
#define NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED
|
||||
#include <node_api.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../js-native-api/common.h"
|
||||
|
||||
Reference in New Issue
Block a user