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

Method HasKey

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:1456–1486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454 }
1455
1456 static void HasKey(Nan::NAN_METHOD_ARGS_TYPE info) {
1457 HandleScope scope;
1458
1459 if (!NodeRT::Utils::IsWinRtWrapperOf<
1460 ::Windows::Foundation::Collections::IMapView<K, V> ^>(
1461 info.This())) {
1462 return;
1463 }
1464
1465 MapViewWrapper<K, V>* wrapper =
1466 MapViewWrapper<K, V>::Unwrap<MapViewWrapper<K, V>>(info.This());
1467
1468 if (info.Length() == 1 && wrapper->_checkKeyTypeFunc(info[0])) {
1469 try {
1470 K key = wrapper->_convertToKeyTypeFunc(info[0]);
1471
1472 bool result = wrapper->_instance->HasKey(key);
1473
1474 info.GetReturnValue().Set(Nan::New<Boolean>(result));
1475 } catch (Platform::Exception ^ exception) {
1476 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
1477 return;
1478 }
1479 } else {
1480 Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(
1481 L"Bad arguments: no suitable overload found")));
1482 return;
1483 }
1484
1485 return;
1486 }
1487
1488 static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
1489 HandleScope scope;

Callers

nothing calls this directly

Calls 3

NewStringFunction · 0.85
HasKeyMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected