@@ -81,6 +81,27 @@ function noConflict() {
8181 return a ;
8282}
8383
84+ /**
85+ * @private
86+ * @param {* } obj
87+ * @return {boolean } Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
88+ */
89+ function isArrayLike ( obj ) {
90+ if ( ! obj || ( typeof obj . length !== 'number' ) ) return false ;
91+
92+ // We have on object which has length property. Should we treat it as array?
93+ if ( typeof obj . hasOwnProperty != 'function' &&
94+ typeof obj . constructor != 'function' ) {
95+ // This is here for IE8: it is a bogus object treat it as array;
96+ return true ;
97+ } else {
98+ return obj instanceof JQLite || // JQLite
99+ ( jQuery && obj instanceof jQuery ) || // jQuery
100+ toString . call ( obj ) !== '[object Object]' || // some browser native object
101+ typeof obj . callee === 'function' ; // arguments (on IE8 looks like regular obj)
102+ }
103+ }
104+
84105/**
85106 * @ngdoc function
86107 * @name angular.forEach
@@ -108,30 +129,6 @@ function noConflict() {
108129 * @param {Object= } context Object to become context (`this`) for the iterator function.
109130 * @returns {Object|Array } Reference to `obj`.
110131 */
111-
112-
113- /**
114- * @private
115- * @param {* } obj
116- * @return {boolean } Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
117- */
118- function isArrayLike ( obj ) {
119- if ( ! obj || ( typeof obj . length !== 'number' ) ) return false ;
120-
121- // We have on object which has length property. Should we treat it as array?
122- if ( typeof obj . hasOwnProperty != 'function' &&
123- typeof obj . constructor != 'function' ) {
124- // This is here for IE8: it is a bogus object treat it as array;
125- return true ;
126- } else {
127- return obj instanceof JQLite || // JQLite
128- ( jQuery && obj instanceof jQuery ) || // jQuery
129- toString . call ( obj ) !== '[object Object]' || // some browser native object
130- typeof obj . callee === 'function' ; // arguments (on IE8 looks like regular obj)
131- }
132- }
133-
134-
135132function forEach ( obj , iterator , context ) {
136133 var key ;
137134 if ( obj ) {
0 commit comments