From 89ea97d00fe98d08d10afb12d891b1c786b16c52 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 4 Oct 2019 16:40:41 +0300 Subject: [PATCH] JS: revert $rt_compare implementation since new one does not work properly --- .../main/resources/org/teavm/backend/javascript/runtime.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/src/main/resources/org/teavm/backend/javascript/runtime.js b/core/src/main/resources/org/teavm/backend/javascript/runtime.js index d4b7b7e74..0a318d91c 100644 --- a/core/src/main/resources/org/teavm/backend/javascript/runtime.js +++ b/core/src/main/resources/org/teavm/backend/javascript/runtime.js @@ -24,11 +24,7 @@ function $rt_nextId() { return x; } function $rt_compare(a, b) { - var nanA = a != a; - 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); + return a > b ? 1 : a < b ? -1 : a === b ? 0 : 1; } function $rt_isInstance(obj, cls) { return obj !== null && !!obj.constructor.$meta && $rt_isAssignable(obj.constructor, cls);