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

Method CurrentGetter

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:310–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308 }
309
310 static void CurrentGetter(Local<String> property,
311 const Nan::PropertyCallbackInfo<v8::Value>& info) {
312 HandleScope scope;
313 if (!NodeRT::Utils::IsWinRtWrapperOf<
314 ::Windows::Foundation::Collections::IIterator<T> ^>(info.This())) {
315 return;
316 }
317
318 IteratorWrapper<T>* wrapper =
319 IteratorWrapper<T>::Unwrap<IteratorWrapper<T>>(info.This());
320
321 try {
322 T current = wrapper->_instance->Current;
323
324 if (wrapper->_getterFunc != nullptr) {
325 info.GetReturnValue().Set(wrapper->_getterFunc(current));
326 } else {
327 info.GetReturnValue().Set(CreateOpaqueWrapper(current));
328 }
329 } catch (Platform::Exception ^ exception) {
330 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
331 return;
332 }
333 }
334
335 static void HasCurrentGetter(
336 Local<String> property,

Callers

nothing calls this directly

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected