| 962 | if (type == kJSTypedArrayTypeNone) { |
| 963 | exceptionTracker.onError(Valdi::Error("Object ref must point to a typed array")); |
| 964 | return Valdi::JSTypedArray(); |
| 965 | } |
| 966 | |
| 967 | auto arrayBufferRef = objectRef; |
| 968 | if (type != kJSTypedArrayTypeArrayBuffer) { |
| 969 | arrayBufferRef = JSObjectGetTypedArrayBuffer(contextRef, objectRef, &exception); |
| 970 | if (exception != nullptr) { |
| 971 | storeException(exceptionTracker, exception); |
| 972 | return Valdi::JSTypedArray(); |
| 973 | } |
| 974 | } |
| 975 | |
| 976 | void* tempBuffer = JSObjectGetArrayBufferBytesPtr(contextRef, arrayBufferRef, &exception); |
| 977 | if (exception != nullptr) { |
| 978 | storeException(exceptionTracker, exception); |
| 979 | return Valdi::JSTypedArray(); |
| 980 | } |
| 981 | |
| 982 | size_t bufferSize = 0; |
| 983 | size_t byteOffset = 0; |
| 984 | if (type != kJSTypedArrayTypeArrayBuffer) { |
| 985 | bufferSize = JSObjectGetTypedArrayByteLength(contextRef, objectRef, &exception); |
| 986 | if (exception != nullptr) { |
nothing calls this directly
no test coverage detected