on master help sign in
Merge pull request #399 from mgold/char-compare
39769b7Evan Czaplicki
libraries/Native/Utils.js+3−1
@@ -25,7 +25,9 @@ Elm.Native.Utils.make = function(elm) {
25 function compare(x,y) { return { ctor: ord[cmp(x,y)+1] } }
25 function compare(x,y) { return { ctor: ord[cmp(x,y)+1] } }
26 function cmp(x,y) {
26 function cmp(x,y) {
27 var ord;
27 var ord;
28+ if (typeof x !== 'object' || x instanceof String){
28− if (typeof x !== 'object') return x === y ? EQ : x < y ? LT : GT;
29+ return x === y ? EQ : x < y ? LT : GT;
30+ }
29
31
30 if (x.ctor === "::" || x.ctor === "[]") {
32 if (x.ctor === "::" || x.ctor === "[]") {
31 while (true) {
33 while (true) {