Status: New
Owner: ----

New issue 2264 by [email protected]: Array.prototype.sort does not call ToString() for identical elements
http://code.google.com/p/v8/issues/detail?id=2264

The SortCompare abstract operation (cf. Array.prototype.sort [15.4.4.11]) calls ToString() for each element which is going to be compared. This ToString() call is currently omitted for identical elements, this is not spec compliant.

test case:
var c = 0;
var o = {toString: function(){ c++; return ""; }}
[o, o].sort();
print(c);

Expected output:
2

Actual output:
0

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to