Skip to content

Commit accaa71

Browse files
committed
Try without clone
1 parent 429cce2 commit accaa71

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

node-syscall/syscall.cc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,7 @@ intptr_t toNative(Local<Value> value) {
2525
Local<Array> array = Local<Array>::Cast(value);
2626
intptr_t* native = reinterpret_cast<intptr_t*>(malloc(array->Length() * sizeof(intptr_t))); // TODO memory leak
2727
for (uint32_t i = 0; i < array->Length(); i++) {
28-
#if (NODE_MAJOR_VERSION >= 6)
29-
Local<Value> elem = array->Get(i);
30-
if (elem->IsObject()) {
31-
Local<Object> obj = Local<Object>::Cast(elem);
32-
native[i] = toNative(obj->Clone());
33-
} else {
34-
native[i] = toNative(elem);
35-
}
36-
#else
37-
native[i] = toNative(array->CloneElementAt(i));
38-
#endif
28+
native[i] = toNative(array->Get(i));
3929
}
4030
return reinterpret_cast<intptr_t>(native);
4131
}

0 commit comments

Comments
 (0)