| 1202 | } else if (hermes::vm::vmisa<hermes::vm::Uint16Array>(hermesValue)) { |
| 1203 | return Uint16Array; |
| 1204 | } else if (hermes::vm::vmisa<hermes::vm::Uint32Array>(hermesValue)) { |
| 1205 | return Uint32Array; |
| 1206 | } else { |
| 1207 | SC_ABORT("Unrecognized TypedArray type"); |
| 1208 | return Uint8Array; |
| 1209 | } |
| 1210 | } |
| 1211 | |
| 1212 | JSTypedArray HermesJavaScriptContext::valueToTypedArray(const JSValue& value, JSExceptionTracker& exceptionTracker) { |
| 1213 | hermes::vm::GCScope gcScope(*_runtime); |
| 1214 | auto* hermesValue = toPinnedHermesValue(value); |
| 1215 | |
| 1216 | if (hermes::vm::vmisa<hermes::vm::JSArrayBuffer>(*hermesValue)) { |
| 1217 | auto handle = hermes::vm::Handle<hermes::vm::JSArrayBuffer>::vmcast(hermesValue); |
| 1218 | if (!handle->attached()) { |
nothing calls this directly
no test coverage detected