MCPcopy Create free account
hub / github.com/NativeScript/android / CreateArrayWrapper

Method CreateArrayWrapper

test-app/runtime/src/main/cpp/MetadataNode.cpp:216–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216Local<Object> MetadataNode::CreateArrayWrapper(Isolate* isolate) {
217 auto node = GetOrCreate("java/lang/Object");
218 auto ctorFunc = node->GetConstructorFunction(isolate);
219
220 auto arrayObjectTemplate = GetOrCreateArrayObjectTemplate(isolate);
221
222 auto context = isolate->GetCurrentContext();
223 auto arr = arrayObjectTemplate->NewInstance(context).ToLocalChecked();
224 arr->SetPrototype(context, ctorFunc->Get(context, V8StringConstants::GetPrototype(isolate)).ToLocalChecked());
225 arr->SetAccessor(context, ArgConverter::ConvertToV8String(isolate, "length"), ArrayLengthGetterCallack, nullptr, Local<Value>(), AccessControl::ALL_CAN_READ, PropertyAttribute::DontDelete);
226
227 SetInstanceMetadata(isolate, arr, this);
228
229 return arr;
230}
231
232Local<Object> MetadataNode::CreatePackageObject(Isolate* isolate) {
233 auto packageObj = Object::New(isolate);

Callers

nothing calls this directly

Calls 3

ToLocalCheckedMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected