From e7c4aa5f89f1bb97dc3dfdcf9c001adb54ba7ffd Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sat, 24 Nov 2018 16:54:24 +0900 Subject: [PATCH] src: replace array implementation replace with C++ API. Refs: https://github.com/nodejs/node/pull/24125 --- src/uv.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/uv.cc b/src/uv.cc index 5628719c784653..5405b2058a15d2 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -76,12 +76,13 @@ void Initialize(Local target, Local err_map = Map::New(isolate); #define V(name, msg) do { \ - Local arr = Array::New(isolate, 2); \ - arr->Set(env->context(), 0, OneByteString(isolate, #name)).FromJust(); \ - arr->Set(env->context(), 1, OneByteString(isolate, msg)).FromJust(); \ + Local 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