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