Finiteness of object properties set
David Bruant
david.bruant at labri.fr
Wed Sep 7 05:07:07 PDT 2011
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
If this is really considered, the problem to solve is to express an
infinite set with a finite representation. RegExps may be a solution.
One big question is on RegExp expressivity: Can any infinite string set
be expressed with (a finite number of) JS RegExps? I have to admit that
i know ECMAScript pretty well expect RegExp i have never taken the time
to investigate, so i have no idea of the answer to this question, not
even an intuition.
Alternatively, extensible objects could be stated as having a finite set
of properties. I have no knowledge of host objects with an infinite
property set and everyone's intuition falls under the idea that objects
are a finite collection of properties.
Saying it explicitely would prevent attempts from ES implementors to
have host objects with infinite property set. It would also allow to
continue proxies with the current design tracks (which currently prevent
infinite property sets).
David
More information about the es-discuss
mailing list