| 1951 | } |
| 1952 | |
| 1953 | static void SizeGetter(Local<String> property, |
| 1954 | const Nan::PropertyCallbackInfo<v8::Value>& info) { |
| 1955 | HandleScope scope; |
| 1956 | if (!NodeRT::Utils::IsWinRtWrapperOf< |
| 1957 | ::Windows::Foundation::Collections::IMap<K, V> ^>(info.This())) { |
| 1958 | return; |
| 1959 | } |
| 1960 | |
| 1961 | MapWrapper<K, V>* wrapper = |
| 1962 | MapWrapper<K, V>::Unwrap<MapWrapper<K, V>>(info.This()); |
| 1963 | |
| 1964 | try { |
| 1965 | info.GetReturnValue().Set(Nan::New<Integer>(wrapper->_instance->Size)); |
| 1966 | } catch (Platform::Exception ^ exception) { |
| 1967 | NodeRT::Utils::ThrowWinRtExceptionInJs(exception); |
| 1968 | return; |
| 1969 | } |
| 1970 | } |
| 1971 | |
| 1972 | private: |
| 1973 | ::Windows::Foundation::Collections::IMap<K, V> ^ _instance; |