update header

This commit is contained in:
raub 2018-03-12 10:50:57 +03:00
parent 54189d4047
commit 4ecd657128
2 changed files with 41 additions and 29 deletions

View File

@ -13,10 +13,19 @@
#define JS_STR(...) Nan::New<v8::String>(__VA_ARGS__).ToLocalChecked() #define JS_STR(...) Nan::New<v8::String>(__VA_ARGS__).ToLocalChecked()
#define JS_UTF8(...) Nan::New<v8::String>(__VA_ARGS__).ToLocalChecked()
#define JS_INT(val) Nan::New<v8::Integer>(val) #define JS_INT(val) Nan::New<v8::Integer>(val)
#define JS_INT32(val) Nan::New<v8::Integer>(val)
#define JS_UINT32(val) Nan::New<v8::Integer>(val)
#define JS_NUM(val) Nan::New<v8::Number>(val) #define JS_NUM(val) Nan::New<v8::Number>(val)
#define JS_OFFS(val) Nan::New<v8::Number>(val)
#define JS_FLOAT(val) Nan::New<v8::Number>(val)
#define JS_DOUBLE(val) Nan::New<v8::Number>(val)
#define JS_EXT(val) Nan::New<v8::External>(reinterpret_cast<void*>(val)) #define JS_EXT(val) Nan::New<v8::External>(reinterpret_cast<void*>(val))
#define JS_BOOL(val) (val) ? Nan::True() : Nan::False() #define JS_BOOL(val) (val) ? Nan::True() : Nan::False()
#define JS_FUN(val) Nan::New<v8::Function>(val).ToLocalChecked()
#define JS_OBJ(val) Nan::New<v8::Object>(val).ToLocalChecked()
#define JS_ARRV(val) Nan::New<v8::Object>(val).ToLocalChecked()
#define REQ_ARGS(N) \ #define REQ_ARGS(N) \
@ -133,6 +142,9 @@
if ( ! info.IsConstructCall() ) \ if ( ! info.IsConstructCall() ) \
return Nan::ThrowTypeError(T " must be called with the 'new' keyword."); return Nan::ThrowTypeError(T " must be called with the 'new' keyword.");
#define DES_CHECK \
if (_isDestroyed) return;
#define SETTER_CHECK(C, T) \ #define SETTER_CHECK(C, T) \
if ( ! value->C ) \ if ( ! value->C ) \
return Nan::ThrowTypeError("Value must be " T); return Nan::ThrowTypeError("Value must be " T);

View File

@ -1,31 +1,31 @@
{ {
"name": "addon-tools-raub", "name": "addon-tools-raub",
"author": "Luis Blanco <raubtierxxx@gmail.com>", "author": "Luis Blanco <raubtierxxx@gmail.com>",
"description": "A set of extra tools for Node.js addons", "description": "A set of extra tools for Node.js addons",
"version": "0.0.9", "version": "0.1.0",
"main": "index.js", "main": "index.js",
"keywords": [ "keywords": [
"node", "node",
"addon", "addon",
"header", "header",
"include", "include",
"platform", "platform",
"build", "build",
"paths" "paths"
], ],
"maintainers": [ "maintainers": [
{ {
"name": "Luis Blanco", "name": "Luis Blanco",
"email": "raubtierxxx@gmail.com", "email": "raubtierxxx@gmail.com",
"skype": "rauber666" "skype": "rauber666"
} }
], ],
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/raub/node-addon-tools.git" "url": "https://github.com/raub/node-addon-tools.git"
}, },
"dependencies": { "dependencies": {
"nan": "2.8.0" "nan": "2.8.0"
} }
} }