| 176 | } |
| 177 | |
| 178 | Local<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 | |
| 197 | void MetadataNode::ArrayLengthGetterCallack(Local<Name> property, const PropertyCallbackInfo<Value>& info) { |
| 198 | try { |
no test coverage detected