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

Method LengthGetter

src/NodeRTLib/ProjectFiles/CollectionsWrap.h:116–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected