@@ -126,18 +126,18 @@ Napi::Array EnumerateValues(Napi::Env& env, HKEY hCurrentKey) {
126
126
{
127
127
auto text = reinterpret_cast <LPWSTR>(buffer.get ());
128
128
auto obj = CreateEntry (env, achValue, L" REG_SZ" , text, cbData);
129
- results[i] = obj;
129
+ results. Set (i, obj) ;
130
130
}
131
131
else if (lpType == REG_EXPAND_SZ)
132
132
{
133
133
auto text = reinterpret_cast <LPWSTR>(buffer.get ());
134
134
auto obj = CreateEntry (env, achValue, L" REG_EXPAND_SZ" , text, cbData);
135
- results[i] = obj;
135
+ results. Set (i, obj) ;
136
136
}
137
137
else if (lpType == REG_DWORD)
138
138
{
139
139
assert (cbData == sizeof (DWORD));
140
- results[i] = CreateEntry (env, achValue, L" REG_DWORD" , *reinterpret_cast <DWORD*>(buffer.get ()));
140
+ results. Set (i, CreateEntry (env, achValue, L" REG_DWORD" , *reinterpret_cast <DWORD*>(buffer.get () )));
141
141
}
142
142
}
143
143
else if (retCode == ERROR_NO_MORE_ITEMS)
@@ -273,7 +273,7 @@ Napi::Value EnumKeys(const Napi::CallbackInfo& info) {
273
273
auto ret = RegEnumKeyEx (hCurrentKey, i, name, &nameLen, nullptr , nullptr , nullptr , nullptr );
274
274
if (ret == ERROR_SUCCESS)
275
275
{
276
- results[i] = Napi::String::New (env, (char16_t *)name);
276
+ results. Set (i, Napi::String::New (env, (char16_t *)name) );
277
277
continue ;
278
278
}
279
279
break ; // FIXME: We should do better error handling here
0 commit comments