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

Method valueToStaticString

valdi/src/valdi/hermes/HermesJavaScriptContext.cpp:828–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826 return newUndefined();
827 }
828
829 return toJSValueRef(result.getValue().getHermesValue());
830}
831
832bool HermesJavaScriptContext::hasObjectProperty(const JSValue& object, const JSPropertyName& propertyName) {
833 hermes::vm::GCScope gcScope(*_runtime);
834 const auto* hermesValue = toPinnedHermesValue(object);
835
836 if (!hermesValue->isObject()) {
837 return false;
838 }
839
840 auto symbolId = toSymbolID(propertyName);
841 auto result = hermes::vm::JSObject::hasNamedOrIndexed(
842 hermes::vm::Handle<::hermes::vm::JSObject>::vmcast(hermesValue), *_runtime, symbolId.get());
843
844 if (result.getStatus() == hermes::vm::ExecutionStatus::EXCEPTION) {
845 _runtime->clearThrownValue();
846 return false;
847 }

Callers

nothing calls this directly

Calls 4

getStatusMethod · 0.80
toStringFunction · 0.70
getValueMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected