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

Method setObjectPropertyIndex

valdi/src/valdi/jscore/JavaScriptCoreContext.cpp:944–962  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942 }
943
944 return functionData->function;
945}
946
947Valdi::JSTypedArray JavaScriptCoreContext::valueToTypedArray(const Valdi::JSValue& value,
948 Valdi::JSExceptionTracker& exceptionTracker) {
949 auto objectRef = fromValdiJSValue(value).asObjectRefOrThrow(*this, exceptionTracker);
950 if (!exceptionTracker) {
951 return Valdi::JSTypedArray();
952 }
953
954 auto contextRef = getJSGlobalContext();
955 JSValueRef exception = nullptr;
956 auto type = JSValueGetTypedArrayType(contextRef, objectRef, &exception);
957 if (exception != nullptr) {
958 storeException(exceptionTracker, exception);
959 return Valdi::JSTypedArray();
960 }
961
962 if (type == kJSTypedArrayTypeNone) {
963 exceptionTracker.onError(Valdi::Error("Object ref must point to a typed array"));
964 return Valdi::JSTypedArray();
965 }

Callers

nothing calls this directly

Calls 2

asObjectRefOrThrowMethod · 0.80
fromValdiJSValueFunction · 0.70

Tested by

no test coverage detected