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

Function jsObjectToValue

valdi/src/valdi/runtime/JavaScript/JavaScriptUtils.cpp:457–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455 }
456};
457
458void throwInvalidType(IJavaScriptContext& jsContext,
459 const JSValue& jsValue,
460 JSExceptionTracker& exceptionTracker,
461 ValueType expectedType) {
462 exceptionTracker.onError(Value::invalidTypeError(expectedType, jsContext.getValueType(jsValue)));
463}
464
465Value untypedJsObjectToValue(IJavaScriptContext& jsContext,
466 const JSValue& jsValue,
467 const ReferenceInfoBuilder& referenceInfoBuilder,
468 JSExceptionTracker& exceptionTracker) {
469 ObjectConvertVisitor visitor(referenceInfoBuilder);
470 jsContext.visitObjectPropertyNames(jsValue, exceptionTracker, visitor);
471
472 if (!exceptionTracker) {
473 return Value::undefined();
474 }
475
476 return Value(visitor.convertedObject);
477}
478
479Value jsObjectToValue(IJavaScriptContext& jsContext,
480 const JSValue& jsValue,
481 const ReferenceInfoBuilder& referenceInfoBuilder,
482 JSExceptionTracker& exceptionTracker) {

Callers 1

jsValueToValueFunction · 0.85

Calls 4

untypedJsObjectToValueFunction · 0.85
tryUnwrapMethod · 0.80
getValueMarshallerMethod · 0.45
isUndefinedMethod · 0.45

Tested by

no test coverage detected