Allen Wirfs-Brock <mailto:[email protected]>
January 23, 2012 8:43 AM
On Jan 22, 2012, at 7:36 PM, Tab Atkins Jr. wrote:


For example, from my post:

myCoolObject.prototype[Iterator.getIterator] = function(){...}

Using @ for access, would
"[email protected] = function(){...}" work,
or would that attempt to retrieve a property using "Iterator" as a
Name, then retrieve the "getIterator" property of that?

If the latter, this is rather inconvenient for what I expect will be
common patterns.


   [email protected]

parses as:  ((myCoolObject.prototype).@Iterator).getIterator

which probably is not what you desire.

Taking just what is in my basic proposal, you would have to express this using a local variable:

const getIterator = Iterator.getIterator;
myCoolObject.prototype.@getIterator = function() {...}

Why wouldn't myCoolObject.prototype[iterator.getIterator] work?

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to