aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorIgor Minar2011-01-09 23:21:48 -0800
committerIgor Minar2011-01-10 10:24:12 -0800
commit84dedb81e79a56b4c81fe413a41e7247d8fa0572 (patch)
treee46e58cd4890ff4607d47a85546417db57ded735 /src/Angular.js
parente99974004480d968d3fe37ee57540e72bbc96098 (diff)
downloadangular.js-84dedb81e79a56b4c81fe413a41e7247d8fa0572.tar.bz2
jqLite should recognize window as an element even in IE
in IE window object has length property which makes it look like a collection to jqLite. This commit makes jqLite properly identify window as an element even in IE. IE6 doesn't have Window type, so we need to check against window object and only then do a more general check against Window. This is not perfect, but I say screw IE6.
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 8ada7be6..060e08c1 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -400,6 +400,17 @@ function isArray(value) { return value instanceof Array; }
function isFunction(value){ return typeof value == $function;}
+/**
+ * Checks if `obj` is a window object.
+ *
+ * @private
+ * @param {*} obj Object to check
+ * @returns {boolean} True if `obj` is a window obj.
+ */
+function isWindow(obj) {
+ return obj && obj.document && obj.location && obj.alert && obj.setInterval;
+}
+
function isBoolean(value) { return typeof value == $boolean;}
function isTextNode(node) { return nodeName_(node) == '#text'; }
function trim(value) { return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value; }