Changeset 9615
- Timestamp:
- 07/12/07 13:34:03 (18 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/_base/array.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/_base/array.js
r9589 r9615 4 4 (function(){ 5 5 var d = dojo; 6 var tn = ["indexOf", "lastIndexOf", "every", "some", "forEach", "filter", "map"]; 7 var makeCall = function(fn){ 8 return function(a){ 9 a[fn].apply(a, Array.prototype.slice.call(arguments, 1)); 10 } 11 }; 6 12 if(Array.forEach){ 7 13 // fast, if we can 8 var tn = ["indexOf", "lastIndexOf", "every", "some", "forEach", "filter", "map"];9 14 for(var x=0; x<tn.length; x++){ 10 15 d[tn[x]] = Array[tn[x]]; 16 } 17 }else if(Array.prototype.forEach){ 18 // safari3 only exposes the fast methods on the prototype 19 for(var x=0; x<tn.length; x++) { 20 d[tn[x]] = makeCall(tn[x]); // have to do this to bind the looped var 11 21 } 12 22 }else{