Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 622af71

Browse files
author
Dane Springmeyer
committed
by convention HandleScopes at top of function
1 parent 849f45c commit 622af71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/handler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,19 @@ namespace node_osmium {
155155

156156
template <class TWrapped>
157157
void call_callback_with_entity(const Nan::Persistent<v8::Function>& function, const osmium::OSMEntity& entity) {
158+
Nan::HandleScope scope;
158159
if (function.IsEmpty()) {
159160
return;
160161
}
161-
Nan::HandleScope scope;
162162
v8::Local<v8::Value> argv[1] = { new_external<TWrapped>(entity) };
163163
Nan::New(function)->Call(Nan::GetCurrentContext()->Global(), 1, argv);
164164
}
165165

166166
void call_callback(const Nan::Persistent<v8::Function>& function) {
167+
Nan::HandleScope scope;
167168
if (function.IsEmpty()) {
168169
return;
169170
}
170-
Nan::HandleScope scope;
171171
Nan::New(function)->Call(Nan::GetCurrentContext()->Global(), 0, nullptr);
172172
}
173173

0 commit comments

Comments
 (0)