| 808 | return toJSValueRef(result.getValue().getHermesValue()); |
| 809 | } |
| 810 | |
| 811 | JSValueRef HermesJavaScriptContext::getObjectPropertyForIndex(const JSValue& object, |
| 812 | size_t index, |
| 813 | JSExceptionTracker& exceptionTracker) { |
| 814 | hermes::vm::GCScope gcScope(*_runtime); |
| 815 | auto jsObject = toJSObject(object, exceptionTracker); |
| 816 | if (!jsObject) { |
| 817 | return newUndefined(); |
| 818 | } |
| 819 | |
| 820 | auto result = hermes::vm::JSObject::getComputed_RJS( |
| 821 | std::move(jsObject), |
| 822 | *_runtime, |
| 823 | _runtime->makeHandle(hermes::vm::HermesValue::encodeUntrustedNumberValue(index))); |
| 824 | |
| 825 | if (!checkException(result.getStatus(), exceptionTracker)) { |
| 826 | return newUndefined(); |
| 827 | } |
| 828 | |
| 829 | return toJSValueRef(result.getValue().getHermesValue()); |
nothing calls this directly
no test coverage detected