on master help sign in
Use instanceof for performance
commitc6fbc8df24b306e55da9d7d6bb4973c955d1e38c authorMax Goldstein <maxgoldstein1@gmail.com> dateThu 19 Dec 2013, 19:55 (13 years ago) parentfac00f6
1 file changed+1−1
libraries/Native/Utils.js+1−1
libraries/Native/Utils.js+1−1
@@ -25,7 +25,7 @@ Elm.Native.Utils.make = function(elm) {
2525 function compare(x,y) { return { ctor: ord[cmp(x,y)+1] } }
2626 function cmp(x,y) {
2727 var ord;
28− if (typeof x !== 'object' || x.constructor === String){
28+ if (!(x instanceof Object) || x instanceof String){
2929 return x === y ? EQ : x < y ? LT : GT;
3030 }
3131