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: #24125
PR-URL: #24614
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
  • Loading branch information
kazupon authored and rvagg committed Nov 28, 2018
1 parent b7aa312 commit dca1ecf
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 dca1ecf

Please sign in to comment.