__proto__ and accessor descriptors

Jeff Walden jwalden+es at MIT.EDU
Thu Nov 8 15:05:43 PST 2012


On 10/26/2012 02:30 PM, David Bruant wrote:> Le 26/10/2012 22:56, Asen Bozhilov a écrit :
>> var obj = Object.defineProperty({}, '__proto__', {
>>     get : function () {return '__proto__ getter'},
>>     set : function (){return '__proto__ setter'}
>> });
>>
>>
>> console.log(obj.__proto__); //[object Object]
>> console.log(obj.__proto__ = {}); //[object Object]
>>
> On Firefox Aurora, I find:
> "__proto__ getter"
> "[object Object]"
> 
> According to this strawman, the output should indeed be
> "__proto__getter" then "__proto__setter".

Given that the result of evaluating |obj.__proto__ = {}| is the right-hand side (the return value of calling the setter is ignored), to the extent there's some determined-correct behavior here, it definitely wouldn't be to log "__proto__ setter".

Jeff


More information about the es-discuss mailing list