[[DefineOwnProperty]]: Confusing note about redefinition always failing
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- documentation
Research direction
Start with the proposal's [[DefineOwnProperty]] algorithm and the referenced ValidateAndApplyPropertyDescriptor steps in the Immutable ArrayBuffer specification. Compare the current note with the proposed mutable checks and value comparison. Done means the confusing note is replaced by consistent algorithm steps and the linked TypedArray behavior remains accurately specified.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- JavaScript
- Stars
- 38
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tc39/proposal-immutable-arraybuffer
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tc39/proposal-immutable-arraybuffer#43 · 2 comments ·
-
Review Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
tc39/proposal-immutable-arraybuffer#30 · 12 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
tc39/proposal-immutable-arraybuffer#18 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
tc39/proposal-immutable-arraybuffer#16 · 2 comments ·
All issues in tc39/proposal-immutable-arraybuffer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·