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

Method CreateJSWrapper

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

Source from the content-addressed store, hash-verified

176}
177
178Local<Object> MetadataNode::CreateJSWrapper(Isolate* isolate, ObjectManager* objectManager) {
179 Local<Object> obj;
180
181 if (m_isArray) {
182 obj = CreateArrayWrapper(isolate);
183 } else {
184 obj = objectManager->GetEmptyObject(isolate);
185 if (!obj.IsEmpty()) {
186 auto ctorFunc = GetConstructorFunction(isolate);
187 auto context = isolate->GetCurrentContext();
188 obj->Set(context, ArgConverter::ConvertToV8String(isolate, "constructor"), ctorFunc);
189 obj->SetPrototype(context, ctorFunc->Get(context, V8StringConstants::GetPrototype(isolate)).ToLocalChecked());
190 SetInstanceMetadata(isolate, obj, this);
191 }
192 }
193
194 return obj;
195}
196
197void MetadataNode::ArrayLengthGetterCallack(Local<Name> property, const PropertyCallbackInfo<Value>& info) {
198 try {

Callers 6

CreateJavaArrayMethod · 0.45
ConvertToJsValueMethod · 0.45
GetJavaFieldMethod · 0.45

Calls 5

GetEmptyObjectMethod · 0.80
ToLocalCheckedMethod · 0.80
IsEmptyMethod · 0.45
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected