fix(jqLite): change expando property to a more unique name

This was causing issue when element === window
A better strategy can be thought of later on.
This commit is contained in:
rodyhaddad
2014-06-13 16:23:42 -07:00
parent a4faa5cde7
commit 74e1cc683b

View File

@@ -98,7 +98,7 @@
* @returns {Object} jQuery object.
*/
JQLite.expando = 'ng';
JQLite.expando = 'ng339';
var jqCache = JQLite.cache = {},
jqId = 1,
@@ -310,7 +310,7 @@ function jqLiteOff(element, type, fn, unsupported) {
}
function jqLiteRemoveData(element, name) {
var expandoId = element.ng,
var expandoId = element.ng339,
expandoStore = jqCache[expandoId];
if (expandoStore) {
@@ -324,17 +324,17 @@ function jqLiteRemoveData(element, name) {
jqLiteOff(element);
}
delete jqCache[expandoId];
element.ng = undefined; // don't delete DOM expandos. IE and Chrome don't like it
element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it
}
}
function jqLiteExpandoStore(element, key, value) {
var expandoId = element.ng,
var expandoId = element.ng339,
expandoStore = jqCache[expandoId || -1];
if (isDefined(value)) {
if (!expandoStore) {
element.ng = expandoId = jqNextId();
element.ng339 = expandoId = jqNextId();
expandoStore = jqCache[expandoId] = {};
}
expandoStore[key] = value;