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

Method asObjectRefOrThrow

valdi/src/valdi/jscore/JSCoreUtils.cpp:21–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace ValdiJSCore {
20
21JSObjectRef JSCoreRef::asObjectRefOrThrow(Valdi::IJavaScriptContext& jsContext,
22 Valdi::JSExceptionTracker& exceptionTracker) const {
23 auto objectRef = asObjectRef();
24 if (objectRef == nullptr) {
25 exceptionTracker.onError(Valdi::Error("Value is not an object"));
26 }
27
28 return objectRef;
29}
30
31std::pair<const char*, size_t> jsStringToUTF8(JSStringRef stringRef) {
32 if (stringRef == nullptr) {

Callers 10

valueToTypedArrayMethod · 0.80
callObjectAsFunctionMethod · 0.80
getObjectPropertyMethod · 0.80
setObjectPropertyMethod · 0.80
enqueueMicrotaskMethod · 0.80

Calls 2

onErrorMethod · 0.65
ErrorInterface · 0.50

Tested by

no test coverage detected