Repository navigation
Commit 96dddb0
Type structuredClone typed arrays as ArrayBuffer-backed (#59147)
Summary:
Pull Request resolved: #59147
`cloneTypedArray` passes `value.buffer` to `cloneArrayBuffer(value: ArrayBuffer)`. With TypeScript's ES2024 `ArrayBuffer` definitions, `$TypedArray` (meaning `$TypedArray<ArrayBufferLike>`) has an `ArrayBufferLike` buffer, which is no longer an `ArrayBuffer`. Hermes, React Native's default engine, has no `SharedArrayBuffer`, and `cloneArrayBuffer` already treats its input and its `slice(0)` copy as an `ArrayBuffer`. This narrows `isTypedArray`'s refinement and `cloneTypedArray`'s parameter to `$TypedArray<ArrayBuffer>`. It is a type-only change.
Changelog: [Internal]
Differential Revision: D125721761
fbshipit-source-id: 77ccc4b89e9018c3d6656ec7bfc4cb6874f48e861 parent 11d5dd0 commit 96dddb0
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| |||
0 commit comments