Skip to content

Commit b41a832

Browse files
claudepacheljharb
authored andcommitted
Normative: Add three missing checks in proxy internal methods (#666)
1 parent f0c10cf commit b41a832

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

spec.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10013,6 +10013,8 @@ <h1>[[GetOwnProperty]] ( _P_ )</h1>
1001310013
1. If _resultDesc_.[[Configurable]] is *false*, then
1001410014
1. If _targetDesc_ is *undefined* or _targetDesc_.[[Configurable]] is *true*, then
1001510015
1. Throw a *TypeError* exception.
10016+
1. If _resultDesc_ has a [[Writable]] field and _resultDesc_.[[Writable]] is *false*, then
10017+
1. If _targetDesc_.[[Writable]] is *true*, throw a *TypeError* exception.
1001610018
1. Return _resultDesc_.
1001710019
</emu-alg>
1001810020
<emu-note>
@@ -10025,13 +10027,16 @@ <h1>[[GetOwnProperty]] ( _P_ )</h1>
1002510027
A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object.
1002610028
</li>
1002710029
<li>
10028-
A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible.
10030+
A property cannot be reported as non-existent, if the target object is not extensible, unless it does not exist as an own property of the target object.
10031+
</li>
10032+
<li>
10033+
A property cannot be reported as existent, if the target object is not extensible, unless it exists as an own property of the target object.
1002910034
</li>
1003010035
<li>
10031-
A property cannot be reported as existent, if it does not exist as an own property of the target object and the target object is not extensible.
10036+
A property cannot be reported as non-configurable, unless it exists as a non-configurable own property of the target object.
1003210037
</li>
1003310038
<li>
10034-
A property cannot be reported as non-configurable, if it does not exist as an own property of the target object or if it exists as a configurable own property of the target object.
10039+
A property cannot be reported as both non-configurable and non-writable, unless it exists as a non-configurable, non-writable own property of the target object.
1003510040
</li>
1003610041
</ul>
1003710042
</emu-note>
@@ -10063,6 +10068,8 @@ <h1>[[DefineOwnProperty]] ( _P_, _Desc_ )</h1>
1006310068
1. Else,
1006410069
1. If IsCompatiblePropertyDescriptor(_extensibleTarget_, _Desc_, _targetDesc_) is *false*, throw a *TypeError* exception.
1006510070
1. If _settingConfigFalse_ is *true* and _targetDesc_.[[Configurable]] is *true*, throw a *TypeError* exception.
10071+
1. If IsDataDescriptor(_targetDesc_) is *true*, _targetDesc_.[[Configurable]] is *false*, and _targetDesc_.[[Writable]] is *true*, then
10072+
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, throw a *TypeError* exception.
1006610073
1. Return *true*.
1006710074
</emu-alg>
1006810075
<emu-note>
@@ -10077,6 +10084,9 @@ <h1>[[DefineOwnProperty]] ( _P_, _Desc_ )</h1>
1007710084
<li>
1007810085
A property cannot be non-configurable, unless there exists a corresponding non-configurable own property of the target object.
1007910086
</li>
10087+
<li>
10088+
A non-configurable property cannot be non-writable, unless there exists a corresponding non-configurable, non-writable own property of the target object.
10089+
</li>
1008010090
<li>
1008110091
If a property has a corresponding target object property then applying the Property Descriptor of the property to the target object using [[DefineOwnProperty]] will not throw an exception.
1008210092
</li>
@@ -10210,6 +10220,8 @@ <h1>[[Delete]] ( _P_ )</h1>
1021010220
1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_).
1021110221
1. If _targetDesc_ is *undefined*, return *true*.
1021210222
1. If _targetDesc_.[[Configurable]] is *false*, throw a *TypeError* exception.
10223+
1. Let _extensibleTarget_ be ? IsExtensible(_target_).
10224+
1. If _extensibleTarget_ is *false*, throw a *TypeError* exception.
1021310225
1. Return *true*.
1021410226
</emu-alg>
1021510227
<emu-note>
@@ -10221,6 +10233,9 @@ <h1>[[Delete]] ( _P_ )</h1>
1022110233
<li>
1022210234
A property cannot be reported as deleted, if it exists as a non-configurable own property of the target object.
1022310235
</li>
10236+
<li>
10237+
A property cannot be reported as deleted, if it exists as an own property of the target object and the target object is non-extensible.
10238+
</li>
1022410239
</ul>
1022510240
</emu-note>
1022610241
</emu-clause>

0 commit comments

Comments
 (0)