Commit b3814e6b authored by Jérémy Lal's avatar Jérémy Lal

Update upstream source from tag 'upstream/2.9.2'

Update to upstream version '2.9.2'
with Debian dir 5d7686c6eae2b6613971c483db269af7fba82a87
parents dd543a7a 06bd8b6b
......@@ -21,6 +21,10 @@ env:
- TRAVIS_NODE_VERSION="7"
- TRAVIS_NODE_VERSION="8"
- TRAVIS_NODE_VERSION="9"
matrix:
exclude:
- os: osx
env: TRAVIS_NODE_VERSION="0.12"
install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
......
# NAN ChangeLog
**Version 2.8.0: current Node 9.2.0, Node 12: 0.12.18, Node 10: 0.10.48, iojs: 3.3.1**
**Version 2.9.2: current Node 9.5.0, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1**
### 2.9.2 Feb 22 2018
- Bugfix: Bandaid for async hooks 212bd2f849be14ef1b02fc85010b053daa24252b
### 2.9.1 Feb 22 2018
- Bugfix: Avoid deprecation warnings in deprecated `Nan::Callback::operator()` 372b14d91289df4604b0f81780709708c45a9aa4
- Bugfix: Avoid deprecation warnings in `Nan::JSON` 3bc294bce0b7d0a3ee4559926303e5ed4866fda2
### 2.9.0 Feb 22 2018
- Deprecation: Deprecate legacy `Callback::Call` 6dd5fa690af61ca3523004b433304c581b3ea309
- Feature: introduce `AsyncResource` class 90c0a179c0d8cb5fd26f1a7d2b1d6231eb402d48o
- Feature: Add context aware `Nan::Callback::Call` functions 7169e09fb088418b6e388222e88b4c13f07ebaee
- Feature: Make `AsyncWorker` context aware 066ba21a6fb9e2b5230c9ed3a6fc51f1211736a4
- Feature: add `Callback` overload to `Nan::Call` 5328daf66e202658c1dc0d916c3aaba99b3cc606
- Bugfix: fix warning: suggest parentheses around `&&` within `||` b2bb63d68b8ae623a526b542764e1ac82319cb2c
- Bugfix: Fix compilation on io.js 3 d06114dba0a522fb436f0c5f47b994210968cd7b
### 2.8.0 Nov 15 2017
......
The MIT License (MIT)
=====================
Copyright (c) 2017 NAN contributors
Copyright (c) 2018 NAN contributors
-----------------------------------
*NAN contributors listed at <https://github.com/nodejs/nan#contributors>*
......
......@@ -35,6 +35,7 @@ LINT_SOURCES = \
nan_weak.h \
test/cpp/accessors.cpp \
test/cpp/accessors2.cpp \
test/cpp/asyncresource.cpp \
test/cpp/asyncworker.cpp \
test/cpp/asyncprogressworker.cpp \
test/cpp/asyncprogressworkerstream.cpp \
......@@ -47,6 +48,7 @@ LINT_SOURCES = \
test/cpp/error.cpp \
test/cpp/gc.cpp \
test/cpp/indexedinterceptors.cpp \
test/cpp/callbackcontext.cpp \
test/cpp/converters.cpp \
test/cpp/isolatedata.cpp \
test/cpp/json-parse.cpp \
......@@ -69,6 +71,7 @@ LINT_SOURCES = \
test/cpp/returnvalue.cpp \
test/cpp/setcallhandler.cpp \
test/cpp/settemplate.cpp \
test/cpp/sleep.h \
test/cpp/strings.cpp \
test/cpp/symbols.cpp \
test/cpp/threadlocal.cpp \
......
......@@ -3,7 +3,7 @@ Native Abstractions for Node.js
**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8 and 9.**
***Current version: 2.8.0***
***Current version: 2.9.2***
*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*
......@@ -21,6 +21,7 @@ This project also contains some helper utilities that make addon development a b
* **[Example](#example)**
* **[API](#api)**
* **[Tests](#tests)**
* **[Knowns issues](#issues)**
* **[Governance & Contributing](#governance)**
<a name="news"></a>
......@@ -315,6 +316,7 @@ The hooks to access V8 internals—including GC and statistics—are different a
### Miscellaneous Node Helpers
- <a href="doc/node_misc.md#api_nan_asyncresource"><b><code>Nan::AsyncResource</code></b></a>
- <a href="doc/node_misc.md#api_nan_make_callback"><b><code>Nan::MakeCallback()</code></b></a>
- <a href="doc/node_misc.md#api_nan_module_init"><b><code>NAN_MODULE_INIT()</code></b></a>
- <a href="doc/node_misc.md#api_nan_export"><b><code>Nan::Export()</code></b></a>
......@@ -341,6 +343,33 @@ npm install
make test
```
<a name="issues"></a>
## Known issues
### Compiling against Node.js 0.12 on OSX
With new enough compilers available on OSX, the versions of V8 headers corresponding to Node.js 0.12
do not compile anymore. The error looks something like:
```
❯ CXX(target) Release/obj.target/accessors/cpp/accessors.o
In file included from ../cpp/accessors.cpp:9:
In file included from ../../nan.h:51:
In file included from /Users/ofrobots/.node-gyp/0.12.18/include/node/node.h:61:
/Users/ofrobots/.node-gyp/0.12.18/include/node/v8.h:5800:54: error: 'CreateHandle' is a protected member of 'v8::HandleScope'
return Handle<T>(reinterpret_cast<T*>(HandleScope::CreateHandle(
~~~~~~~~~~~~~^~~~~~~~~~~~
```
This can be worked around by patching your local versions of v8.h corresponding to Node 0.12 to make
`v8::Handle` a friend of `v8::HandleScope`. Since neither Node.js not V8 support this release line anymore
this patch cannot be released by either project in an official release.
For this reason, we do not test against Node.js 0.12 on OSX in this project's CI. If you need to support
that configuration, you will need to either get an older compiler, or apply a source patch to the version
of V8 headers as a workaround.
<a name="governance"></a>
## Governance & Contributing
......@@ -422,6 +451,6 @@ By making a contribution to this project, I certify that:
## Licence &amp; copyright
Copyright (c) 2017 NAN WG Members / Collaborators (listed above).
Copyright (c) 2018 NAN WG Members / Collaborators (listed above).
Native Abstractions for Node.js is licensed under an MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
......@@ -12,12 +12,17 @@
`Nan::AsyncWorker` is an _abstract_ class that you can subclass to have much of the annoying asynchronous queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the asynchronous work is in progress.
This class internally handles the details of creating an [`AsyncResource`][AsyncResource], and running the callback in the
correct async context. To be able to identify the async resources created by this class in async-hooks, provide a
`resource_name` to the constructor. It is recommended that the module name be used as a prefix to the `resource_name` to avoid
collisions in the names. For more details see [`AsyncResource`][AsyncResource] documentation. The `resource_name` needs to stay valid for the lifetime of the worker instance.
Definition:
```c++
class AsyncWorker {
public:
explicit AsyncWorker(Callback *callback_);
explicit AsyncWorker(Callback *callback_, const char* resource_name = "nan:AsyncWorker");
virtual ~AsyncWorker();
......@@ -73,9 +78,9 @@ Definition:
template<class T>
class AsyncProgressWorkerBase<T> : public AsyncWorker {
public:
explicit AsyncProgressWorker(Callback *callback_);
explicit AsyncProgressWorkerBase(Callback *callback_, const char* resource_name = ...);
virtual ~AsyncProgressWorker();
virtual ~AsyncProgressWorkerBase();
void WorkProgress();
......@@ -108,7 +113,7 @@ Definition:
template<class T>
class AsyncProgressQueueWorker<T> : public AsyncWorker {
public:
explicit AsyncProgressQueueWorker(Callback *callback_);
explicit AsyncProgressQueueWorker(Callback *callback_, const char* resource_name = "nan:AsyncProgressQueueWorker");
virtual ~AsyncProgressQueueWorker();
......@@ -137,3 +142,5 @@ Definition:
```c++
void AsyncQueueWorker(AsyncWorker *);
```
[AsyncResource]: "node_misc.html#api_nan_asyncresource"
......@@ -22,12 +22,14 @@ class Callback {
v8::Local<v8::Function> operator*() const;
v8::Local<v8::Value> operator()(v8::Local<v8::Object> target,
int argc = 0,
v8::Local<v8::Value> argv[] = 0) const;
MaybeLocal<v8::Value> operator()(AsyncResource* async_resource,
v8::Local<v8::Object> target,
int argc = 0,
v8::Local<v8::Value> argv[] = 0) const;
v8::Local<v8::Value> operator()(int argc = 0,
v8::Local<v8::Value> argv[] = 0) const;
MaybeLocal<v8::Value> operator()(AsyncResource* async_resource,
int argc = 0,
v8::Local<v8::Value> argv[] = 0) const;
void SetFunction(const v8::Local<v8::Function> &fn);
......@@ -39,6 +41,24 @@ class Callback {
void Reset();
MaybeLocal<v8::Value> Call(v8::Local<v8::Object> target,
int argc,
v8::Local<v8::Value> argv[],
AsyncResource* async_resource) const;
MaybeLocal<v8::Value> Call(int argc,
v8::Local<v8::Value> argv[],
AsyncResource* async_resource) const;
// Deprecated versions. Use the versions that accept an async_resource instead
// as they run the callback in the correct async context as specified by the
// resource. If you want to call a synchronous JS function (i.e. on a
// non-empty JS stack), you can use Nan::Call instead.
v8::Local<v8::Value> operator()(v8::Local<v8::Object> target,
int argc = 0,
v8::Local<v8::Value> argv[] = 0) const;
v8::Local<v8::Value> operator()(int argc = 0,
v8::Local<v8::Value> argv[] = 0) const;
v8::Local<v8::Value> Call(v8::Local<v8::Object> target,
int argc,
v8::Local<v8::Value> argv[]) const;
......
......@@ -122,12 +122,16 @@ template<typename T> Nan::Maybe<T> Nan::Just(const T &t);
<a name="api_nan_call"></a>
### Nan::Call()
A helper method for calling [`v8::Function#Call()`](https://v8docs.nodesource.com/io.js-3.3/d5/d54/classv8_1_1_function.html#a468a89f737af0612db10132799c827c0) in a way compatible across supported versions of V8.
A helper method for calling a synchronous [`v8::Function#Call()`](https://v8docs.nodesource.com/io.js-3.3/d5/d54/classv8_1_1_function.html#a468a89f737af0612db10132799c827c0) in a way compatible across supported versions of V8.
For asynchronous callbacks, use Nan::Callback::Call along with an AsyncResource.
Signature:
```c++
Nan::MaybeLocal<v8::Value> Nan::Call(v8::Local<v8::Function> fun, v8::Local<v8::Object> recv, int argc, v8::Local<v8::Value> argv[]);
Nan::MaybeLocal<v8::Value> Nan::Call(const Nan::Callback& callback, v8::Local<v8::Object> recv,
int argc, v8::Local<v8::Value> argv[]);
```
......
## Miscellaneous Node Helpers
- <a href="#api_nan_asyncresource"><b><code>Nan::AsyncResource</code></b></a>
- <a href="#api_nan_make_callback"><b><code>Nan::MakeCallback()</code></b></a>
- <a href="#api_nan_module_init"><b><code>NAN_MODULE_INIT()</code></b></a>
- <a href="#api_nan_export"><b><code>Nan::Export()</code></b></a>
<a name="api_nan_asyncresource"></a>
### Nan::AsyncResource
This class is analogous to the `AsyncResource` JavaScript class exposed by Node's [async_hooks][] API.
When calling back into JavaScript asynchornously, special care must be taken to ensure that the runtime can properly track
async hops. `Nan::AsyncResource` is a class that provides an RAII wrapper around `node::EmitAsyncInit`, `node::EmitAsyncDestroy`,
and `node::MakeCallback`. Using this mechanism to call back into JavaScript, as opposed to `Nan::MakeCallback` or
`v8::Function::Call` ensures that the callback is executed in the correct async context. This ensures that async mechanisms
such as domains and [async_hooks][] function correctly.
Definition:
```c++
class AsyncResource {
public:
AsyncResource(v8::Local<v8::String> name,
v8::Local<v8::Object> resource = New<v8::Object>());
AsyncResource(const char* name,
v8::Local<v8::Object> resource = New<v8::Object>());
~AsyncResource();
v8::MaybeLocal<v8::Value> runInAsyncScope(v8::Local<v8::Object> target,
v8::Local<v8::Function> func,
int argc,
v8::Local<v8::Value>* argv,
Nan::async_context async_context);
v8::MaybeLocal<v8::Value> runInAsyncScope(v8::Local<v8::Object> target,
v8::Local<v8::String> symbol,
int argc,
v8::Local<v8::Value>* argv,
Nan::async_context async_context);
v8::MaybeLocal<v8::Value> runInAsyncScope(v8::Local<v8::Object> target,
const char* method,
int argc,
v8::Local<v8::Value>* argv,
Nan::async_context async_context);
};
```
* `name`: Identifier for the kind of resource that is being provided for diagnostics information exposed by the [async_hooks][]
API. This will be passed to the possible `init` hook as the `type`. To avoid name collisions with other modules we recommend
that the name include the name of the owning module as a prefix. For example `mysql` module could use something like
`mysql:batch-db-query-resource`.
* `resource`: An optional object associated with the async work that will be passed to the possible [async_hooks][]
`init` hook. If this parameter is omitted, or an empty handle is provided, this object will be created automatically.
* When calling JS on behalf of this resource, one can use `runInAsyncScope`. This will ensure that the callback runs in the
correct async execution context.
* `AsyncDestroy` is automatically called when an AsyncResource object is destroyed.
For more details, see the Node [async_hooks][] documentation. You might also want to take a look at the documentation for the
[N-API counterpart][napi]. For example usage, see the `asyncresource.cpp` example in the `test/cpp` directory.
<a name="api_nan_make_callback"></a>
### Nan::MakeCallback()
Wrappers around `node::MakeCallback()` providing a consistent API across all supported versions of Node.
Wrappers around the legacy `node::MakeCallback()` APIs.
Use `MakeCallback()` rather than using `v8::Function#Call()` directly in order to properly process internal Node functionality including domains, async hooks, the microtask queue, and other debugging functionality.
We recommend that you use the `AsyncResource` class and `AsyncResource::runInAsyncScope` instead of using `Nan::MakeCallback` or
`v8::Function#Call()` directly. `AsyncResource` properly takes care of running the callback in the correct async execution
context – something that is essential for functionality like domains, async_hooks and async debugging.
Signatures:
......@@ -61,3 +116,6 @@ NAN_MODULE_INIT(Init) {
NAN_EXPORT(target, Foo);
}
```
[async_hooks]: https://nodejs.org/dist/latest-v9.x/docs/api/async_hooks.html
[napi]: https://nodejs.org/dist/latest-v9.x/docs/api/n-api.html#n_api_custom_asynchronous_operations
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
This diff is collapsed.
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......@@ -134,14 +134,17 @@ class JSON {
#if NAN_JSON_H_NEED_PARSE
inline v8::Local<v8::Value> parse(v8::Local<v8::Value> arg) {
assert(!parse_cb_.IsEmpty() && "parse_cb_ is empty");
return parse_cb_.Call(1, &arg);
AsyncResource resource("nan:JSON.parse");
return parse_cb_.Call(1, &arg, &resource).FromMaybe(v8::Local<v8::Value>());
}
#endif // NAN_JSON_H_NEED_PARSE
#if NAN_JSON_H_NEED_STRINGIFY
inline v8::Local<v8::Value> stringify(v8::Local<v8::Value> arg) {
assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty");
return stringify_cb_.Call(1, &arg);
AsyncResource resource("nan:JSON.stringify");
return stringify_cb_.Call(1, &arg, &resource)
.FromMaybe(v8::Local<v8::Value>());
}
inline v8::Local<v8::Value> stringify(v8::Local<v8::Value> arg,
......@@ -153,7 +156,9 @@ class JSON {
Nan::Null(),
gap
};
return stringify_cb_.Call(3, argv);
AsyncResource resource("nan:JSON.stringify");
return stringify_cb_.Call(3, argv, &resource)
.FromMaybe(v8::Local<v8::Value>());
}
#endif // NAN_JSON_H_NEED_STRINGIFY
};
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......@@ -109,8 +109,22 @@ inline Maybe<bool> DefineOwnProperty(
, v8::PropertyAttribute attribs = v8::None) {
v8::Isolate *isolate = v8::Isolate::GetCurrent();
v8::HandleScope scope(isolate);
#if NODE_MODULE_VERSION >= NODE_4_0_MODULE_VERSION
return obj->DefineOwnProperty(isolate->GetCurrentContext(), key, value,
attribs);
#else
Maybe<v8::PropertyAttribute> maybeCurrent =
obj->GetPropertyAttributes(isolate->GetCurrentContext(), key);
if (maybeCurrent.IsNothing()) {
return Nothing<bool>();
}
v8::PropertyAttribute current = maybeCurrent.FromJust();
return !(current & v8::DontDelete) || // configurable OR
(!(current & v8::ReadOnly) && // writable AND
!((attribs ^ current) & ~v8::ReadOnly)) // same excluding RO
? Just<bool>(obj->ForceSet(key, value, attribs))
: Nothing<bool>();
#endif
}
NAN_DEPRECATED inline Maybe<bool> ForceSet(
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......@@ -155,8 +155,8 @@ inline Maybe<bool> DefineOwnProperty(
, v8::PropertyAttribute attribs = v8::None) {
v8::PropertyAttribute current = obj->GetPropertyAttributes(key);
return !(current & v8::DontDelete) || // configurable OR
!(current & v8::ReadOnly) && // writable AND
!((attribs ^ current) & ~v8::ReadOnly) // same excluding RO
(!(current & v8::ReadOnly) && // writable AND
!((attribs ^ current) & ~v8::ReadOnly)) // same excluding RO
? Just<bool>(obj->ForceSet(key, value, attribs))
: Nothing<bool>();
}
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
{
"name": "nan",
"version": "2.8.0",
"version": "2.9.2",
"description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 9 compatibility",
"main": "include_dirs.js",
"repository": {
......
......@@ -90,6 +90,14 @@
"target_name" : "makecallback"
, "sources" : [ "cpp/makecallback.cpp" ]
}
, {
"target_name" : "asyncresource"
, "sources" : [ "cpp/asyncresource.cpp" ]
}
, {
"target_name" : "callbackcontext"
, "sources" : [ "cpp/callbackcontext.cpp" ]
}
, {
"target_name" : "isolatedata"
, "sources" : [ "cpp/isolatedata.cpp" ]
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2017 NAN contributors
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
......@@ -35,7 +35,7 @@ class ProgressQueueWorker : public AsyncProgressQueueWorker<char> {
v8::Local<v8::Value> argv[] = {
New<v8::Integer>(*reinterpret_cast<int*>(const_cast<char*>(data)))
};
progress->Call(1, argv);
progress->Call(1, argv, async_resource);
}
private:
......