| 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, |