Finiteness of object properties set

Brendan Eich brendan at mozilla.com
Wed Sep 7 09:43:41 PDT 2011


On Sep 7, 2011, at 6:12 AM, Tom Van Cutsem wrote:

> 2011/9/7 David Bruant <david.bruant at labri.fr>
> Le 06/09/2011 17:59, Mark S. Miller a écrit :
> 
> I agree that the spec should clearly state that a non-extensible object has a finite collection of own properties. Regarding infinite extensible objects, the only problem I see off the top of my head is: What would Object.getOwnPropertyNames return?
> And what about for-in loops? :-p
> 
> It's always possible to break/return early, no? Didn't iterators/generators already cross this bridge? An iterator could iterate over an infinite stream of values.

Indeed the derived iterate trap supports infinite objects -- this was a use-case Waldemar raised this at TC39 meetings last year, IIRC at the November 2010 meeting (notes posted to es-discuss).

See also

http://wiki.ecmascript.org/doku.php?id=harmony:iterators#iteration_via_standard_private_name
http://wiki.ecmascript.org/doku.php?id=harmony:iterators#iteration_via_proxies

/be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110907/3b8e5f38/attachment.html>


More information about the es-discuss mailing list