Per Cederberg
2010-10-28 05:00:36 UTC
While writing some MochiKit tests, I stumbled upon the following:
#> compare("", [])
==> 0
#> "" == []
==> true
Seems like the JavaScript type coercion is used inside compare():
compare: function (a, b) {
if (a == b) {
return 0;
}
...
But perhaps that was just a mistake? It seems to be at odds with the
idea of a "safe" compare function... If nobody is terribly dependent
on this I'll fix it for 1.5. But please verify this if you are
extensive users of compare().
Cheers,
/Per
#> compare("", [])
==> 0
#> "" == []
==> true
Seems like the JavaScript type coercion is used inside compare():
compare: function (a, b) {
if (a == b) {
return 0;
}
...
But perhaps that was just a mistake? It seems to be at odds with the
idea of a "safe" compare function... If nobody is terribly dependent
on this I'll fix it for 1.5. But please verify this if you are
extensive users of compare().
Cheers,
/Per
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.