Skip to content

Commit

Permalink
napi: Property accessors and callback data (#45)
Browse files Browse the repository at this point in the history
 - 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
  • Loading branch information
jasongin committed Jan 23, 2017
1 parent 7e2cb2f commit 67f4581
Show file tree
Hide file tree
Showing 32 changed files with 740 additions and 284 deletions.
6 changes: 4 additions & 2 deletions src/node_api_helpers.h
@@ -1,4 +1,4 @@
#ifndef SRC_NODE_API_HELPERS_H_
#ifndef SRC_NODE_API_HELPERS_H_
#define SRC_NODE_API_HELPERS_H_

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -17,7 +17,9 @@
#include <assert.h>

#define NAPI_METHOD(name) \
void name(napi_env env, napi_func_cb_info info)
void name(napi_env env, napi_callback_info info)
#define NAPI_GETTER(name) NAPI_METHOD(name)
#define NAPI_SETTER(name) NAPI_METHOD(name)

#define NAPI_MODULE_INIT(name) \
void name(napi_env env, napi_value exports, napi_value module)
Expand Down

0 comments on commit 67f4581

Please sign in to comment.