Editorial: fix an invariant for [[GetOwnProperty]] #3254
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3253.
Calling this editorial because it's not currently coherent with text in the surrounding section. It's debatably normative though.
The constraints are sometimes worded in a slightly confusing way. The intended constraints on GetOwnProperty are:
configurable: true
properties can changeconfigurable: false
+writable: true
properties can change value and can become non-writable, but no other changes are allowedconfigurable: false
+ (writable: false
or accessor) properties cannot change in any wayThese are clearly the intended constraints, especially if you read the NOTE:
Currently the wording for one of the invariants says that if any property other than [[Writable]] can change then it must be configurable. But that doesn't match the intended constraints: in fact the [[Value]] should be able to change as well when the property is writable, even for non-configurable properties.
(The fact that [[Value]] can't change for non-writable non-configurable properties is already covered by the invariant before this one.)
Sidebar: maybe we should rework this section to be easier to understand.