About private names

Dean Landolt dean at deanlandolt.com
Sun Mar 20 10:02:12 PDT 2011

> [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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110320/f07e5505/attachment.html>

More information about the es-discuss mailing list