A
Aaron Gray
RobG said:Aaron Gray meinte:
Dunno...
line 6:
var isIE = /*@cc_on!@*/false;
I guess it does that because shortly afterward it does:
var pushAll = function (set1, set2) {
for (var j=0, jL=set2.length; j<jL; j++) {
set1.push(set2[j]);
}
return set1;
};
if (isIE) {
pushAll = function (set1, set2) {
if (set2.slice) {
return set1.concat(set2);
}
for (var i=0, iL=set2.length; i<iL; i++) {
set1[set1.length] = set2;
}
return set1;
};
}
[...]And why would one want to do something like that:
Because the author(s) do no know how to implement effective feature
detection?
How about:
var HTMLArray = function () {
// Constructor
};
...
if (isIE) {
HTMLArray = Array;
}
HTMLArray.prototype = [];
HTMLArray.prototype.each = function (functionCall) {
Which extends Array.prototype in IE with an each method, but in other
browsers extends a generic array object.
Yeah, there are bits of cruft in the code.
Aaron