This is a spec. bug. Immediately before line10 of the algorithm there should be a line that says:
Call the [[Put]] internal method of A with arguments "length", actualDeleteCount, and true. The ES3 spec. has the equivalent of the above line. It was apparently inadvertently dropped in the ES5 spec. Chrome's behavior (and also Firefox, I haven't checked others) matches the intended ES3 behavior. I'll file a bug against the the ES5 spec. Allen Chrome is correct On Apr 9, 2012, at 8:19 AM, John-David Dalton wrote: > Can someone confirm/reject that by spec (http://es5.github.com/#x15.4.4.12): > > // sparse array ;D > var a=[0]; > a[2]=2; > > // the resulting arrays length should be 1 and not 2 > console.log(a.splice(0, 2).length); > > I'm seeing `2` in latest Chrome/FF. > > Thanks, > -JDD > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss