MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / Clear

Method Clear

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:895–920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 2

NewStringFunction · 0.85
ClearMethod · 0.45

Tested by

no test coverage detected