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

Method valueToDouble

valdi/src/valdi/hermes/HermesJavaScriptContext.cpp:862–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860 std::move(jsObject), *_runtime, toHandle(propertyName), toHandle(propertyValue));
861
862 checkException(result.getStatus(), exceptionTracker);
863}
864
865void HermesJavaScriptContext::setObjectPropertyIndex(const JSValue& object,
866 size_t index,
867 const JSValue& value,
868 JSExceptionTracker& exceptionTracker) {
869 hermes::vm::GCScope gcScope(*_runtime);
870 auto jsObject = toJSObject(object, exceptionTracker);
871 if (!jsObject) {
872 return;
873 }
874
875 auto result = hermes::vm::JSObject::putComputed_RJS(
876 std::move(jsObject),
877 *_runtime,
878 _runtime->makeHandle(hermes::vm::HermesValue::encodeTrustedNumberValue(index)),
879 toHandle(value));
880
881 checkException(result.getStatus(), exceptionTracker);
882}
883
884hermes::vm::CallResult<hermes::vm::PseudoHandle<hermes::vm::HermesValue>> HermesJavaScriptContext::doCall(
885 hermes::vm::ScopedNativeCallFrame& callFrame,
886 const hermes::vm::Handle<hermes::vm::Callable>& handle,
887 JSFunctionCallContext& callContext) {
888 if (callFrame.overflowed()) {
889 return _runtime->raiseStackOverflow(hermes::vm::Runtime::StackOverflowKind::NativeStack);
890 }

Callers

nothing calls this directly

Calls 10

utf16ToUtf8Function · 0.85
getNumberMethod · 0.80
isBoolMethod · 0.80
getStringMethod · 0.65
isUndefinedMethod · 0.45
isNullMethod · 0.45
isNumberMethod · 0.45
getBoolMethod · 0.45
isStringMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected