rem: keyComparator: function (key/* ... */) { /***  A comparator factory that compares a[key] with b[key]. e.g.:  var lst = ["a", "bbb", "cc"]; lst.sort(keyComparator("length")); assert(lst.toString() == "a,cc,bbb");  ***/  var m = MochiKit.Base; var compare = m.compare; if (arguments.length == 1) { return function (a, b) { return compare(a[key], b[key]); } } var compareKeys = m.extend(null, arguments); return function (a, b) { var rval = 0;   for (var i = 0; (rval == 0) && (i < compareKeys.length); i++) { var key = compareKeys[i]; rval = compare(a[key], b[key]); } return rval; }; }, 
add: },keyComparator:function(key){ var m=MochiKit.Base; var _88=m.compare; if(arguments.length==1){ return function(a,b){ return _88(a[key],b[key]); }; } var _89=m.extend(null,arguments); return function(a,b){ var _90=0; for(var i=0;(_90==0)&&(i<_89.length);i++){ var key=_89[i]; _90=_88(a[key],b[key]); } return _90; }; },reverseKeyComparator:function(key){ 
context:     keyComparator: function (key/* ... */) {        /***            A comparator factory that compares a[key] with b[key].            e.g.:                var lst = ["a", "bbb", "cc"];                lst.sort(keyComparator("length"));                assert(lst.toString() == "a,cc,bbb");        ***/        // fast-path for single key comparisons        var m = MochiKit.Base;        var compare = m.compare;        if (arguments.length == 1) {            return function (a, b) {                return compare(a[key], b[key]);            }        }        var compareKeys = m.extend(null, arguments);        return function (a, b) {            var rval = 0;            // keep comparing until something is inequal or we run out of            // keys to compare            for (var i = 0; (rval == 0) && (i < compareKeys.length); i++) {                var key = compareKeys[i];                rval = compare(a[key], b[key]);            }            return rval;        };    },
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/ad067b3f5d648d6df90ec6fb2b79f0027612a307/MochiKit.js/buggy/trunk/lib/MochiKit.js