Skip to content

Commit cf1d7ae

Browse files
committed
node 0.10.x was broken
1 parent 5eeb061 commit cf1d7ae

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/connection.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ namespace uni {
3636
Handle<T> Deref(Persistent<T>& handle) {
3737
return Handle<T>::New(Isolate::GetCurrent(), handle);
3838
}
39+
template <class T>
40+
Local<T> HandleToLocal(Handle<T> handle) {
41+
return handle;
42+
}
3943
inline Handle<Value> BufferToHandle(BufferType buf) {
4044
return buf;
4145
}
@@ -57,6 +61,10 @@ namespace uni {
5761
Handle<T> Deref(Persistent<T>& handle) {
5862
return Local<T>::New(handle);
5963
}
64+
template <class T>
65+
Local<T> HandleToLocal(Handle<T> handle) {
66+
return Local<T>::New(handle);
67+
}
6068
inline Handle<Value> BufferToHandle(BufferType buf) {
6169
return buf->handle_;
6270
}

src/reader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ void Reader::EIO_AfterNextRows(uv_work_t* req, int status) {
120120
baton->connection->Unref();
121121
// transfer callback to local and dispose persistent handle
122122
// must be done before invoking callback because callback may set another callback into baton->callback
123-
Local<Function> cb = uni::Deref(baton->callback);
123+
Local<Function> cb = uni::HandleToLocal(uni::Deref(baton->callback));
124124
baton->callback.Dispose();
125+
baton->callback.Clear();
125126

126127
Handle<Value> argv[2];
127128
Connection::handleResult(baton, argv);

0 commit comments

Comments
 (0)