Skip to content

Commit

Permalink
Merge pull request ocsigen#658 from cpitclaudel/cpitclaudel_fix_caml_…
Browse files Browse the repository at this point in the history
…compare_val

runtime: Fix ocsigenGH-657
  • Loading branch information
hhugo authored Apr 7, 2018
2 parents c5de3ba + 2dfb87d commit 1dd4860
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/stdlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ function caml_compare_val (a, b, total) {
(b instanceof Array && b[0] === (b[0]|0))) {
return -1;
} else if (typeof a != "number" && a && a.compare) {
return a.compare(b,total);
var cmp = a.compare(b,total);
if (cmp != 0) return cmp;
} else if (typeof a == "function") {
caml_invalid_argument("compare: functional value");
} else {
Expand Down

0 comments on commit 1dd4860

Please sign in to comment.