We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 429cce2 commit accaa71Copy full SHA for accaa71
node-syscall/syscall.cc
@@ -25,17 +25,7 @@ intptr_t toNative(Local<Value> value) {
25
Local<Array> array = Local<Array>::Cast(value);
26
intptr_t* native = reinterpret_cast<intptr_t*>(malloc(array->Length() * sizeof(intptr_t))); // TODO memory leak
27
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
+ native[i] = toNative(array->Get(i));
39
}
40
return reinterpret_cast<intptr_t>(native);
41
0 commit comments