mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05: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:
1 parent
b7aa312672
commit
dca1ecffbd
1 file changed
+5
-4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user