| 616 | } |
| 617 | |
| 618 | static void First(Nan::NAN_METHOD_ARGS_TYPE info) { |
| 619 | HandleScope scope; |
| 620 | |
| 621 | if (!NodeRT::Utils::IsWinRtWrapperOf< |
| 622 | ::Windows::Foundation::Collections::IVectorView<T> ^>( |
| 623 | info.This())) { |
| 624 | return; |
| 625 | } |
| 626 | |
| 627 | VectorViewWrapper<T>* wrapper = |
| 628 | VectorViewWrapper<T>::Unwrap<VectorViewWrapper<T>>(info.This()); |
| 629 | |
| 630 | if (info.Length() == 0) { |
| 631 | try { |
| 632 | info.GetReturnValue().Set(IteratorWrapper<T>::CreateIteratorWrapper( |
| 633 | wrapper->_instance->First(), wrapper->_getterFunc)); |
| 634 | } catch (Platform::Exception ^ exception) { |
| 635 | NodeRT::Utils::ThrowWinRtExceptionInJs(exception); |
| 636 | return; |
| 637 | } |
| 638 | } else { |
| 639 | Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString( |
| 640 | L"Bad arguments: no suitable overload found"))); |
| 641 | return; |
| 642 | } |
| 643 | |
| 644 | return; |
| 645 | } |
| 646 | |
| 647 | static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) { |
| 648 | HandleScope scope; |