ejayimperial / google-caja

Automatically exported from code.google.com/p/google-caja
0 stars 0 forks source link

the first indice of an array is 0 not 1 #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in JSON.js
method serialize
for an array
the loop should begin at 0

            function serialize(value) {
....
                        for (i = 0; i < len; i += 1) {     <---- here
                            v = filter(value, i);
                            if (v !== undefined) {
                                if (needComma) {
                                    out.push(',');
                                } else {

Cheers,
Sylvain Pointeau 

Original issue reported on code.google.com by sylvain....@gmail.com on 19 Oct 2007 at 2:04

GoogleCodeExporter commented 9 years ago
Fixed. The 1 index was a remnant from earlier logic that dealt with the 
needComma
issue a different way. Thanks for catching this!

Original comment by erights on 21 Oct 2007 at 1:32