Avoid using arguments.callee in dom.js.
This commit is contained in:
parent
b74eeeb757
commit
1cda280a72
@ -61,6 +61,7 @@ if (!Node.ELEMENT_NODE) {
|
||||
})(this);
|
||||
|
||||
Element.cache = { };
|
||||
Element.idCounter = 1;
|
||||
|
||||
Element.Methods = {
|
||||
visible: function(element) {
|
||||
@ -266,9 +267,9 @@ Element.Methods = {
|
||||
|
||||
identify: function(element) {
|
||||
element = $(element);
|
||||
var id = element.readAttribute('id'), self = arguments.callee;
|
||||
var id = element.readAttribute('id');
|
||||
if (id) return id;
|
||||
do { id = 'anonymous_element_' + self.counter++ } while ($(id));
|
||||
do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
|
||||
element.writeAttribute('id', id);
|
||||
return id;
|
||||
},
|
||||
@ -646,8 +647,6 @@ Element.Methods = {
|
||||
}
|
||||
};
|
||||
|
||||
Element.Methods.identify.counter = 1;
|
||||
|
||||
Object.extend(Element.Methods, {
|
||||
getElementsBySelector: Element.Methods.select,
|
||||
childElements: Element.Methods.immediateDescendants
|
||||
|
Loading…
Reference in New Issue
Block a user