Array#splice sparse array spec question.
allen at wirfs-brock.com
Mon Apr 9 08:51:27 PDT 2012
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.
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/#x220.127.116.11):
> // sparse array ;D
> var a=;
> // 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.
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss