| 114 | } |
| 115 | |
| 116 | static void LengthGetter(Local<String> property, |
| 117 | const Nan::PropertyCallbackInfo<v8::Value>& info) { |
| 118 | HandleScope scope; |
| 119 | if (!NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<T> ^>(info.This())) { |
| 120 | return; |
| 121 | } |
| 122 | |
| 123 | ArrayWrapper<T>* wrapper = |
| 124 | ArrayWrapper<T>::Unwrap<ArrayWrapper<T>>(info.This()); |
| 125 | |
| 126 | try { |
| 127 | unsigned int result = wrapper->_instance->Length; |
| 128 | info.GetReturnValue().Set(Nan::New<Integer>(result)); |
| 129 | } catch (Platform::Exception ^ exception) { |
| 130 | NodeRT::Utils::ThrowWinRtExceptionInJs(exception); |
| 131 | return; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | static void Get(uint32_t index, |
| 136 | const Nan::PropertyCallbackInfo<v8::Value>& info) { |