0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00

src: replace array implementation

replace with C++ API.

Refs: https://github.com/nodejs/node/pull/24125
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
kazuya kawaguchi 2018-11-24 16:54:24 +09:00 committed by Gireesh Punathil
parent aa0c22c42d
commit 4d3ee7533d

View File

@ -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