structuredClone preserves Error cause references and drops falsy causes
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.3k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 4
説明
Description
The React Native structuredClone polyfill passes Error.cause through by reference instead of cloning it, and only copies the property when its value is truthy. Object causes therefore remain shared with the input; a circular cause points back to the original Error; and valid falsy causes such as false disappear.
Expected behavior
An own cause property should be cloned recursively, retain its non-enumerable Error property descriptor, preserve circular/shared identity within the clone, and keep falsy values. Node's native structuredClone follows this behavior.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず React Native の structuredClone polyfill を見つけ、Error.cause をどのように扱っているかを確認します。Node のネイティブな structuredClone と動作を比較し、再帰的なクローン、保持された循環/共有アイデンティティ、非列挙プロパティの descriptor、falsy な cause を示すテストカバレッジを追加します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react-native
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100