structuredClone loses ArrayBuffer and typed-array data
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
The React Native structuredClone polyfill treats ArrayBuffer, DataView, and every typed array as arbitrary objects, returning plain objects that lose their internal bytes, view type, offsets, lengths, and shared backing-buffer relationships.
Expected behavior
ArrayBuffers should be copied through the intrinsic operation; DataView and all supported typed-array kinds should be reconstructed with their original offset/length and should share the same cloned backing buffer when cloned together. User-shadowed slice or constructor properties must not be invoked. Transfer support is outside this issue.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在当前 main 中找到 structuredClone polyfill,并首先使用 ArrayBuffer、DataView 和 typed arrays 复现问题,包括共享的 backing buffer 和被遮蔽的属性。追踪现有的对象克隆路径及其测试。当这些内置视图在不调用被遮蔽的 slice 或 constructor 属性的情况下保留其字节、类型、偏移量、长度和关系时,即视为完成;transfer 支持不在范围内。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react-native
- 领域
- mobile-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100