| 559 | } |
| 560 | |
| 561 | JSValueRef V8JavaScriptContext::getObjectPropertyForIndex(const JSValue& object, |
| 562 | size_t index, |
| 563 | JSExceptionTracker& exceptionTracker) { |
| 564 | v8::HandleScope handleScope(_isolate); |
| 565 | auto local = fromValdiJSValue(_isolate, object, exceptionTracker); |
| 566 | if (!exceptionTracker) { |
| 567 | return JSValueRef(); |
| 568 | } |
| 569 | |
| 570 | if (!local->IsObject()) { |
| 571 | exceptionTracker.onError("Cannot getObject property on non object value"); |
| 572 | return JSValueRef(); |
| 573 | } |
| 574 | |
| 575 | v8::Local<v8::Context> context = v8::Local<v8::Context>::New(_isolate, _context); |
| 576 | auto val = v8::Local<v8::Object>::Cast(local); |
| 577 | |
| 578 | v8::Local<v8::Value> retval; |
| 579 | if (!val->Get(context, static_cast<uint32_t>(index)).ToLocal(&retval)) { |
| 580 | exceptionTracker.onError("Failed to fetch object at requested index"); |
| 581 | return JSValueRef(); |
| 582 | } |
| 583 | |
| 584 | return toRetainedJSValueRef(IndirectV8Persistent::make(_isolate, retval)); |
| 585 | } |
| 586 | |
| 587 | bool V8JavaScriptContext::hasObjectProperty(const JSValue& object, const JSPropertyName& propertyName) { |
| 588 | v8::HandleScope handleScope(_isolate); |
no test coverage detected