src/Server/js/caliban.js
// Polyfill for IndexOf for IE6-IE8
Polyfill for IndexOf for IE6-IE8
Polyfill for IndexOf for IE6 - IE8
function indexOfArray(theArray, searchElement) {
            if (theArray && theArray.indexOf) {
                return theArray.indexOf(searchElement);
            }
            if (!isDefined(theArray) || theArray === null) {
                return -1;
            }
            if (!theArray.length) {
                return -1;
            }
            var len = theArray.length;
            if (len === 0) {
                return -1;
            }
            var k = 0;
            while (k < len) {
                if (theArray[k] === searchElement) {
                    return k;
                }
                k++;
            }
            return -1;
        }
function indexOfArray ( theArray , searchElement ) { if ( theArray && theArray . indexOf ) { return theArray . indexOf ( searchElement ) ; } if ( ! isDefined ( theArray ) || theArray === null ) { return - 1 ; } if ( ! theArray . length ) { return - 1 ; } var len = theArray . length ; if ( len === 0 ) { return - 1 ; } var k = 0 ; while ( k < len ) { if ( theArray [ k ] === searchElement ) { return k ; } k ++ ; } return - 1 ; }
Polyfill for IndexOf for IE6-IE8
Polyfill for IndexOf for IE6 - IE8
// 1. Let O be the result of calling ToObject passing //    the this value as the argument. // 9. Repeat, while k < len // a. Let Pk be ToString(k). //   This is implicit for LHS operands of the in operator // b. Let kPresent be the result of calling the //    HasProperty internal method of O with argument Pk. //   This step can be combined with c // c. If kPresent is true, then //    i.  Let elementK be the result of calling the Get //        internal method of O with the argument ToString(k). //   ii.  Let same be the result of applying the //        Strict Equality Comparison Algorithm to //        searchElement and elementK. //  iii.  If same is true, return k.