| 61 | |
| 62 | template <class K, class V> |
| 63 | static ::Platform::Collections::MapView<K, V> ^ |
| 64 | JsArrayToWinrtMapView( |
| 65 | v8::Local<v8::Array> arr, |
| 66 | const std::function<bool(v8::Local<v8::Value>)>& checkKeyTypeFunc, |
| 67 | const std::function<K(v8::Local<v8::Value>)>& convertToKeyTypeFunc, |
| 68 | const std::function<bool(v8::Local<v8::Value>)>& checkValueTypeFunc, |
| 69 | const std::function<V(v8::Local<v8::Value>)>& convertToValueTypeFunc) { |
| 70 | std::map<K, V> stdMap; |
| 71 | if (!FillMapFromJsArray(arr, checkKeyTypeFunc, convertToKeyTypeFunc, |
| 72 | checkValueTypeFunc, convertToValueTypeFunc, |
| 73 | stdMap)) { |
| 74 | return nullptr; |
| 75 | } |
| 76 | |
| 77 | return ref new ::Platform::Collections::MapView<K, V>(stdMap); |
| 78 | } |
| 79 | |
| 80 | // A special implementation for the case were the map's keys are strings |
| 81 | // In this case we expect a non-array JS object. |
nothing calls this directly
no test coverage detected