abetomo
null+****@clear*****
Tue Sep 5 11:18:05 JST 2017
abetomo 2017-09-05 11:18:05 +0900 (Tue, 05 Sep 2017) New Revision: 72c4502bd7db2fb8179eb745dd2ea428fea48196 https://github.com/nroonga/nroonga/commit/72c4502bd7db2fb8179eb745dd2ea428fea48196 Merged aa61187: Merge pull request #13 from abetomo/use_nan_helper_method Message: Fix using Nan::Persistent Modified files: src/nroonga.cc src/nroonga.h Modified: src/nroonga.cc (+3 -3) =================================================================== --- src/nroonga.cc 2017-09-05 11:15:16 +0900 (50271ac) +++ src/nroonga.cc 2017-09-05 11:18:05 +0900 (d4d8b23) @@ -6,7 +6,7 @@ namespace nroonga { using namespace v8; -static Persistent<Function> groonga_context_constructor; +Nan::Persistent<Function> groonga_context_constructor; void Database::Initialize(Handle<Object> exports) { Isolate* isolate = Isolate::GetCurrent(); @@ -20,7 +20,7 @@ void Database::Initialize(Handle<Object> exports) { NODE_SET_PROTOTYPE_METHOD(t, "commandSyncString", Database::CommandSyncString); NODE_SET_PROTOTYPE_METHOD(t, "close", Database::Close); - groonga_context_constructor.Reset(isolate, t->GetFunction()); + groonga_context_constructor.Reset(t->GetFunction()); exports->Set(String::NewFromUtf8(isolate, "Database"), t->GetFunction()); } @@ -154,7 +154,7 @@ void Database::CommandString(const FunctionCallbackInfo<Value>& args) { Baton* baton = new Baton(); baton->request.data = baton; - baton->callback.Reset(isolate, callback); + baton->callback.Reset(callback); String::Utf8Value command(args[0]->ToString()); baton->database = db->database; Modified: src/nroonga.h (+1 -1) =================================================================== --- src/nroonga.h 2017-09-05 11:15:16 +0900 (03d8152) +++ src/nroonga.h 2017-09-05 11:18:05 +0900 (add7f93) @@ -23,7 +23,7 @@ class Database : public node::ObjectWrap { struct Baton { uv_work_t request; - Persistent<Function> callback; + Nan::Persistent<Function> callback; int error; char *result; unsigned int result_length; -------------- next part -------------- HTML����������������������������... Download