On Wed Dec 17 10:30:03 PST 2014, Andrea Giammarchi wrote:
>This would already fix the `Object.prototype.get` or `.set` case since I
>believe nobody ever used an inherited `value` property on purpose for
>descriptors ... or is it?
I agree that nobody will use an inherited 'value' property, however, I think
the inherited 'get' or 'set' property should be weighted equally as 'value'
property, despite the fact that it is not usual to do that. I don't know
whether it is a bug or it is intended, the current version of ECMAScript (5.1)
seems to use [[HasProperty]] instead of [[GetOwnProperty]], so the case you
talked about is actually valid in the specification. My suggestion is that
maybe we should change the specification from using property to using own
property *only*.
Excerpted From ECMAScript 5.1 8.10.5
```
5. If the result of calling the [[HasProperty]] internal method of Obj with
argument "value" is true, then
a. Let value be the result of calling the [[Get]] internal method of Obj with
argument �Dvalue‖.
b. Set the [[Value]] field of desc to value.
```
We can change it into
```
5. If the result of calling the [[GetOwnProperty]] internal method of Obj with
argument "value" is not undefined, then
a. Let value be the result of calling the [[Get]] internal method of Obj with
argument �Dvalue.
b. Set the [[Value]] field of desc to value.
```
I believe such a change will not make a big difference (since a descriptor has
only 4 properties, it is not essential to use prototyping)
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss