From 1cda280a72db2ab0e6ee604ee940a33a3f2996e8 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Thu, 11 Dec 2008 17:05:09 +0100 Subject: [PATCH] Avoid using arguments.callee in dom.js. --- src/dom/dom.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index d065202..0b59ca1 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -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