tc39 / tc39/proposal-immutable-arraybuffer
[[DefineOwnProperty]]: Confusing note about redefinition always failing
オープン
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 38
- フォーク
- 7
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
This note in [[DefineOwnProperty]] caused confusion during code view:
NOTE: Attempting to redefine an immutable value always fails, even if the new value would be cast to the current value.
Maybe just inline ValidateAndApplyPropertyDescriptor and replace https://tc39.es/proposal-immutable-arraybuffer/#sec-typedarray-defineownproperty, steps 1.b.ii-viii with:
- Let mutable be true.
- If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, set mutable to false.
- If Desc has a [[Configurable]] field and Desc.[[Configurable]] is not mutable, return false.
- If Desc has an [[Enumerable]] field and Desc.[[Enumerable]] is false, return false.
- If IsAccessorDescriptor(Desc) is true, return false.
- If Desc has a [[Writable]] field and Desc.[[Writable]] is not mutable, return false.
- If Desc has a [[Value]] field, then
- If mutable is false, then
- Let current be TypedArrayGetElement(O, numericIndex).
- Assert: current is not undefined.
- Return SameValue(Desc.[[Value]], current).
- Perform ? TypedArraySetElement(O, numericIndex, Desc.[[Value]]).
- Return true.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提案の [[DefineOwnProperty]] アルゴリズムと、Immutable ArrayBuffer 仕様において参照されている ValidateAndApplyPropertyDescriptor の手順から始めます。現在の注記を、提案されている可変性のチェックおよび値の比較と比較します。混乱を招く注記が一貫したアルゴリズム手順に置き換えられ、リンク先の TypedArray の動作が引き続き正確に規定されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100