[Pkg-javascript-commits] [node-leveldown] 07/10: remove update-nan patch

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Fri Sep 12 17:01:00 UTC 2014


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

andrewrk-guest pushed a commit to branch master
in repository node-leveldown.

commit 538e6a2826f76bb0bf73a686544affd6cc85c0b6
Author: Andrew Kelley <superjoe30 at gmail.com>
Date:   Fri Sep 12 16:05:16 2014 +0000

    remove update-nan patch
---
 debian/patches/series           |   1 -
 debian/patches/update-nan.patch | 658 ----------------------------------------
 2 files changed, 659 deletions(-)

diff --git a/debian/patches/series b/debian/patches/series
index f024b07..af72458 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 use-system-libs.patch
-update-nan.patch
diff --git a/debian/patches/update-nan.patch b/debian/patches/update-nan.patch
deleted file mode 100644
index 46944f8..0000000
--- a/debian/patches/update-nan.patch
+++ /dev/null
@@ -1,658 +0,0 @@
-Description: update nan to 1.2.0
- leveldown 0.10.2 depends on nan 0.6.0 but 1.2.0 is in Debian. This patch
- updates to the new version.
-Author: Andrew Kelley <superjoe30 at gmail.com>
-Bug: <url in upstream bugtracker>
-Bug-Debian: http://bugs.debian.org/<bugnumber>
-Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
-Forwarded: https://github.com/rvagg/node-leveldown/pull/115
-Last-Update: 2012-06-29
---- node-leveldown-0.10.2.orig/package.json
-+++ node-leveldown-0.10.2/package.json
-@@ -28,8 +28,9 @@
-   ],
-   "main": "index.js",
-   "dependencies": {
-+    "abstract-leveldown": "^0.11.4",
-     "bindings": "~1.1.1",
--    "nan": "~0.6.0"
-+    "nan": "^1.2.0"
-   },
-   "devDependencies": {
-     "tap": "~0.4.1",
---- node-leveldown-0.10.2.orig/src/async.h
-+++ node-leveldown-0.10.2/src/async.h
-@@ -22,14 +22,14 @@ public:
-   ) : NanAsyncWorker(callback), database(database) {
-     NanScope();
-     v8::Local<v8::Object> obj = v8::Object::New();
--    NanAssignPersistent(v8::Object, persistentHandle, obj);
-+    NanAssignPersistent(persistentHandle, obj);
-   }
- 
- protected:
-   void SetStatus(leveldb::Status status) {
-     this->status = status;
-     if (!status.ok())
--      this->errmsg = strdup(status.ToString().c_str());
-+      this->SetErrorMessage(status.ToString().c_str());
-   }
-   Database* database;
- private:
---- node-leveldown-0.10.2.orig/src/batch.cc
-+++ node-leveldown-0.10.2/src/batch.cc
-@@ -30,8 +30,8 @@ leveldb::Status Batch::Write () {
- 
- void Batch::Init () {
-   v8::Local<v8::FunctionTemplate> tpl = v8::FunctionTemplate::New(Batch::New);
--  NanAssignPersistent(v8::FunctionTemplate, batch_constructor, tpl);
--  tpl->SetClassName(NanSymbol("Batch"));
-+  NanAssignPersistent(batch_constructor, tpl);
-+  tpl->SetClassName(NanNew<v8::String>("Batch"));
-   tpl->InstanceTemplate()->SetInternalFieldCount(1);
-   NODE_SET_PROTOTYPE_METHOD(tpl, "put", Batch::Put);
-   NODE_SET_PROTOTYPE_METHOD(tpl, "del", Batch::Del);
-@@ -49,7 +49,7 @@ NAN_METHOD(Batch::New) {
-     optionsObj = v8::Local<v8::Object>::Cast(args[1]);
-   }
- 
--  bool sync = NanBooleanOptionValue(optionsObj, NanSymbol("sync"));
-+  bool sync = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("sync"));
- 
-   Batch* batch = new Batch(database, sync);
-   batch->Wrap(args.This());
-@@ -67,7 +67,7 @@ v8::Handle<v8::Value> Batch::NewInstance
-   v8::Local<v8::Object> instance;
- 
-   v8::Local<v8::FunctionTemplate> constructorHandle =
--      NanPersistentToLocal(batch_constructor);
-+      NanNew(batch_constructor);
- 
-   if (optionsObj.IsEmpty()) {
-     v8::Handle<v8::Value> argv[1] = { database };
-@@ -165,7 +165,7 @@ NAN_METHOD(Batch::Write) {
-     BatchWriteWorker* worker  = new BatchWriteWorker(batch, callback);
-     // persist to prevent accidental GC
-     v8::Local<v8::Object> _this = args.This();
--    worker->SavePersistent("batch", _this);
-+    worker->SaveToPersistent("batch", _this);
-     NanAsyncQueueWorker(worker);
-   } else {
-     LD_RUN_CALLBACK(v8::Local<v8::Function>::Cast(args[0]), 0, NULL);
---- node-leveldown-0.10.2.orig/src/database.cc
-+++ node-leveldown-0.10.2/src/database.cc
-@@ -130,8 +130,8 @@ NAN_METHOD(LevelDOWN) {
- 
- void Database::Init () {
-   v8::Local<v8::FunctionTemplate> tpl = v8::FunctionTemplate::New(Database::New);
--  NanAssignPersistent(v8::FunctionTemplate, database_constructor, tpl);
--  tpl->SetClassName(NanSymbol("Database"));
-+  NanAssignPersistent(database_constructor, tpl);
-+  tpl->SetClassName(NanNew<v8::String>("Database"));
-   tpl->InstanceTemplate()->SetInternalFieldCount(1);
-   NODE_SET_PROTOTYPE_METHOD(tpl, "open", Database::Open);
-   NODE_SET_PROTOTYPE_METHOD(tpl, "close", Database::Close);
-@@ -153,7 +153,7 @@ NAN_METHOD(Database::New) {
-   if (!args[0]->IsString())
-     return NanThrowError("constructor requires a location string argument");
- 
--  char* location = NanFromV8String(args[0].As<v8::Object>(), Nan::UTF8, NULL, NULL, 0, v8::String::NO_OPTIONS);
-+  char* location = (char*)NanRawString(args[0], Nan::UTF8, NULL, NULL, 0, v8::String::NO_OPTIONS);
- 
-   Database* obj = new Database(location);
-   obj->Wrap(args.This());
-@@ -167,7 +167,7 @@ v8::Handle<v8::Value> Database::NewInsta
-   v8::Local<v8::Object> instance;
- 
-   v8::Local<v8::FunctionTemplate> constructorHandle =
--      NanPersistentToLocal(database_constructor);
-+      NanNew(database_constructor);
- 
-   if (location.IsEmpty()) {
-     instance = constructorHandle->GetFunction()->NewInstance(0, NULL);
-@@ -186,37 +186,37 @@ NAN_METHOD(Database::Open) {
- 
-   bool createIfMissing = NanBooleanOptionValue(
-       optionsObj
--    , NanSymbol("createIfMissing")
-+    , NanNew<v8::String>("createIfMissing")
-     , true
-   );
-   bool errorIfExists =
--      NanBooleanOptionValue(optionsObj, NanSymbol("errorIfExists"));
-+      NanBooleanOptionValue(optionsObj, NanNew<v8::String>("errorIfExists"));
-   bool compression = 
--      NanBooleanOptionValue(optionsObj, NanSymbol("compression"), true);
-+      NanBooleanOptionValue(optionsObj, NanNew<v8::String>("compression"), true);
- 
-   uint32_t cacheSize = NanUInt32OptionValue(
-       optionsObj
--    , NanSymbol("cacheSize")
-+    , NanNew<v8::String>("cacheSize")
-     , 8 << 20
-   );
-   uint32_t writeBufferSize = NanUInt32OptionValue(
-       optionsObj
--    , NanSymbol("writeBufferSize")
-+    , NanNew<v8::String>("writeBufferSize")
-     , 4 << 20
-   );
-   uint32_t blockSize = NanUInt32OptionValue(
-       optionsObj
--    , NanSymbol("blockSize")
-+    , NanNew<v8::String>("blockSize")
-     , 4096
-   );
-   uint32_t maxOpenFiles = NanUInt32OptionValue(
-       optionsObj
--    , NanSymbol("maxOpenFiles")
-+    , NanNew<v8::String>("maxOpenFiles")
-     , 1000
-   );
-   uint32_t blockRestartInterval = NanUInt32OptionValue(
-       optionsObj
--    , NanSymbol("blockRestartInterval")
-+    , NanNew<v8::String>("blockRestartInterval")
-     , 16
-   );
- 
-@@ -234,7 +234,7 @@ NAN_METHOD(Database::Open) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("database", _this);
-+  worker->SaveToPersistent("database", _this);
-   NanAsyncQueueWorker(worker);
- 
-   NanReturnUndefined();
-@@ -251,7 +251,7 @@ NAN_METHOD(Database::Close) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("database", _this);
-+  worker->SaveToPersistent("database", _this);
- 
-   if (!database->iterators.empty()) {
-     // yikes, we still have iterators open! naughty naughty.
-@@ -272,10 +272,10 @@ NAN_METHOD(Database::Close) {
-         // CloseWorker will be invoked
- 
-         /*
--        v8::Local<v8::Object> localHandle = NanPersistentToLocal(it->second);
-+        v8::Local<v8::Object> localHandle = NanNew(it->second);
-         leveldown::Iterator* iterator =
-             node::ObjectWrap::Unwrap<leveldown::Iterator>(localHandle->
--                Get(NanSymbol("iterator")).As<v8::Object>());
-+                Get(NanNew<v8::String>("iterator")).As<v8::Object>());
-                 */
-         leveldown::Iterator *iterator = it->second;
- 
-@@ -314,7 +314,7 @@ NAN_METHOD(Database::Put) {
-   LD_STRING_OR_BUFFER_TO_SLICE(key, keyHandle, key)
-   LD_STRING_OR_BUFFER_TO_SLICE(value, valueHandle, value)
- 
--  bool sync = NanBooleanOptionValue(optionsObj, NanSymbol("sync"));
-+  bool sync = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("sync"));
- 
-   WriteWorker* worker  = new WriteWorker(
-       database
-@@ -327,7 +327,7 @@ NAN_METHOD(Database::Put) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("database", _this);
-+  worker->SaveToPersistent("database", _this);
-   NanAsyncQueueWorker(worker);
- 
-   NanReturnUndefined();
-@@ -343,8 +343,8 @@ NAN_METHOD(Database::Get) {
-   v8::Local<v8::Object> keyHandle = args[0].As<v8::Object>();
-   LD_STRING_OR_BUFFER_TO_SLICE(key, keyHandle, key)
- 
--  bool asBuffer = NanBooleanOptionValue(optionsObj, NanSymbol("asBuffer"), true);
--  bool fillCache = NanBooleanOptionValue(optionsObj, NanSymbol("fillCache"), true);
-+  bool asBuffer = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("asBuffer"), true);
-+  bool fillCache = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("fillCache"), true);
- 
-   ReadWorker* worker = new ReadWorker(
-       database
-@@ -356,7 +356,7 @@ NAN_METHOD(Database::Get) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("database", _this);
-+  worker->SaveToPersistent("database", _this);
-   NanAsyncQueueWorker(worker);
- 
-   NanReturnUndefined();
-@@ -372,7 +372,7 @@ NAN_METHOD(Database::Delete) {
-   v8::Local<v8::Object> keyHandle = args[0].As<v8::Object>();
-   LD_STRING_OR_BUFFER_TO_SLICE(key, keyHandle, key)
- 
--  bool sync = NanBooleanOptionValue(optionsObj, NanSymbol("sync"));
-+  bool sync = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("sync"));
- 
-   DeleteWorker* worker = new DeleteWorker(
-       database
-@@ -383,7 +383,7 @@ NAN_METHOD(Database::Delete) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("database", _this);
-+  worker->SaveToPersistent("database", _this);
-   NanAsyncQueueWorker(worker);
- 
-   NanReturnUndefined();
-@@ -402,7 +402,7 @@ NAN_METHOD(Database::Batch) {
- 
-   LD_METHOD_SETUP_COMMON(batch, 1, 2)
- 
--  bool sync = NanBooleanOptionValue(optionsObj, NanSymbol("sync"));
-+  bool sync = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("sync"));
- 
-   v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(args[0]);
- 
-@@ -415,12 +415,12 @@ NAN_METHOD(Database::Batch) {
- 
-     v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast(array->Get(i));
- 
--    LD_CB_ERR_IF_NULL_OR_UNDEFINED(obj->Get(NanSymbol("type")), type)
-+    LD_CB_ERR_IF_NULL_OR_UNDEFINED(obj->Get(NanNew<v8::String>("type")), type)
- 
--    v8::Local<v8::Value> keyBuffer = obj->Get(NanSymbol("key"));
-+    v8::Local<v8::Value> keyBuffer = obj->Get(NanNew<v8::String>("key"));
-     LD_CB_ERR_IF_NULL_OR_UNDEFINED(keyBuffer, key)
- 
--    if (obj->Get(NanSymbol("type"))->StrictEquals(NanSymbol("del"))) {
-+    if (obj->Get(NanNew<v8::String>("type"))->StrictEquals(NanNew<v8::String>("del"))) {
-       LD_STRING_OR_BUFFER_TO_SLICE(key, keyBuffer, key)
- 
-       batch->Delete(key);
-@@ -428,8 +428,8 @@ NAN_METHOD(Database::Batch) {
-         hasData = true;
- 
-       DisposeStringOrBufferFromSlice(keyBuffer, key);
--    } else if (obj->Get(NanSymbol("type"))->StrictEquals(NanSymbol("put"))) {
--      v8::Local<v8::Value> valueBuffer = obj->Get(NanSymbol("value"));
-+    } else if (obj->Get(NanNew<v8::String>("type"))->StrictEquals(NanNew<v8::String>("put"))) {
-+      v8::Local<v8::Value> valueBuffer = obj->Get(NanNew<v8::String>("value"));
-       LD_CB_ERR_IF_NULL_OR_UNDEFINED(valueBuffer, value)
- 
-       LD_STRING_OR_BUFFER_TO_SLICE(key, keyBuffer, key)
-@@ -454,7 +454,7 @@ NAN_METHOD(Database::Batch) {
-     );
-     // persist to prevent accidental GC
-     v8::Local<v8::Object> _this = args.This();
--    worker->SavePersistent("database", _this);
-+    worker->SaveToPersistent("database", _this);
-     NanAsyncQueueWorker(worker);
-   } else {
-     LD_RUN_CALLBACK(callback, 0, NULL);
-@@ -497,7 +497,7 @@ NAN_METHOD(Database::ApproximateSize) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("database", _this);
-+  worker->SaveToPersistent("database", _this);
-   NanAsyncQueueWorker(worker);
- 
-   NanReturnUndefined();
-@@ -560,7 +560,7 @@ NAN_METHOD(Database::Iterator) {
-   // register our iterator
-   /*
-   v8::Local<v8::Object> obj = v8::Object::New();
--  obj->Set(NanSymbol("iterator"), iteratorHandle);
-+  obj->Set(NanNew<v8::String>("iterator"), iteratorHandle);
-   v8::Persistent<v8::Object> persistent;
-   persistent.Reset(nan_isolate, obj);
-   database->iterators.insert(std::pair< uint32_t, v8::Persistent<v8::Object> & >
---- node-leveldown-0.10.2.orig/src/database.h
-+++ node-leveldown-0.10.2/src/database.h
-@@ -25,8 +25,8 @@ struct Reference {
- 
-   Reference(v8::Local<v8::Value> obj, leveldb::Slice slice) : slice(slice) {
-     v8::Local<v8::Object> _obj = v8::Object::New();
--    _obj->Set(NanSymbol("obj"), obj);
--    NanAssignPersistent(v8::Object, handle, _obj);
-+    _obj->Set(NanNew<v8::String>("obj"), obj);
-+    NanAssignPersistent(handle, _obj);
-   };
- };
- 
---- node-leveldown-0.10.2.orig/src/database_async.cc
-+++ node-leveldown-0.10.2/src/database_async.cc
-@@ -86,7 +86,7 @@ IOWorker::IOWorker (
- {
-   NanScope();
- 
--  SavePersistent("key", keyHandle);
-+  SaveToPersistent("key", keyHandle);
- };
- 
- IOWorker::~IOWorker () {}
-@@ -114,7 +114,7 @@ ReadWorker::ReadWorker (
- 
-   options = new leveldb::ReadOptions();
-   options->fill_cache = fillCache;
--  SavePersistent("key", keyHandle);
-+  SaveToPersistent("key", keyHandle);
- };
- 
- ReadWorker::~ReadWorker () {
-@@ -135,7 +135,7 @@ void ReadWorker::HandleOKCallback () {
-     returnValue = v8::String::New((char*)value.data(), value.size());
-   }
-   v8::Local<v8::Value> argv[] = {
--      NanNewLocal<v8::Value>(v8::Null())
-+      NanNew(v8::Null())
-     , returnValue
-   };
-   callback->Call(2, argv);
-@@ -155,7 +155,7 @@ DeleteWorker::DeleteWorker (
- 
-   options = new leveldb::WriteOptions();
-   options->sync = sync;
--  SavePersistent("key", keyHandle);
-+  SaveToPersistent("key", keyHandle);
- };
- 
- DeleteWorker::~DeleteWorker () {
-@@ -181,7 +181,7 @@ WriteWorker::WriteWorker (
- {
-   NanScope();
- 
--  SavePersistent("value", valueHandle);
-+  SaveToPersistent("value", valueHandle);
- };
- 
- WriteWorker::~WriteWorker () {}
-@@ -236,8 +236,8 @@ ApproximateSizeWorker::ApproximateSizeWo
- {
-   NanScope();
- 
--  SavePersistent("start", startHandle);
--  SavePersistent("end", endHandle);
-+  SaveToPersistent("start", startHandle);
-+  SaveToPersistent("end", endHandle);
- };
- 
- ApproximateSizeWorker::~ApproximateSizeWorker () {}
-@@ -259,7 +259,7 @@ void ApproximateSizeWorker::HandleOKCall
- 
-   v8::Local<v8::Value> returnValue = v8::Number::New((double) size);
-   v8::Local<v8::Value> argv[] = {
--      NanNewLocal<v8::Value>(v8::Null())
-+      NanNew(v8::Null())
-     , returnValue
-   };
-   callback->Call(2, argv);
---- node-leveldown-0.10.2.orig/src/iterator.cc
-+++ node-leveldown-0.10.2/src/iterator.cc
-@@ -50,8 +50,8 @@ Iterator::Iterator (
- 
-   v8::Local<v8::Object> obj = v8::Object::New();
-   if (!startHandle.IsEmpty())
--    obj->Set(NanSymbol("start"), startHandle);
--  NanAssignPersistent(v8::Object, persistentHandle, obj);
-+    obj->Set(NanNew<v8::String>("start"), startHandle);
-+  NanAssignPersistent(persistentHandle, obj);
- 
-   options    = new leveldb::ReadOptions();
-   options->fill_cache = fillCache;
-@@ -65,7 +65,7 @@ Iterator::Iterator (
- Iterator::~Iterator () {
-   delete options;
-   if (!persistentHandle.IsEmpty())
--    NanDispose(persistentHandle);
-+    NanDisposePersistent(persistentHandle);
-   if (start != NULL)
-     delete start;
-   if (end != NULL)
-@@ -201,7 +201,7 @@ NAN_METHOD(Iterator::Next) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("iterator", _this);
-+  worker->SaveToPersistent("iterator", _this);
-   iterator->nexting = true;
-   NanAsyncQueueWorker(worker);
- 
-@@ -228,7 +228,7 @@ NAN_METHOD(Iterator::End) {
-   );
-   // persist to prevent accidental GC
-   v8::Local<v8::Object> _this = args.This();
--  worker->SavePersistent("iterator", _this);
-+  worker->SaveToPersistent("iterator", _this);
-   iterator->ended = true;
- 
-   if (iterator->nexting) {
-@@ -244,8 +244,8 @@ NAN_METHOD(Iterator::End) {
- void Iterator::Init () {
-   v8::Local<v8::FunctionTemplate> tpl =
-       v8::FunctionTemplate::New(Iterator::New);
--  NanAssignPersistent(v8::FunctionTemplate, iterator_constructor, tpl);
--  tpl->SetClassName(NanSymbol("Iterator"));
-+  NanAssignPersistent(iterator_constructor, tpl);
-+  tpl->SetClassName(NanNew<v8::String>("Iterator"));
-   tpl->InstanceTemplate()->SetInternalFieldCount(1);
-   NODE_SET_PROTOTYPE_METHOD(tpl, "next", Iterator::Next);
-   NODE_SET_PROTOTYPE_METHOD(tpl, "end", Iterator::End);
-@@ -261,7 +261,7 @@ v8::Local<v8::Object> Iterator::NewInsta
- 
-   v8::Local<v8::Object> instance;
-   v8::Local<v8::FunctionTemplate> constructorHandle =
--      NanPersistentToLocal(iterator_constructor);
-+      NanNew(iterator_constructor);
- 
-   if (optionsObj.IsEmpty()) {
-     v8::Handle<v8::Value> argv[2] = { database, id };
-@@ -307,13 +307,13 @@ NAN_METHOD(Iterator::New) {
-   if (args.Length() > 1 && args[2]->IsObject()) {
-     optionsObj = v8::Local<v8::Object>::Cast(args[2]);
- 
--    reverse = NanBooleanOptionValue(optionsObj, NanSymbol("reverse"));
-+    reverse = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("reverse"));
- 
--    if (optionsObj->Has(NanSymbol("start"))
--        && (node::Buffer::HasInstance(optionsObj->Get(NanSymbol("start")))
--          || optionsObj->Get(NanSymbol("start"))->IsString())) {
-+    if (optionsObj->Has(NanNew<v8::String>("start"))
-+        && (node::Buffer::HasInstance(optionsObj->Get(NanNew<v8::String>("start")))
-+          || optionsObj->Get(NanNew<v8::String>("start"))->IsString())) {
- 
--      startHandle = optionsObj->Get(NanSymbol("start")).As<v8::Object>();
-+      startHandle = optionsObj->Get(NanNew<v8::String>("start")).As<v8::Object>();
- 
-       // ignore start if it has size 0 since a Slice can't have length 0
-       if (StringOrBufferLength(startHandle) > 0) {
-@@ -322,12 +322,12 @@ NAN_METHOD(Iterator::New) {
-       }
-     }
- 
--    if (optionsObj->Has(NanSymbol("end"))
--        && (node::Buffer::HasInstance(optionsObj->Get(NanSymbol("end")))
--          || optionsObj->Get(NanSymbol("end"))->IsString())) {
-+    if (optionsObj->Has(NanNew<v8::String>("end"))
-+        && (node::Buffer::HasInstance(optionsObj->Get(NanNew<v8::String>("end")))
-+          || optionsObj->Get(NanNew<v8::String>("end"))->IsString())) {
- 
-       v8::Local<v8::Value> endBuffer =
--          NanNewLocal<v8::Value>(optionsObj->Get(NanSymbol("end")));
-+          NanNew(optionsObj->Get(NanNew<v8::String>("end")));
- 
-       // ignore end if it has size 0 since a Slice can't have length 0
-       if (StringOrBufferLength(endBuffer) > 0) {
-@@ -336,17 +336,17 @@ NAN_METHOD(Iterator::New) {
-       }
-     }
- 
--    if (!optionsObj.IsEmpty() && optionsObj->Has(NanSymbol("limit"))) {
-+    if (!optionsObj.IsEmpty() && optionsObj->Has(NanNew<v8::String>("limit"))) {
-       limit = v8::Local<v8::Integer>::Cast(optionsObj->Get(
--          NanSymbol("limit")))->Value();
-+          NanNew<v8::String>("limit")))->Value();
-     }
- 
--    if (optionsObj->Has(NanSymbol("lt"))
--        && (node::Buffer::HasInstance(optionsObj->Get(NanSymbol("lt")))
--          || optionsObj->Get(NanSymbol("lt"))->IsString())) {
-+    if (optionsObj->Has(NanNew<v8::String>("lt"))
-+        && (node::Buffer::HasInstance(optionsObj->Get(NanNew<v8::String>("lt")))
-+          || optionsObj->Get(NanNew<v8::String>("lt"))->IsString())) {
- 
-       v8::Local<v8::Value> ltBuffer =
--          NanNewLocal<v8::Value>(optionsObj->Get(NanSymbol("lt")));
-+          NanNew(optionsObj->Get(NanNew<v8::String>("lt")));
- 
-       // ignore end if it has size 0 since a Slice can't have length 0
-       if (StringOrBufferLength(ltBuffer) > 0) {
-@@ -357,12 +357,12 @@ NAN_METHOD(Iterator::New) {
-       }
-     }
- 
--    if (optionsObj->Has(NanSymbol("lte"))
--        && (node::Buffer::HasInstance(optionsObj->Get(NanSymbol("lte")))
--          || optionsObj->Get(NanSymbol("lte"))->IsString())) {
-+    if (optionsObj->Has(NanNew<v8::String>("lte"))
-+        && (node::Buffer::HasInstance(optionsObj->Get(NanNew<v8::String>("lte")))
-+          || optionsObj->Get(NanNew<v8::String>("lte"))->IsString())) {
- 
-       v8::Local<v8::Value> lteBuffer =
--          NanNewLocal<v8::Value>(optionsObj->Get(NanSymbol("lte")));
-+          NanNew(optionsObj->Get(NanNew<v8::String>("lte")));
- 
-       // ignore end if it has size 0 since a Slice can't have length 0
-       if (StringOrBufferLength(lteBuffer) > 0) {
-@@ -373,12 +373,12 @@ NAN_METHOD(Iterator::New) {
-       }
-     }
- 
--    if (optionsObj->Has(NanSymbol("gt"))
--        && (node::Buffer::HasInstance(optionsObj->Get(NanSymbol("gt")))
--          || optionsObj->Get(NanSymbol("gt"))->IsString())) {
-+    if (optionsObj->Has(NanNew<v8::String>("gt"))
-+        && (node::Buffer::HasInstance(optionsObj->Get(NanNew<v8::String>("gt")))
-+          || optionsObj->Get(NanNew<v8::String>("gt"))->IsString())) {
- 
-       v8::Local<v8::Value> gtBuffer =
--          NanNewLocal<v8::Value>(optionsObj->Get(NanSymbol("gt")));
-+          NanNew(optionsObj->Get(NanNew<v8::String>("gt")));
- 
-       // ignore end if it has size 0 since a Slice can't have length 0
-       if (StringOrBufferLength(gtBuffer) > 0) {
-@@ -389,12 +389,12 @@ NAN_METHOD(Iterator::New) {
-       }
-     }
- 
--    if (optionsObj->Has(NanSymbol("gte"))
--        && (node::Buffer::HasInstance(optionsObj->Get(NanSymbol("gte")))
--          || optionsObj->Get(NanSymbol("gte"))->IsString())) {
-+    if (optionsObj->Has(NanNew<v8::String>("gte"))
-+        && (node::Buffer::HasInstance(optionsObj->Get(NanNew<v8::String>("gte")))
-+          || optionsObj->Get(NanNew<v8::String>("gte"))->IsString())) {
- 
-       v8::Local<v8::Value> gteBuffer =
--          NanNewLocal<v8::Value>(optionsObj->Get(NanSymbol("gte")));
-+          NanNew(optionsObj->Get(NanNew<v8::String>("gte")));
- 
-       // ignore end if it has size 0 since a Slice can't have length 0
-       if (StringOrBufferLength(gteBuffer) > 0) {
-@@ -407,19 +407,19 @@ NAN_METHOD(Iterator::New) {
- 
-   }
- 
--  bool keys = NanBooleanOptionValue(optionsObj, NanSymbol("keys"), true);
--  bool values = NanBooleanOptionValue(optionsObj, NanSymbol("values"), true);
-+  bool keys = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("keys"), true);
-+  bool values = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("values"), true);
-   bool keyAsBuffer = NanBooleanOptionValue(
-       optionsObj
--    , NanSymbol("keyAsBuffer")
-+    , NanNew<v8::String>("keyAsBuffer")
-     , true
-   );
-   bool valueAsBuffer = NanBooleanOptionValue(
-       optionsObj
--    , NanSymbol("valueAsBuffer")
-+    , NanNew<v8::String>("valueAsBuffer")
-     , true
-   );
--  bool fillCache = NanBooleanOptionValue(optionsObj, NanSymbol("fillCache"));
-+  bool fillCache = NanBooleanOptionValue(optionsObj, NanNew<v8::String>("fillCache"));
- 
-   Iterator* iterator = new Iterator(
-       database
---- node-leveldown-0.10.2.orig/src/iterator_async.cc
-+++ node-leveldown-0.10.2/src/iterator_async.cc
-@@ -54,7 +54,7 @@ void NextWorker::HandleOKCallback () {
- 
-   if (ok) {
-     v8::Local<v8::Value> argv[] = {
--        NanNewLocal<v8::Value>(v8::Null())
-+        NanNew(v8::Null())
-       , returnKey
-       , returnValue
-     };
---- node-leveldown-0.10.2.orig/src/leveldown.cc
-+++ node-leveldown-0.10.2/src/leveldown.cc
-@@ -28,7 +28,7 @@ NAN_METHOD(DestroyDB) {
-     return NanThrowError("destroy() requires a callback function argument");
-   }
- 
--  char* location = NanFromV8String(args[0].As<v8::Object>(), Nan::UTF8, NULL, NULL, 0, v8::String::NO_OPTIONS);
-+  char* location = (char*)NanRawString(args[0], Nan::UTF8, NULL, NULL, 0, v8::String::NO_OPTIONS);
- 
-   NanCallback* callback = new NanCallback(
-       v8::Local<v8::Function>::Cast(args[1]));
-@@ -58,7 +58,7 @@ NAN_METHOD(RepairDB) {
-     return NanThrowError("repair() requires a callback function argument");
-   }
- 
--  char* location = NanFromV8String(args[0].As<v8::Object>(), Nan::UTF8, NULL, NULL, 0, v8::String::NO_OPTIONS);
-+  char* location = (char*) NanRawString(args[0], Nan::UTF8, NULL, NULL, 0, v8::String::NO_OPTIONS);
- 
-  NanCallback* callback = new NanCallback(
-       v8::Local<v8::Function>::Cast(args[1]));
-@@ -82,16 +82,16 @@ void Init (v8::Handle<v8::Object> target
-       v8::FunctionTemplate::New(LevelDOWN)->GetFunction();
- 
-   leveldown->Set(
--      NanSymbol("destroy")
-+      NanNew<v8::String>("destroy")
-     , v8::FunctionTemplate::New(DestroyDB)->GetFunction()
-   );
- 
-   leveldown->Set(
--      NanSymbol("repair")
-+      NanNew<v8::String>("repair")
-     , v8::FunctionTemplate::New(RepairDB)->GetFunction()
-   );
- 
--  target->Set(NanSymbol("leveldown"), leveldown);
-+  target->Set(NanNew<v8::String>("leveldown"), leveldown);
- }
- 
- NODE_MODULE(leveldown, Init)
---- node-leveldown-0.10.2.orig/src/leveldown.h
-+++ node-leveldown-0.10.2/src/leveldown.h
-@@ -23,9 +23,9 @@ static inline void DisposeStringOrBuffer
-         v8::Persistent<v8::Object> &handle
-       , leveldb::Slice slice) {
- 
--  if (!node::Buffer::HasInstance(NanPersistentToLocal(handle)->Get(NanSymbol("obj"))))
-+  if (!node::Buffer::HasInstance(NanNew(handle)->Get(NanNew<v8::String>("obj"))))
-     delete[] slice.data();
--  NanDispose(handle);
-+  NanDisposePersistent(handle);
- }
- 
- static inline void DisposeStringOrBufferFromSlice(
-@@ -69,7 +69,7 @@ static inline void DisposeStringOrBuffer
- #define LD_RETURN_CALLBACK_OR_ERROR(callback, msg)                             \
-   if (!callback.IsEmpty() && callback->IsFunction()) {                         \
-     v8::Local<v8::Value> argv[] = {                                            \
--      NanNewLocal<v8::Value>(v8::Exception::Error(                          \
-+      NanNew(v8::Exception::Error(                          \
-         v8::String::New(msg))                                                  \
-       )                                                                        \
-     };                                                                         \

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



More information about the Pkg-javascript-commits mailing list