Oops mind fart:

Make that obj.foo===obj[0]

The point is that what follows the dot ia already evaluated differently than 
what comes between brackets


Dean Landolt <d...@deanlandolt.com> wrote:

>>
>>
>> [snip]
>>
>> >
>> > Anyway, now that I've confirmed my suspicions, I'm hesitant about the
>> private names proposal as described. The fact that declaring a certain name
>> as private affects _all_ property name lookups in that scope (all lookups
>> that use the dot operator or object literal syntax, at least) — well, I'm
>> not sure I like the implications. It would mean a new  and _surprising_
>> distinction between dot notation and bracket notation.
>>
>> There is already a distinction between dot notation and bracket notation:
>>  var obj = {0: "zero", foo: "foo"};
>>  var foo = 0;
>>  print ( obj.foo === obj[foo]);  //false, really obj.foo ===obj[42]
>>
>>
>Wait, what? The correct comparison would be `obj.foo === obj["foo"]`. But
>perhaps something got removed -- where does `obj.foo === obj[42]` even come
>from?
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to