Skip to content

Commit dca1ecf

Browse files
kazuponrvagg
authored andcommitted
src: replace array implementation
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>
1 parent b7aa312 commit dca1ecf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/uv.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ void Initialize(Local<Object> target,
7676
Local<Map> err_map = Map::New(isolate);
7777

7878
#define V(name, msg) do { \
79-
Local<Array> arr = Array::New(isolate, 2); \
80-
arr->Set(env->context(), 0, OneByteString(isolate, #name)).FromJust(); \
81-
arr->Set(env->context(), 1, OneByteString(isolate, msg)).FromJust(); \
79+
Local<Value> arr[] = { \
80+
OneByteString(isolate, #name), \
81+
OneByteString(isolate, msg) \
82+
}; \
8283
err_map->Set(context, \
8384
Integer::New(isolate, UV_##name), \
84-
arr).ToLocalChecked(); \
85+
Array::New(isolate, arr, arraysize(arr))).ToLocalChecked(); \
8586
} while (0);
8687
UV_ERRNO_MAP(V)
8788
#undef V

0 commit comments

Comments
 (0)