modif comtabilite

This commit is contained in:
2019-01-16 16:23:31 +01:00
parent 6b741a9666
commit 9312edc3ae
1844 changed files with 158848 additions and 55874 deletions
+12 -1
View File
@@ -1,6 +1,17 @@
# NAN ChangeLog
**Version 2.10.0: current Node 9.8.0, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1**
**Version 2.11.1: current Node 10.11.0, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1**
### 2.11.1 Sep 29 2018
- Fix: adapt to V8 7.0 24a22c3b25eeeec2016c6ec239bdd6169e985447
### 2.11.0 Aug 25 2018
- Removal: remove `FunctionCallbackInfo::Callee` for nodejs `>= 10` 1a56c0a6efd4fac944cb46c30912a8e023bda7d4
- Bugfix: Fix `AsyncProgressWorkerBase::WorkProgress` sends invalid data b0c764d1dab11e9f8b37ffb81e2560a4498aad5e
- Feature: Introduce `GetCurrentEventLoop` b4911b0bb1f6d47d860e10ec014d941c51efac5e
- Feature: Add `NAN_MODULE_WORKER_ENABLED` macro as a replacement for `NAN_MODULE` b058fb047d18a58250e66ae831444441c1f2ac7a
### 2.10.0 Mar 16 2018
+2 -2
View File
@@ -1,9 +1,9 @@
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.**
**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, 9 and 10.**
***Current version: 2.10.0***
***Current version: 2.11.1***
*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*
+3 -1
View File
@@ -45,7 +45,7 @@ Definition:
template<typename T> class FunctionCallbackInfo {
public:
ReturnValue<T> GetReturnValue() const;
v8::Local<v8::Function> Callee();
v8::Local<v8::Function> Callee(); // NOTE: Not available in NodeJS >= 10.0.0
v8::Local<v8::Value> Data();
v8::Local<v8::Object> Holder();
bool IsConstructCall();
@@ -58,6 +58,8 @@ template<typename T> class FunctionCallbackInfo {
See the [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/node-8.0/dd/d0d/classv8_1_1_function_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from methods.
**Note:** `FunctionCallbackInfo::Callee` is removed in Node.js after `10.0.0` because it is was deprecated in V8. Consider using `info.Data()` to pass any information you need.
<a name="api_nan_property_callback_info"></a>
### Nan::PropertyCallbackInfo
+1 -1
View File
@@ -10,7 +10,7 @@
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
When calling back into JavaScript asynchronously, 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
+1 -1
View File
@@ -100,7 +100,7 @@ class MyObject : public Nan::ObjectWrap {
const int argc = 1;
v8::Local<v8::Value> argv[argc] = {info[0]};
v8::Local<v8::Function> cons = Nan::New(constructor());
info.GetReturnValue().Set(cons->NewInstance(argc, argv));
info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked());
}
}
+3 -2
View File
@@ -43,12 +43,13 @@ template<typename T> class PersistentBase {
*/
template<typename S> void Reset(const PersistentBase<S> &other);
/** Returns true if the handle is empty. */
bool IsEmpty() const;
/**
* If non-empty, destroy the underlying storage cell
* IsEmpty() will return true after this call.
*/
bool IsEmpty();
void Empty();
template<typename S> bool operator==(const PersistentBase<S> &that);
Binary file not shown.
+53 -12
View File
@@ -13,7 +13,7 @@
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
*
* Version 2.10.0: current Node 9.8.0, Node 12: 0.12.18, Node 10: 0.10.48, iojs: 3.3.1
* Version 2.11.1: current Node 10.11.0, Node 12: 0.12.18, Node 10: 0.10.48, iojs: 3.3.1
*
* See https://github.com/nodejs/nan for the latest update to this file
**********************************************************************************/
@@ -36,6 +36,7 @@
#define NODE_7_0_MODULE_VERSION 51
#define NODE_8_0_MODULE_VERSION 57
#define NODE_9_0_MODULE_VERSION 59
#define NODE_10_0_MODULE_VERSION 64
#ifdef _MSC_VER
# define NAN_HAS_CPLUSPLUS_11 (_MSC_VER >= 1800)
@@ -91,6 +92,9 @@
namespace Nan {
#define NAN_CONCAT(a, b) NAN_CONCAT_HELPER(a, b)
#define NAN_CONCAT_HELPER(a, b) a##b
#define NAN_INLINE inline // TODO(bnoordhuis) Remove in v3.0.0.
#if defined(__GNUC__) && \
@@ -148,6 +152,21 @@ namespace Nan {
#define NAN_MODULE_INIT(name) \
void name(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target)
#if NODE_MAJOR_VERSION >= 10 || \
NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3
#define NAN_MODULE_WORKER_ENABLED(module_name, registration) \
extern "C" NODE_MODULE_EXPORT void \
NAN_CONCAT(node_register_module_v, NODE_MODULE_VERSION)( \
v8::Local<v8::Object> exports, v8::Local<v8::Value> module, \
v8::Local<v8::Context> context) \
{ \
registration(exports); \
}
#else
#define NAN_MODULE_WORKER_ENABLED(module_name, registration) \
NODE_MODULE(module_name, registration)
#endif
//=== CallbackInfo =============================================================
#include "nan_callbacks.h" // NOLINT(build/include)
@@ -560,6 +579,16 @@ class AsyncResource {
#endif
};
inline uv_loop_t* GetCurrentEventLoop() {
#if NODE_MAJOR_VERSION >= 10 || \
NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3 || \
NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION >= 10
return node::GetCurrentEventLoop(v8::Isolate::GetCurrent());
#else
return uv_default_loop();
#endif
}
//============ =================================================================
/* node 0.12 */
@@ -1031,7 +1060,11 @@ class Utf8String {
length_(0), str_(str_st_) {
HandleScope scope;
if (!from.IsEmpty()) {
#if V8_MAJOR_VERSION >= 7
v8::Local<v8::String> string = from->ToString(v8::Isolate::GetCurrent());
#else
v8::Local<v8::String> string = from->ToString();
#endif
if (!string.IsEmpty()) {
size_t len = 3 * string->Length() + 1;
assert(len <= INT_MAX);
@@ -1041,7 +1074,11 @@ class Utf8String {
}
const int flags =
v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8;
#if V8_MAJOR_VERSION >= 7
length_ = string->WriteUtf8(v8::Isolate::GetCurrent(), str_, static_cast<int>(len), 0, flags);
#else
length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
#endif
str_[length_] = '\0';
}
}
@@ -1899,7 +1936,7 @@ inline MaybeLocal<v8::Value> Call(
const char* resource_name = "nan:AsyncBareProgressWorkerBase")
: AsyncWorker(callback_, resource_name) {
uv_async_init(
uv_default_loop()
GetCurrentEventLoop()
, &async
, AsyncProgress_
);
@@ -1940,16 +1977,20 @@ class AsyncBareProgressWorker : public AsyncBareProgressWorkerBase {
Callback *callback_,
const char* resource_name = "nan:AsyncBareProgressWorker")
: AsyncBareProgressWorkerBase(callback_, resource_name) {
uv_mutex_init(&async_lock);
}
virtual ~AsyncBareProgressWorker() {
uv_mutex_destroy(&async_lock);
}
class ExecutionProgress {
friend class AsyncBareProgressWorker;
public:
void Signal() const {
uv_mutex_lock(&that_->async_lock);
uv_async_send(&that_->async);
uv_mutex_unlock(&that_->async_lock);
}
void Send(const T* data, size_t count) const {
@@ -1965,6 +2006,9 @@ class AsyncBareProgressWorker : public AsyncBareProgressWorkerBase {
virtual void Execute(const ExecutionProgress& progress) = 0;
virtual void HandleProgressCallback(const T *data, size_t size) = 0;
protected:
uv_mutex_t async_lock;
private:
void Execute() /*final override*/ {
ExecutionProgress progress(this);
@@ -1983,21 +2027,19 @@ class AsyncProgressWorkerBase : public AsyncBareProgressWorker<T> {
const char* resource_name = "nan:AsyncProgressWorkerBase")
: AsyncBareProgressWorker<T>(callback_, resource_name), asyncdata_(NULL),
asyncsize_(0) {
uv_mutex_init(&async_lock);
}
virtual ~AsyncProgressWorkerBase() {
uv_mutex_destroy(&async_lock);
delete[] asyncdata_;
}
void WorkProgress() {
uv_mutex_lock(&async_lock);
uv_mutex_lock(&this->async_lock);
T *data = asyncdata_;
size_t size = asyncsize_;
asyncdata_ = NULL;
uv_mutex_unlock(&async_lock);
asyncsize_ = 0;
uv_mutex_unlock(&this->async_lock);
// Don't send progress events after we've already completed.
if (this->callback) {
@@ -2014,17 +2056,16 @@ class AsyncProgressWorkerBase : public AsyncBareProgressWorker<T> {
std::copy(data, data + count, it);
}
uv_mutex_lock(&async_lock);
uv_mutex_lock(&this->async_lock);
T *old_data = asyncdata_;
asyncdata_ = new_data;
asyncsize_ = count;
uv_mutex_unlock(&async_lock);
uv_async_send(&this->async);
uv_mutex_unlock(&this->async_lock);
delete[] old_data;
uv_async_send(&this->async);
}
uv_mutex_t async_lock;
T *asyncdata_;
size_t asyncsize_;
};
@@ -2161,7 +2202,7 @@ inline void AsyncExecuteComplete (uv_work_t* req) {
inline void AsyncQueueWorker (AsyncWorker* worker) {
uv_queue_work(
uv_default_loop()
GetCurrentEventLoop()
, &worker->request
, AsyncExecute
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
+2
View File
@@ -105,7 +105,9 @@ class FunctionCallbackInfo {
return ReturnValue<T>(info_.GetReturnValue());
}
#if NODE_MAJOR_VERSION < 10
inline v8::Local<v8::Function> Callee() const { return info_.Callee(); }
#endif
inline v8::Local<v8::Value> Data() const { return data_; }
inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
inline bool IsConstructCall() const { return info_.IsConstructCall(); }
@@ -334,7 +334,11 @@ Factory<v8::String>::New(ExternalOneByteStringResource * value) {
Factory<v8::StringObject>::return_t
Factory<v8::StringObject>::New(v8::Local<v8::String> value) {
#if V8_MAJOR_VERSION >= 7
return v8::StringObject::New(v8::Isolate::GetCurrent(), value).As<v8::StringObject>();
#else
return v8::StringObject::New(value).As<v8::StringObject>();
#endif
}
//=== Unbound Script ===========================================================
+17 -20
View File
@@ -1,36 +1,31 @@
{
"_args": [
[
"nan@2.10.0",
"/mnt/data/Sites/anissabensalah.net/user/themes/anissabensalah"
]
],
"_development": true,
"_from": "nan@2.10.0",
"_id": "nan@2.10.0",
"_from": "nan@^2.10.0",
"_id": "nan@2.11.1",
"_inBundle": false,
"_integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
"_integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==",
"_location": "/nan",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "nan@2.10.0",
"raw": "nan@^2.10.0",
"name": "nan",
"escapedName": "nan",
"rawSpec": "2.10.0",
"rawSpec": "^2.10.0",
"saveSpec": null,
"fetchSpec": "2.10.0"
"fetchSpec": "^2.10.0"
},
"_requiredBy": [
"/node-sass"
],
"_resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"_spec": "2.10.0",
"_where": "/mnt/data/Sites/anissabensalah.net/user/themes/anissabensalah",
"_resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz",
"_shasum": "90e22bccb8ca57ea4cd37cc83d3819b52eea6766",
"_spec": "nan@^2.10.0",
"_where": "/home/kevin/Documents/Sites/anissabensalah.net/user/themes/anissabensalah/node_modules/node-sass",
"bugs": {
"url": "https://github.com/nodejs/nan/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Rod Vagg",
@@ -73,7 +68,8 @@
"url": "https://github.com/mkrufky"
}
],
"description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 9 compatibility",
"deprecated": false,
"description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 10 compatibility",
"devDependencies": {
"bindings": "~1.2.1",
"commander": "^2.8.1",
@@ -95,7 +91,8 @@
"scripts": {
"docs": "doc/.build.sh",
"rebuild-tests": "node-gyp rebuild --msvs_version=2015 --directory test",
"test": "tap --gc --stderr test/js/*-test.js"
"test": "tap --gc --stderr test/js/*-test.js",
"test:worker": "node --experimental-worker test/tap-as-worker.js --gc --stderr test/js/*-test.js"
},
"version": "2.10.0"
"version": "2.11.1"
}