Skip to content

Commit

Permalink
replace missing Handle<...> with Local<...>
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Aug 6, 2015
1 parent b7272db commit 89df0bd
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions src/batch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ NAN_METHOD(Batch::New) {
info.GetReturnValue().Set(info.This());
}

v8::Handle<v8::Value> Batch::NewInstance (
v8::Handle<v8::Object> database
, v8::Handle<v8::Object> optionsObj
v8::Local<v8::Value> Batch::NewInstance (
v8::Local<v8::Object> database
, v8::Local<v8::Object> optionsObj
) {

Nan::EscapableHandleScope scope;
Expand All @@ -67,10 +67,10 @@ v8::Handle<v8::Value> Batch::NewInstance (
Nan::New<v8::FunctionTemplate>(batch_constructor);

if (optionsObj.IsEmpty()) {
v8::Handle<v8::Value> argv[1] = { database };
v8::Local<v8::Value> argv[1] = { database };
instance = constructorHandle->GetFunction()->NewInstance(1, argv);
} else {
v8::Handle<v8::Value> argv[2] = { database, optionsObj };
v8::Local<v8::Value> argv[2] = { database, optionsObj };
instance = constructorHandle->GetFunction()->NewInstance(2, argv);
}

Expand All @@ -79,7 +79,7 @@ v8::Handle<v8::Value> Batch::NewInstance (

NAN_METHOD(Batch::Put) {
Batch* batch = ObjectWrap::Unwrap<Batch>(info.Holder());
v8::Handle<v8::Function> callback; // purely for the error macros
v8::Local<v8::Function> callback; // purely for the error macros

v8::Local<v8::Value> keyBuffer = info[0];
v8::Local<v8::Value> valueBuffer = info[1];
Expand All @@ -99,7 +99,7 @@ NAN_METHOD(Batch::Put) {
NAN_METHOD(Batch::Del) {
Batch* batch = ObjectWrap::Unwrap<Batch>(info.Holder());

v8::Handle<v8::Function> callback; // purely for the error macros
v8::Local<v8::Function> callback; // purely for the error macros

v8::Local<v8::Value> keyBuffer = info[0];
LD_STRING_OR_BUFFER_TO_SLICE(key, keyBuffer, key)
Expand Down
6 changes: 3 additions & 3 deletions src/batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ namespace leveldown {
class Batch : public Nan::ObjectWrap {
public:
static void Init();
static v8::Handle<v8::Value> NewInstance (
v8::Handle<v8::Object> database
, v8::Handle<v8::Object> optionsObj
static v8::Local<v8::Value> NewInstance (
v8::Local<v8::Object> database
, v8::Local<v8::Object> optionsObj
);

Batch (leveldown::Database* database, bool sync);
Expand Down
4 changes: 2 additions & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace leveldown {
NAN_INLINE bool BooleanOptionValue(v8::Local<v8::Object> options,
const char* _key,
bool def = false) {
v8::Handle<v8::String> key = Nan::New(_key).ToLocalChecked();
v8::Local<v8::String> key = Nan::New(_key).ToLocalChecked();
return !options.IsEmpty()
&& options->Has(key)
? options->Get(key)->BooleanValue()
Expand All @@ -23,7 +23,7 @@ NAN_INLINE bool BooleanOptionValue(v8::Local<v8::Object> options,
NAN_INLINE uint32_t UInt32OptionValue(v8::Local<v8::Object> options,
const char* _key,
uint32_t def) {
v8::Handle<v8::String> key = Nan::New(_key).ToLocalChecked();
v8::Local<v8::String> key = Nan::New(_key).ToLocalChecked();
return !options.IsEmpty()
&& options->Has(key)
&& options->Get(key)->IsNumber()
Expand Down
6 changes: 3 additions & 3 deletions src/database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace leveldown {

static Nan::Persistent<v8::FunctionTemplate> database_constructor;

Database::Database (const v8::Handle<v8::Value>& from)
Database::Database (const v8::Local<v8::Value>& from)
: location(new Nan::Utf8String(from))
, db(NULL)
, currentIteratorId(0)
Expand Down Expand Up @@ -154,15 +154,15 @@ NAN_METHOD(Database::New) {
info.GetReturnValue().Set(info.This());
}

v8::Handle<v8::Value> Database::NewInstance (v8::Local<v8::String> &location) {
v8::Local<v8::Value> Database::NewInstance (v8::Local<v8::String> &location) {
Nan::EscapableHandleScope scope;

v8::Local<v8::Object> instance;

v8::Local<v8::FunctionTemplate> constructorHandle =
Nan::New<v8::FunctionTemplate>(database_constructor);

v8::Handle<v8::Value> argv[] = { location };
v8::Local<v8::Value> argv[] = { location };
instance = constructorHandle->GetFunction()->NewInstance(1, argv);

return scope.Escape(instance);
Expand Down
4 changes: 2 additions & 2 deletions src/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static inline void ClearReferences (std::vector<Reference *> *references) {
class Database : public Nan::ObjectWrap {
public:
static void Init ();
static v8::Handle<v8::Value> NewInstance (v8::Local<v8::String> &location);
static v8::Local<v8::Value> NewInstance (v8::Local<v8::String> &location);

leveldb::Status OpenDatabase (leveldb::Options* options);
leveldb::Status PutToDatabase (
Expand Down Expand Up @@ -75,7 +75,7 @@ class Database : public Nan::ObjectWrap {
void CloseDatabase ();
void ReleaseIterator (uint32_t id);

Database (const v8::Handle<v8::Value>& from);
Database (const v8::Local<v8::Value>& from);
~Database ();

private:
Expand Down
6 changes: 3 additions & 3 deletions src/iterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ v8::Local<v8::Object> Iterator::NewInstance (
Nan::New<v8::FunctionTemplate>(iterator_constructor);

if (optionsObj.IsEmpty()) {
v8::Handle<v8::Value> argv[2] = { database, id };
v8::Local<v8::Value> argv[2] = { database, id };
instance = constructorHandle->GetFunction()->NewInstance(2, argv);
} else {
v8::Handle<v8::Value> argv[3] = { database, id, optionsObj };
v8::Local<v8::Value> argv[3] = { database, id, optionsObj };
instance = constructorHandle->GetFunction()->NewInstance(3, argv);
}

Expand All @@ -331,7 +331,7 @@ NAN_METHOD(Iterator::New) {
Database* database = Nan::ObjectWrap::Unwrap<Database>(info[0]->ToObject());

//TODO: remove this, it's only here to make LD_STRING_OR_BUFFER_TO_SLICE happy
v8::Handle<v8::Function> callback;
v8::Local<v8::Function> callback;

v8::Local<v8::Object> startHandle;
leveldb::Slice* start = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/leveldown.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ NAN_METHOD(RepairDB) {
info.GetReturnValue().SetUndefined();
}

void Init (v8::Handle<v8::Object> target) {
void Init (v8::Local<v8::Object> target) {
Database::Init();
leveldown::Iterator::Init();
leveldown::Batch::Init();
Expand Down

0 comments on commit 89df0bd

Please sign in to comment.