gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/trunk r10099: Test property enumeratio


From: Benjamin Wolsey
Subject: Re: [Gnash-commit] /srv/bzr/gnash/trunk r10099: Test property enumeration. Gnash is wrong. LoadVars.toString() (and similar
Date: Sun, 26 Oct 2008 09:33:42 +0100

> The spec says the enumeration order on an object is random, IIRC.   So
> you probably want a sort on the enumeration result, to make the result
> predictable.
> 
The point of the new test is that enumeration order is predictable. As
you see, the latest member created is the first enumerated. Sorting
would make the test useless.

The spec might mean that built in objects have a seemingly random
enumeration order (because they initialize methods in a random way
internally). It might mean not random, but 'non-alphabetic'. Or it might
just be wrong.

It's probably not extremely important, but it makes regression testing
of some methods easier, and always worth being compatible in case
something relies on it.

> > +enumerateObj = function(object) {
> > +   list = "";
> > +    for (el in o) {         <--------------------[1]
> > +        list += el + ",";
> > +    }
> > +    return list;
> > +};
> 
> 
> [1] is it a typo?  'o' is undefined there.
> 
It was a typo, but since my object was always called 'o' it didn't
matter. I've corrected that, however.

bwy


Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]