[Pkg-javascript-commits] [node-nan] 01/03: Imported Upstream version 2.0.9

Jérémy Lal kapouer at moszumanska.debian.org
Wed Sep 9 14:54:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

kapouer pushed a commit to branch master
in repository node-nan.

commit f5dfb13f7cd43ab8b00555ba3977f764eda85577
Author: Jérémy Lal <kapouer at melix.org>
Date:   Wed Sep 9 16:52:34 2015 +0200

    Imported Upstream version 2.0.9
---
 CHANGELOG.md   |  6 +++++-
 README.md      |  4 ++--
 doc/buffers.md | 18 +++++++++++++++---
 nan.h          |  6 +++---
 package.json   |  4 ++--
 5 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff961cd..457e7c4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
 # NAN ChangeLog
 
-**Version 2.0.8: current Node 12: 0.12.7, Node 10: 0.10.40, io.js: 3.2.0**
+**Version 2.0.9: current Node 4.0.0, Node 12: 0.12.7, Node 10: 0.10.40, iojs: 3.2.0**
+
+### 2.0.9 Sep 8 2015
+
+  - Bugfix: EscapableHandleScope in Nan::NewBuffer for Node 0.8 and 0.10 b1654d7
 
 ### 2.0.8 Aug 28 2015
 
diff --git a/README.md b/README.md
index c9ec07f..db3daec 100644
--- a/README.md
+++ b/README.md
@@ -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 and 0.12 as well as io.js.**
 
-***Current version: 2.0.8***
+***Current version: 2.0.9***
 
 *(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*
 
@@ -221,7 +221,7 @@ NAN's `node::Buffer` helpers exist as the API has changed across supported Node
 
  - <a href="doc/buffers.md#api_nan_new_buffer"><b><code>Nan::NewBuffer()</code></b></a>
  - <a href="doc/buffers.md#api_nan_copy_buffer"><b><code>Nan::CopyBuffer()</code></b></a>
-
+ - <a href="doc/buffers.md#api_nan_free_callback"><b><code>Nan::FreeCallback()</code></b></a>
 
 ### Nan::Callback
 
diff --git a/doc/buffers.md b/doc/buffers.md
index 6fe6edb..8d8d25c 100644
--- a/doc/buffers.md
+++ b/doc/buffers.md
@@ -4,7 +4,7 @@ NAN's `node::Buffer` helpers exist as the API has changed across supported Node
 
  - <a href="#api_nan_new_buffer"><b><code>Nan::NewBuffer()</code></b></a>
  - <a href="#api_nan_copy_buffer"><b><code>Nan::CopyBuffer()</code></b></a>
-
+ - <a href="#api_nan_free_callback"><b><code>Nan::FreeCallback()</code></b></a>
 
 <a name="api_nan_new_buffer"></a>
 ### Nan::NewBuffer()
@@ -20,10 +20,9 @@ Signature:
 ```c++
 Nan::MaybeLocal<v8::Object> Nan::NewBuffer(uint32_t size)
 Nan::MaybeLocal<v8::Object> Nan::NewBuffer(char* data, uint32_t size)
-// uses `node::smalloc::FreeCallback` on older versions of Node
 Nan::MaybeLocal<v8::Object> Nan::NewBuffer(char *data,
                                            size_t length,
-                                           node::Buffer::FreeCallback callback,
+                                           Nan::FreeCallback callback,
                                            void *hint)
 ```
 
@@ -40,3 +39,16 @@ Signature:
 ```c++
 Nan::MaybeLocal<v8::Object> Nan::CopyBuffer(const char *data, uint32_t size)
 ```
+
+
+<a name="api_nan_free_callback"></a>
+### Nan::FreeCallback()
+
+A free callback that can be provided to [`Nan::NewBuffer()`](#api_nan_new_buffer).
+The supplied callback will be invoked when the `Buffer` undergoes garbage collection.
+
+Signature:
+
+```c++
+typedef void (*FreeCallback)(char *data, void *hint);
+```
diff --git a/nan.h b/nan.h
index 45568ea..3f09c8d 100644
--- a/nan.h
+++ b/nan.h
@@ -12,7 +12,7 @@
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  *
- * Version 2.0.8: current Node 12: 0.12.7, Node 10: 0.10.40, io.js: 3.2.0
+ * Version 2.0.9: current Node 4.0.0, Node 12: 0.12.7, Node 10: 0.10.40, iojs: 3.2.0
  *
  * See https://github.com/nodejs/nan for the latest update to this file
  **********************************************************************************/
@@ -1026,12 +1026,12 @@ class Utf8String {
     , node::Buffer::free_callback callback
     , void *hint
   ) {
-    HandleScope scope;
+    EscapableHandleScope scope;
     // arbitrary buffer lengths requires
     // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
     assert(length <= imp::kMaxLength && "too large buffer");
     return MaybeLocal<v8::Object>(
-        New(node::Buffer::New(data, length, callback, hint)->handle_));
+        scope.Escape(New(node::Buffer::New(data, length, callback, hint)->handle_)));
   }
 
   NAN_INLINE MaybeLocal<v8::Object> CopyBuffer(
diff --git a/package.json b/package.json
index 87768e6..9b391e5 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "nan",
-  "version": "2.0.8",
-  "description": "Native Abstractions for Node.js: C++ header for Node 0.8->0.12 compatibility",
+  "version": "2.0.9",
+  "description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 4 compatibility",
   "main": "include_dirs.js",
   "repository": {
     "type": "git",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-nan.git



More information about the Pkg-javascript-commits mailing list