On Mar 15, 2012, at 7:45 AM, Dean Landolt wrote:
>
>
> On Thu, Mar 15, 2012 at 10:30 AM, Kevin Smith <[email protected]> wrote:
> Hi Allen,
>
> In this stawman, private members are accessed using obj.name, where "name"
> can be a private name that is in scope. Why was this strategy abandoned?
>
> This conflates lookup by object key vs. string key and could be incredibly
> confusing.
The way I would this as: there isn't a sigil at the point of reference that
distinguish a private named property reference from a normal string property
name reference:
obj.name
might be referencing either a property whose key is "name" or a property whose
key is a private name whose value is bound to the identifier name. The actual
meaning is only determined by whether or not a private declaration for the
identifier name is within scope of the reference. This will be confusing if
you are oblivious of the enclosing private declarations.
> And what happens when you have a private name locally scoped to the symbol
> "foo" and a string key "foo"?
obj1.foo = obj2["foo"]
however, I would now have the same concerns about this WRT [1] as do about the
current proposals:
obj1[privateFoo] = obj2.foo;
[1]: http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss