MCPcopy Create free account
hub / github.com/Snapchat/Valdi / valueToString

Method valueToString

valdi/src/valdi/hermes/HermesJavaScriptContext.cpp:810–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

808 return toJSValueRef(result.getValue().getHermesValue());
809}
810
811JSValueRef 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());

Callers

nothing calls this directly

Calls 8

getGlobalFunction · 0.85
getStatusMethod · 0.80
makeStringMethod · 0.80
makeStringFromUTF16Method · 0.80
toStringFunction · 0.70
getValueMethod · 0.65
StringBoxClass · 0.50
lengthMethod · 0.45

Tested by

no test coverage detected