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

Method Remove

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:1763–1790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1761 }
1762
1763 static void Remove(Nan::NAN_METHOD_ARGS_TYPE info) {
1764 HandleScope scope;
1765
1766 if (!NodeRT::Utils::IsWinRtWrapperOf<
1767 ::Windows::Foundation::Collections::IMap<K, V> ^>(info.This())) {
1768 return;
1769 }
1770
1771 MapWrapper<K, V>* wrapper =
1772 MapWrapper<K, V>::Unwrap<MapWrapper<K, V>>(info.This());
1773
1774 if (info.Length() == 1 && wrapper->_checkKeyTypeFunc(info[0])) {
1775 try {
1776 K key = wrapper->_convertToKeyTypeFunc(info[0]);
1777
1778 wrapper->_instance->Remove(key);
1779
1780 return;
1781 } catch (Platform::Exception ^ exception) {
1782 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
1783 return;
1784 }
1785 } else {
1786 Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(
1787 L"Bad arguments: no suitable overload found")));
1788 return;
1789 }
1790 }
1791
1792 static void Insert(Nan::NAN_METHOD_ARGS_TYPE info) {
1793 HandleScope scope;

Callers 5

ExecuteCommandMethod · 0.80
ToWinRTMethod · 0.80
ForEachEventMethod · 0.80
ForEachParameterMethod · 0.80
ForEachTypeMethod · 0.80

Calls 1

NewStringFunction · 0.85

Tested by

no test coverage detected