| 942 | } |
| 943 | |
| 944 | return functionData->function; |
| 945 | } |
| 946 | |
| 947 | Valdi::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 | } |
nothing calls this directly
no test coverage detected