Skip to content

Commit

Permalink
src: replace array implementation
Browse files Browse the repository at this point in the history
replace with C++ API.

Refs: nodejs#24125
  • Loading branch information
kazupon committed Nov 24, 2018
1 parent ce890a0 commit e7c4aa5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/uv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ void Initialize(Local<Object> target,
Local<Map> err_map = Map::New(isolate);

#define V(name, msg) do { \
Local<Array> arr = Array::New(isolate, 2); \
arr->Set(env->context(), 0, OneByteString(isolate, #name)).FromJust(); \
arr->Set(env->context(), 1, OneByteString(isolate, msg)).FromJust(); \
Local<Value> arr[] = { \
OneByteString(isolate, #name), \
OneByteString(isolate, msg) \
}; \
err_map->Set(context, \
Integer::New(isolate, UV_##name), \
arr).ToLocalChecked(); \
Array::New(isolate, arr, arraysize(arr))).ToLocalChecked(); \
} while (0);
UV_ERRNO_MAP(V)
#undef V
Expand Down

0 comments on commit e7c4aa5

Please sign in to comment.