| 214 | } |
| 215 | |
| 216 | Local<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 | |
| 232 | Local<Object> MetadataNode::CreatePackageObject(Isolate* isolate) { |
| 233 | auto packageObj = Object::New(isolate); |
nothing calls this directly
no test coverage detected