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

Function jsArrayGetLength

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

Source from the content-addressed store, hash-verified

479}
480
481size_t jsArrayGetLength(IJavaScriptContext& jsContext, const JSValue& jsValue, JSExceptionTracker& exceptionTracker) {
482 static auto kLength = STRING_LITERAL("length");
483
484 auto length = jsContext.getObjectProperty(jsValue, jsContext.getPropertyNameCached(kLength), exceptionTracker);
485 if (!exceptionTracker) {
486 return 0;
487 }
488
489 return static_cast<size_t>(jsContext.valueToInt(length.get(), exceptionTracker));
490}
491
492Value jsArrayToValue(IJavaScriptContext& jsContext,
493 const JSValue& jsValue,

Callers 6

jsArrayToValueFunction · 0.85
newArrayIteratorMethod · 0.85
setProtobufRepeatedFieldFunction · 0.85
getMessageIndexesFunction · 0.85
codepointsToStrMethod · 0.85

Calls 4

getPropertyNameCachedMethod · 0.80
getMethod · 0.65
getObjectPropertyMethod · 0.45
valueToIntMethod · 0.45

Tested by

no test coverage detected