Sunday, April 18, 2010, 5:01:52 PM, you wrote:
| On Apr 18, 2010, at 7:13 AM, Dmitry A. Soshnikov wrote: This desugared view with enclosing anonymous function means that "getPrototype" name is available only in scope of of this function and when this scope ends, "getPrototype" name will be GC'ed (and related object too -- {value: ...}) That object may be GC'ed earlier, it's just a descriptor used to define the prototype property. and "Object.prototype" again won't have "getPrototype" name outside, right? Right. (Although, it's a bit strange, as it shouldn't be GC'ed as there is object related with this "name" object and vice-versa -- the "name" is still bound to this object {value: ...}. But, I don't know exactly about implementation). See ES5 -- Object.defineProperty(Object.prototype, getPrototype, {value: ...}) does not retain a reference to the {value: ...} object after it returns. It merely consults it to see how to define the property named by (in this case) the getPrototype Name object in Object.prototype. I.e. we can use "obj.getPrototype() freely here..." -- only inside this object (in this case -- inside this function)? Yes. And outside of this object "obj.getPrototype()" can mean completely different thing -- with "string" or "name" key, right? Right. And if already was declared the same "name"/"string" property, it isn't collide because our local "getPrototype" name has other identity, yeah? Yes. |
Yeah, thank you, now it is clear.
By the way, is there any ability to test some Harmony implementation already? Maybe some part of it which currently is being implemented? Some, so far mainly harmony:proxies for SpiderMonkey, see this bug. |
Yes, I'll follow and watch the development progress carefully.
Thanks again,
Dmitry.
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

