On 2011-02-14, at 5:07 PM, Marc Feeley wrote:
I did encounter one strange thing. The behavior of Array.splice(0) on our system does the intuitive thing (removes nothing from the array). However, on V8, it removes everything from the array instead.
If I read the ECMAScript spec right, splice takes at least 2 arguments. So the behavior with one argument is probably implementation dependent. I wouldn't worry about it... unless we rely on splice(X) in the compiler itself.
Are you sure that V8 removes everything? The following test says the contrary:
% d8 V8 version 3.1.1 [console: dumb] d8> var a = [1,2,3]; d8> a.splice(0); 1,2,3
Marc