Bug 637159 - Clean up the fix / workaround for bug 635252. r=neil
authorDão Gottwald <dao@mozilla.com>
Wed, 23 Mar 2011 12:36:25 +0100
changeset 63663 7a74654303ceaafb534eb23d39e5d7556966182d
parent 63662 197c9802e3a4b58e2542cd387e28bcf84fff183a
child 63664 104a8dd9d1562fe6ea37a3908e32b604def463de
push idunknown
push userunknown
push dateunknown
reviewersneil
bugs637159, 635252
milestone2.0b13pre
Bug 637159 - Clean up the fix / workaround for bug 635252. r=neil
toolkit/content/widgets/autocomplete.xml
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -105,34 +105,34 @@
             return Components.interfaces.nsIAccessibleProvider.XULCombobox;
           ]]>
         </getter>
       </property>
 
       <!-- =================== nsIAutoCompleteInput =================== -->
 
       <field name="popup"><![CDATA[
-        // Wrap in an anonymous function so that the var statements don't
-        // create properties on 'this'.
-        (function (that) {
-          var popup = null;
-          var popupId = that.getAttribute("autocompletepopup");
+        // Wrap in a block so that the let statements don't
+        // create properties on 'this' (bug 635252).
+        {
+          let popup = null;
+          let popupId = this.getAttribute("autocompletepopup");
           if (popupId)
             popup = document.getElementById(popupId);
           if (!popup) {
             popup = document.createElement("panel");
             popup.setAttribute("type", "autocomplete");
             popup.setAttribute("noautofocus", "true");
-  
-            var popupset = document.getAnonymousElementByAttribute(that, "anonid", "popupset");
+
+            let popupset = document.getAnonymousElementByAttribute(this, "anonid", "popupset");
             popupset.appendChild(popup);
           }
-          popup.mInput = that;
-          return popup;
-        })(this);
+          popup.mInput = this;
+          popup;
+        }
       ]]></field>
 
       <property name="controller" onget="return this.mController;" readonly="true"/>
 
       <property name="popupOpen"
                 onget="return this.popup.popupOpen;"
                 onset="if (val) this.openPopup(); else this.closePopup();"/>