| 983 | size_t byteOffset = 0; |
| 984 | if (type != kJSTypedArrayTypeArrayBuffer) { |
| 985 | bufferSize = JSObjectGetTypedArrayByteLength(contextRef, objectRef, &exception); |
| 986 | if (exception != nullptr) { |
| 987 | storeException(exceptionTracker, exception); |
| 988 | return Valdi::JSTypedArray(); |
| 989 | } |
| 990 | |
| 991 | byteOffset = JSObjectGetTypedArrayByteOffset(contextRef, objectRef, &exception); |
| 992 | if (exception != nullptr) { |
| 993 | storeException(exceptionTracker, exception); |
| 994 | return Valdi::JSTypedArray(); |
| 995 | } |
| 996 | } else { |
| 997 | bufferSize = JSObjectGetArrayBufferByteLength(contextRef, arrayBufferRef, &exception); |
| 998 | if (exception != nullptr) { |
| 999 | storeException(exceptionTracker, exception); |
| 1000 | return Valdi::JSTypedArray(); |
| 1001 | } |
| 1002 | } |
| 1003 | |
| 1004 | // The Valdi TypedArray enum matches JSCore's kJSTypedArrayType |
| 1005 | auto arrayType = static_cast<Valdi::TypedArrayType>(type); |
| 1006 | |
| 1007 | auto bufferStart = reinterpret_cast<Valdi::Byte*>(tempBuffer) + byteOffset; |
| 1008 |
nothing calls this directly
no test coverage detected