| 864 | } |
| 865 | |
| 866 | static void Append(Nan::NAN_METHOD_ARGS_TYPE info) { |
| 867 | HandleScope scope; |
| 868 | |
| 869 | if (!NodeRT::Utils::IsWinRtWrapperOf< |
| 870 | ::Windows::Foundation::Collections::IVector<T> ^>(info.This())) { |
| 871 | return; |
| 872 | } |
| 873 | |
| 874 | VectorWrapper<T>* wrapper = |
| 875 | VectorWrapper<T>::Unwrap<VectorWrapper<T>>(info.This()); |
| 876 | |
| 877 | if (info.Length() == 1 && wrapper->_checkTypeFunc(info[0])) { |
| 878 | try { |
| 879 | T value = wrapper->_convertToTypeFunc(info[0]); |
| 880 | |
| 881 | wrapper->_instance->Append(value); |
| 882 | } catch (Platform::Exception ^ exception) { |
| 883 | NodeRT::Utils::ThrowWinRtExceptionInJs(exception); |
| 884 | return; |
| 885 | } |
| 886 | } else { |
| 887 | Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString( |
| 888 | L"Bad arguments: no suitable overload found"))); |
| 889 | return; |
| 890 | } |
| 891 | |
| 892 | return; |
| 893 | } |
| 894 | |
| 895 | static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) { |
| 896 | HandleScope scope; |
no test coverage detected