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

Method InsertAt

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:959–987  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957 }
958
959 static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
960 HandleScope scope;
961
962 if (!NodeRT::Utils::IsWinRtWrapperOf<
963 ::Windows::Foundation::Collections::IVector<T> ^>(info.This())) {
964 return;
965 }
966
967 VectorWrapper<T>* wrapper =
968 VectorWrapper<T>::Unwrap<VectorWrapper<T>>(info.This());
969
970 if (info.Length() == 2 && info[0]->IsUint32() &&
971 wrapper->_checkTypeFunc(info[1])) {
972 try {
973 unsigned int index = info[0]->Uint32Value();
974
975 T value = wrapper->_convertToTypeFunc(info[1]);
976 wrapper->_instance->InsertAt(index, value);
977 return;
978 } catch (Platform::Exception ^ exception) {
979 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
980 return;
981 }
982 } else {
983 Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(
984 L"Bad arguments: no suitable overload found")));
985 return;
986 }
987 }
988
989 static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
990 HandleScope scope;

Callers

nothing calls this directly

Calls 1

NewStringFunction · 0.85

Tested by

no test coverage detected