fixed #207 (stricter comparison of strings vs. numbers)

Some intentional edge cases remain, such as empty string equals zero
and disregarding trailing / leading blanks. Please don’t nitpick and
spare me the fundamentalism, plus discussing whether discussing the
discussing qualifies as fundamentalism :-)
pull/3/merge
jmoenig 2013-11-26 10:02:38 +01:00
rodzic 71b7001caa
commit 2cb904d2bb
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -2010,3 +2010,4 @@ ______
132226
------
* Cloud: fixed #125 (encode email address when signing up), thanks, Nathan!
* Threads: fixed #207 (stricter comparison of strings vs. numbers). Some edge cases remain, such as empty string equals zero and disregarding trailing / leading blanks. These are intentional. Please dont nitpick and spare me the fundamentalism :-)

Wyświetl plik

@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
modules.threads = '2013-October-17';
modules.threads = '2013-November-26';
var ThreadManager;
var Process;
@ -98,8 +98,8 @@ function snapEquals(a, b) {
}
return false;
}
var x = parseFloat(a),
y = parseFloat(b);
var x = +a;
y = +b;
if (isNaN(x) || isNaN(y)) {
x = a;
y = b;