aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
authorVojta Jina2011-07-08 12:18:26 +0200
committerIgor Minar2011-07-12 23:04:46 -0700
commit10da625ed93511dbf5d4e61ca4e42f6f2d478959 (patch)
tree754722015f0f677aa36c90dba2dd396430187b2c /src/jqLite.js
parent9ee9ca13da3883d06733637f9048a83d94e6f1f8 (diff)
downloadangular.js-10da625ed93511dbf5d4e61ca4e42f6f2d478959.tar.bz2
fix:jqLite: Normalize non-existing attributes to undefined as jQuery
jqLite was returning null, but jQuery returns undefined
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index 5e9d777a..a2dc02cd 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -266,7 +266,9 @@ forEach({
} else if (element.getAttribute) {
// the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
// some elements (e.g. Document) don't have get attribute, so return undefined
- return element.getAttribute(name, 2);
+ var ret = element.getAttribute(name, 2);
+ // normalize non-existing attributes to undefined (as jQuery)
+ return ret === null ? undefined : ret;
}
},