From 3924732a276c8012ac690b06824abcdf6e24fd3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 6 Nov 2024 16:19:26 +0100 Subject: [PATCH] Fix compare function --- 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;