| 585 | if (!local->IsObject()) { |
| 586 | exceptionTracker.onError("Cannot getObject property on non object value"); |
| 587 | return JSValueRef(); |
| 588 | } |
| 589 | |
| 590 | v8::Local<v8::Context> context = v8::Local<v8::Context>::New(_isolate, _context); |
| 591 | auto val = v8::Local<v8::Object>::Cast(local); |
| 592 | |
| 593 | v8::Local<v8::Value> retval; |
| 594 | if (!val->Get(context, static_cast<uint32_t>(index)).ToLocal(&retval)) { |
| 595 | exceptionTracker.onError("Failed to fetch object at requested index"); |
| 596 | return JSValueRef(); |
| 597 | } |
| 598 | |
| 599 | return toRetainedJSValueRef(IndirectV8Persistent::make(_isolate, retval)); |
| 600 | } |
| 601 | |
| 602 | bool V8JavaScriptContext::hasObjectProperty(const JSValue& object, const JSPropertyName& propertyName) { |
| 603 | v8::HandleScope handleScope(_isolate); |
| 604 | JSExceptionTracker tracker(*this); |
| 605 | |
| 606 | auto obj = v8::Local<v8::Object>::Cast(fromValdiJSValue(_isolate, object, tracker)); |
| 607 | if (!tracker) { |
| 608 | tracker.clearError(); |
| 609 | return false; |
| 610 | } |
| 611 | |
| 612 | if (!obj->IsObject()) { |
no test coverage detected