@@ -61,6 +61,29 @@ var /** holds major version number for IE or NaN for real browsers */
61
61
nodeName_ ,
62
62
uid = [ '0' , '0' , '0' ] ;
63
63
64
+
65
+ /**
66
+ * @private
67
+ * @param {* } obj
68
+ * @return {boolean } Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
69
+ */
70
+ function isArrayLike ( obj ) {
71
+ if ( ! obj || ( typeof obj . length !== 'number' ) ) return false ;
72
+
73
+ // We have on object which has length property. Should we treat it as array?
74
+ if ( typeof obj . hasOwnProperty != 'function' &&
75
+ typeof obj . constructor != 'function' ) {
76
+ // This is here for IE8: it is a bogus object treat it as array;
77
+ return true ;
78
+ } else {
79
+ return obj instanceof JQLite || // JQLite
80
+ ( jQuery && obj instanceof jQuery ) || // jQuery
81
+ toString . call ( obj ) !== '[object Object]' || // some browser native object
82
+ typeof obj . callee === 'function' ; // arguments (on IE8 looks like regular obj)
83
+ }
84
+ }
85
+
86
+
64
87
/**
65
88
* @ngdoc function
66
89
* @name angular.forEach
@@ -88,30 +111,6 @@ var /** holds major version number for IE or NaN for real browsers */
88
111
* @param {Object= } context Object to become context (`this`) for the iterator function.
89
112
* @returns {Object|Array } Reference to `obj`.
90
113
*/
91
-
92
-
93
- /**
94
- * @private
95
- * @param {* } obj
96
- * @return {boolean } Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
97
- */
98
- function isArrayLike ( obj ) {
99
- if ( ! obj || ( typeof obj . length !== 'number' ) ) return false ;
100
-
101
- // We have on object which has length property. Should we treat it as array?
102
- if ( typeof obj . hasOwnProperty != 'function' &&
103
- typeof obj . constructor != 'function' ) {
104
- // This is here for IE8: it is a bogus object treat it as array;
105
- return true ;
106
- } else {
107
- return obj instanceof JQLite || // JQLite
108
- ( jQuery && obj instanceof jQuery ) || // jQuery
109
- toString . call ( obj ) !== '[object Object]' || // some browser native object
110
- typeof obj . callee === 'function' ; // arguments (on IE8 looks like regular obj)
111
- }
112
- }
113
-
114
-
115
114
function forEach ( obj , iterator , context ) {
116
115
var key ;
117
116
if ( obj ) {
0 commit comments