| 182 | // assumption: vec length >= arr length |
| 183 | template <class T, class V> |
| 184 | static bool FillVector( |
| 185 | v8::Local<v8::Array> arr, |
| 186 | const std::function<bool(v8::Local<v8::Value>)>& checkValueTypeFunc, |
| 187 | const std::function<V(v8::Local<v8::Value>)>& convertToValueTypeFunc, |
| 188 | T vec) { |
| 189 | for (uint32_t i = 0; i < arr->Length(); i++) { |
| 190 | Local<Value> value = Nan::Get(arr, i).ToLocalChecked(); |
| 191 | |
| 192 | if (!checkValueTypeFunc(value)) { |
| 193 | Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString( |
| 194 | L"Received array with unexpected value type"))); |
| 195 | return false; |
| 196 | } |
| 197 | |
| 198 | InsertToVector(i, value, convertToValueTypeFunc, vec); |
| 199 | } |
| 200 | |
| 201 | return true; |
| 202 | } |
| 203 | |
| 204 | template <class K, class V> |
| 205 | static bool FillMapFromJsArray( |
nothing calls this directly
no test coverage detected