JS: revert $rt_compare implementation since new one does not work properly

This commit is contained in:
Alexey Andreev 2019-10-04 16:40:41 +03:00
parent 4e0381950a
commit 89ea97d00f

View File

@ -24,11 +24,7 @@ function $rt_nextId() {
return x; return x;
} }
function $rt_compare(a, b) { function $rt_compare(a, b) {
var nanA = a != a; return a > b ? 1 : a < b ? -1 : a === b ? 0 : 1;
var nanB = b != b;
if (nanA | nanB) return nanA - nanB;
if (a === 0 && b === 0) { a = 1 / a, b = 1 / b; }
return (a > b) - (a < b);
} }
function $rt_isInstance(obj, cls) { function $rt_isInstance(obj, cls) {
return obj !== null && !!obj.constructor.$meta && $rt_isAssignable(obj.constructor, cls); return obj !== null && !!obj.constructor.$meta && $rt_isAssignable(obj.constructor, cls);