Skip to content

Commit 67f4581

Browse files
authored
napi: Property accessors and callback data (#45)
- Add support for property descriptors including accessor callbacks - Add a data pointer for function and accessor callbacks - Add API for defining a property using a property descriptor - Update the constructor API to use property descriptors
1 parent 7e2cb2f commit 67f4581

File tree

32 files changed

+740
-284
lines changed

32 files changed

+740
-284
lines changed

src/node_api_helpers.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifndef SRC_NODE_API_HELPERS_H_
1+
#ifndef SRC_NODE_API_HELPERS_H_
22
#define SRC_NODE_API_HELPERS_H_
33

44
////////////////////////////////////////////////////////////////////////////////
@@ -17,7 +17,9 @@
1717
#include <assert.h>
1818

1919
#define NAPI_METHOD(name) \
20-
void name(napi_env env, napi_func_cb_info info)
20+
void name(napi_env env, napi_callback_info info)
21+
#define NAPI_GETTER(name) NAPI_METHOD(name)
22+
#define NAPI_SETTER(name) NAPI_METHOD(name)
2123

2224
#define NAPI_MODULE_INIT(name) \
2325
void name(napi_env env, napi_value exports, napi_value module)

0 commit comments

Comments
 (0)