structuredClone invokes custom Map and Set iterators
未关闭
还没有人认领这个 Issue。
Needs: Author Feedback
Needs: Repro
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
The React Native structuredClone polyfill traverses Map and Set values with for...of. An own Symbol.iterator override is therefore executed and can change the cloned contents or abort cloning, even though structured cloning should read the built-in collection data from internal slots.
Expected behavior
Map and Set cloning should ignore user iterator overrides and clone their real built-in entries, matching native structuredClone.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 React Native structuredClone polyfill 入手,检查 Map 和 Set 值的遍历方式。使用自定义的 Symbol.iterator 覆盖来复现问题,并将结果与原生 structuredClone 进行比较。完成标准是克隆使用内置条目,忽略这些覆盖,并在 JavaScript 运行时上保持预期行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react-native
- 领域
- mobile-dev
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100