| 893 | } |
| 894 | |
| 895 | static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) { |
| 896 | HandleScope scope; |
| 897 | |
| 898 | if (!NodeRT::Utils::IsWinRtWrapperOf< |
| 899 | ::Windows::Foundation::Collections::IVector<T> ^>(info.This())) { |
| 900 | return; |
| 901 | } |
| 902 | |
| 903 | VectorWrapper<T>* wrapper = |
| 904 | VectorWrapper<T>::Unwrap<VectorWrapper<T>>(info.This()); |
| 905 | |
| 906 | if (info.Length() == 0) { |
| 907 | try { |
| 908 | wrapper->_instance->Clear(); |
| 909 | } catch (Platform::Exception ^ exception) { |
| 910 | NodeRT::Utils::ThrowWinRtExceptionInJs(exception); |
| 911 | return; |
| 912 | } |
| 913 | } else { |
| 914 | Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString( |
| 915 | L"Bad arguments: no suitable overload found"))); |
| 916 | return; |
| 917 | } |
| 918 | |
| 919 | return; |
| 920 | } |
| 921 | |
| 922 | static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) { |
| 923 | HandleScope scope; |