From 3ee3e32f28b92615095bb39aa68851f01b18ff4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 6 Nov 2024 17:29:18 +0100 Subject: [PATCH] Fix compare function (#1729) --- runtime/js/compare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/js/compare.js b/runtime/js/compare.js index 609e2e6133..315d76f902 100644 --- a/runtime/js/compare.js +++ b/runtime/js/compare.js @@ -61,7 +61,7 @@ function caml_compare_val_number_custom(num, custom, swap, total) { if (comp) { var x = swap > 0 ? comp(custom, num, total) : comp(num, custom, total); if (total && Number.isNaN(x)) return swap; // total && nan - if (Number.isNan(+x)) return +x; // nan + if (Number.isNaN(+x)) return +x; // nan if ((x | 0) !== 0) return x | 0; // !nan } return swap;