Bug 1602069 - Enable ESLint no-undef rule for accessible/test/mochitest html files. r=Jamie
authorMark Banner <standard8@mozilla.com>
Sun, 08 Dec 2019 23:59:28 +0000
changeset 568156 84fddf1ffad6338620e58f4561efbf46ace65ce1
parent 568155 61a83433f7019f4d1bd233b455ae089699aa99bb
child 568157 c4c1422991dca736ff1cca8ba8b3254eae0ff848
push id12493
push userffxbld-merge
push dateMon, 06 Jan 2020 15:38:57 +0000
treeherdermozilla-beta@63ae456b848d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamie
bugs1602069
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1602069 - Enable ESLint no-undef rule for accessible/test/mochitest html files. r=Jamie Depends on D56230 Differential Revision: https://phabricator.services.mozilla.com/D56231
accessible/tests/mochitest/.eslintrc.js
accessible/tests/mochitest/elm/test_MathMLSpec.html
accessible/tests/mochitest/events/docload/test_docload_root.html
accessible/tests/mochitest/hittest/test_canvas_hitregion.html
accessible/tests/mochitest/role/test_aria.html
accessible/tests/mochitest/selectable/test_aria.html
accessible/tests/mochitest/states/test_frames.html
accessible/tests/mochitest/table/test_headers_ariagrid.html
accessible/tests/mochitest/table/test_headers_ariatable.html
accessible/tests/mochitest/table/test_table_2.html
accessible/tests/mochitest/test_OuterDocAccessible.html
accessible/tests/mochitest/test_nsIAccessibleDocument.html
accessible/tests/mochitest/test_nsIAccessibleImage.html
accessible/tests/mochitest/textattrs/test_general.html
accessible/tests/mochitest/textrange/test_general.html
accessible/tests/mochitest/tree/test_aria_menu.html
accessible/tests/mochitest/treeupdate/test_ariahidden.html
accessible/tests/mochitest/treeupdate/test_bug1276857.html
accessible/tests/mochitest/treeupdate/test_optgroup.html
accessible/tests/mochitest/treeupdate/test_select.html
accessible/tests/mochitest/treeupdate/test_table.html
--- a/accessible/tests/mochitest/.eslintrc.js
+++ b/accessible/tests/mochitest/.eslintrc.js
@@ -6,15 +6,18 @@ module.exports = {
     // disabled here due to failures when initially implemented. They should be
     // removed (and hence enabled) at some stage.
     "no-nested-ternary": "off",
   },
 
   "overrides": [{
     "files": [
       "*.xhtml",
-      "*.html",
+      // Bug 1602061 TODO: These tests access DOM elements via
+      // id-as-variable-name, which eslint doesn't have support for yet.
+      "attributes/test_listbox.html",
+      "treeupdate/test_ariaowns.html",
     ],
     "rules": {
       "no-undef": "off",
     }
   }]
 };
--- a/accessible/tests/mochitest/elm/test_MathMLSpec.html
+++ b/accessible/tests/mochitest/elm/test_MathMLSpec.html
@@ -22,17 +22,17 @@
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript">
     function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // math
 
-      obj = {
+      let obj = {
         role: ROLE_MATHML_MATH,
       };
       testElm("math", obj);
 
       // ////////////////////////////////////////////////////////////////////////
       // mi
 
       obj = {
--- a/accessible/tests/mochitest/events/docload/test_docload_root.html
+++ b/accessible/tests/mochitest/events/docload/test_docload_root.html
@@ -33,17 +33,17 @@
         } catch (e) {
           ok(false, `Can't get parent for ${prettyName(docAcc)}`);
           throw e;
         }
       }
 
       this.eventSeq = [ new invokerChecker(EVENT_REORDER, gRootAcc) ];
 
-      this.invoke = () => (gDialog = docShell.rootTreeItem.domWindow.openDialog(aURL));
+      this.invoke = () => (gDialog = window.docShell.rootTreeItem.domWindow.openDialog(aURL));
 
       this.finalCheck = () => {
         const accTree = {
           role: ROLE_APP_ROOT,
           children: [
             {
               role: ROLE_CHROME_WINDOW,
             },
--- a/accessible/tests/mochitest/hittest/test_canvas_hitregion.html
+++ b/accessible/tests/mochitest/hittest/test_canvas_hitregion.html
@@ -51,17 +51,17 @@
       var [hitX, hitY /* hitWidth, hitHeight */] = getBounds(hitcanvas);
       var [deltaX, deltaY] = CSSToDevicePixels(window, offsetX, offsetY);
 
       var docAcc = getAccessible(document);
 
       // test if we hit the region associated with the shadow dom checkbox
       var tgtX = hitX + deltaX;
       var tgtY = hitY + deltaY;
-      hitAcc = docAcc.getDeepestChildAtPoint(tgtX, tgtY);
+      let hitAcc = docAcc.getDeepestChildAtPoint(tgtX, tgtY);
       isObject(hitAcc, hitcheck, `Hit match at (${tgtX}, ${tgtY}`);
 
       // test that we don't hit the region associated with the shadow dom checkbox
       tgtY = hitY + deltaY * 2;
       hitAcc = docAcc.getDeepestChildAtPoint(tgtX, tgtY);
       isObject(hitAcc, hitcanvas, `Hit match at (${tgtX}, ${tgtY}`);
 
       SimpleTest.finish();
--- a/accessible/tests/mochitest/role/test_aria.html
+++ b/accessible/tests/mochitest/role/test_aria.html
@@ -105,42 +105,42 @@
       // strong landmark
       testRole("application", ROLE_APPLICATION);
       testRole("form", ROLE_FORM);
       testRole("application_table", ROLE_APPLICATION);
 
       // landmarks
       let landmarks = ["banner", "complementary", "contentinfo",
           "main", "navigation", "search"];
-      for (l in landmarks) {
+      for (const l in landmarks) {
         testRole(landmarks[l], ROLE_LANDMARK);
       }
 
-      for (l in landmarks) {
+      for (const l in landmarks) {
         let id = landmarks[l] + "_table";
         testRole(id, ROLE_LANDMARK);
-    
+
         let accessibleTable = getAccessible(id, [nsIAccessibleTable], null,
                                             DONOTFAIL_IF_NO_INTERFACE);
         ok(!!accessibleTable, "landmarked table should have nsIAccessibleTable");
-    
+
         if (accessibleTable)
           is(accessibleTable.getCellAt(0, 0).firstChild.name, "hi", "no cell");
       }
 
       // ////////////////////////////////////////////////////////////////////////
       // test gEmptyRoleMap
       testRole("buttontable_row", ROLE_NOTHING);
       testRole("buttontable_cell", ROLE_NOTHING);
 
       // abstract roles
       var abstract_roles = ["composite", "landmark", "structure", "widget",
                             "window", "input", "range", "select", "section",
                             "sectionhead"];
-      for (a in abstract_roles)
+      for (const a in abstract_roles)
         testRole(abstract_roles[a], ROLE_SECTION);
 
       // ////////////////////////////////////////////////////////////////////////
       // roles transformed by ARIA state attributes
       testRole("togglebutton", ROLE_TOGGLE_BUTTON);
       testRole("implicit_gridcell", ROLE_GRID_CELL);
 
       // ////////////////////////////////////////////////////////////////////////
@@ -363,18 +363,18 @@
   <div role="scrollbar" id="scrollbar">scrollbar</div>
 
   <div id="dir" role="directory">
     <div role="listitem">A</div>
     <div role="listitem">B</div>
     <div role="listitem">C</div>
   </div>
 
-  <p>Image: 
+  <p>Image:
     <img id="img_eq" role="math" src="foo" alt="x^2 + y^2 + z^2">
   </p>
 
-  <p>Text: 
-    <span id="txt_eq" role="math" title="x^2 + y^2 + z^2">x<sup>2</sup> + 
+  <p>Text:
+    <span id="txt_eq" role="math" title="x^2 + y^2 + z^2">x<sup>2</sup> +
       y<sup>2</sup> + z<sup>2</sup></span>
 
 </body>
 </html>
--- a/accessible/tests/mochitest/selectable/test_aria.html
+++ b/accessible/tests/mochitest/selectable/test_aria.html
@@ -31,32 +31,32 @@
       acc.unselectAll();
       testSelectableSelection(acc, []);
     }
 
     function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // role="tablist"
 
-      id = "tablist_single";
+      let id = "tablist_single";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
 
       // ////////////////////////////////////////////////////////////////////////
       // role="tablist" aria-multiselectable
 
       id = "tablist_multi";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
 
-      select = getAccessible(id, [nsIAccessibleSelectable]);
+      let select = getAccessible(id, [nsIAccessibleSelectable]);
       select.addItemToSelection(0);
       testSelectableSelection(id, [ "tab_multi1" ]);
       select.removeItemFromSelection(0);
       testSelectableSelection(id, [ ]);
       select.selectAll();
       testSelectableSelection(id, [ "tab_multi1", "tab_multi2" ]);
       select.unselectAll();
       testSelectableSelection(id, [ ]);
@@ -83,17 +83,17 @@
       select.addItemToSelection(0);
       testSelectableSelection(id, [ "listbox2_item1" ]);
       select.removeItemFromSelection(0);
       testSelectableSelection(id, [ ]);
       select.selectAll();
       testSelectableSelection(id, [ "listbox2_item1", "listbox2_item2" ]);
       select.unselectAll();
       testSelectableSelection(id, [ ]);
-    
+
       // ////////////////////////////////////////////////////////////////////////
       // role="grid"
 
       id = "grid1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
--- a/accessible/tests/mochitest/states/test_frames.html
+++ b/accessible/tests/mochitest/states/test_frames.html
@@ -16,20 +16,20 @@
           src="../states.js"></script>
 
   <script type="application/javascript">
     if (navigator.platform.startsWith("Win")) {
       SimpleTest.expectAssertions(0, 2);
     }
 
     function doTest() {
-      frameDoc = document.getElementById("frame_doc").contentDocument;
-      frameDocArticle = document.getElementById("frame_doc_article").contentDocument;
-      frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument;
-      frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument;
+      const frameDoc = document.getElementById("frame_doc").contentDocument;
+      const frameDocArticle = document.getElementById("frame_doc_article").contentDocument;
+      const frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument;
+      const frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument;
 
       testStates(frameDoc, STATE_READONLY, 0, 0, 0,
                  "test1: frameDoc");
       testStates(frameDocArticle, STATE_READONLY, 0, 0, 0,
                  "test1: frameDocArticle");
       testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0,
                  "test1: frameDocCheckbox");
       testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
--- a/accessible/tests/mochitest/table/test_headers_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_headers_ariagrid.html
@@ -14,17 +14,17 @@
           src="../table.js"></script>
 
   <script type="application/javascript">
 
     function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // column and row headers from markup
 
-      headerInfoMap = [
+      let headerInfoMap = [
         {
           cell: "table_dc_1",
           rowHeaderCells: [ "table_rh_1" ],
           columnHeaderCells: [ "table_ch_2" ],
         },
         {
           cell: "table_dc_2",
           rowHeaderCells: [ "table_rh_1" ],
--- a/accessible/tests/mochitest/table/test_headers_ariatable.html
+++ b/accessible/tests/mochitest/table/test_headers_ariatable.html
@@ -14,17 +14,17 @@
           src="../table.js"></script>
 
   <script type="application/javascript">
 
     function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // column and row headers from markup
 
-      headerInfoMap = [
+      const headerInfoMap = [
         {
           cell: "table_dc_1",
           rowHeaderCells: [ "table_rh_1" ],
           columnHeaderCells: [ "table_ch_2" ],
         },
         {
           cell: "table_dc_2",
           rowHeaderCells: [ "table_rh_1" ],
--- a/accessible/tests/mochitest/table/test_table_2.html
+++ b/accessible/tests/mochitest/table/test_table_2.html
@@ -31,17 +31,17 @@ function doTest() {
   // tr in this case.
   tableInterfaceExposed = true;
   var accTable4 = getAccessible("table4", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
   if (!accTable4)
     tableInterfaceExposed = false;
   ok(tableInterfaceExposed, "table interface is not exposed");
 
   if (tableInterfaceExposed) {
-    accNotCreated = (!isAccessible("tr"));
+    let accNotCreated = (!isAccessible("tr"));
     ok(!accNotCreated, "missed tr accessible");
 
     testRole(accTable4, ROLE_TABLE);
 
     is(accTable4.getCellAt(0, 0).firstChild.name, "cell0", "wrong cell");
     is(accTable4.getCellAt(0, 1).firstChild.name, "cell1", "wrong cell");
     is(accTable4.getCellAt(1, 0).firstChild.name, "cell2", "wrong cell");
     is(accTable4.getCellAt(1, 1).firstChild.name, "cell3", "wrong cell");
--- a/accessible/tests/mochitest/test_OuterDocAccessible.html
+++ b/accessible/tests/mochitest/test_OuterDocAccessible.html
@@ -36,33 +36,33 @@ https://bugzilla.mozilla.org/show_bug.cg
           is(outerDocAcc.name, null, "Wrong name for internal frame!");
 
           // see bug 440770, no actions wanted on outer doc
           is(outerDocAcc.actionCount, 0,
              "Wrong number of actions for internal frame!");
 
           try {
             outerDocAcc.getActionName(0);
-            do_throw("No exception thrown for actionName!");
+            throw new Error("No exception thrown for actionName!");
           } catch (e) {
             is(e.result, ns_error_invalid_arg,
                "Wrong return value for actionName call!");
           }
 
           try {
-            actionTempStr = outerDocAcc.getActionDescription(0);
-            do_throw("No exception thrown for actionDescription!");
+            outerDocAcc.getActionDescription(0);
+            throw new Error("No exception thrown for actionDescription!");
           } catch (e) {
             is(e.result, ns_error_invalid_arg,
                "Wrong return value for actionDescription call!");
           }
 
           try {
             outerDocAcc.doAction(0);
-            do_throw("No exception thrown for doAction!");
+            throw new Error("No exception thrown for doAction!");
           } catch (e) {
             is(e.result, ns_error_invalid_arg,
                "Wrong return value for doAction call!");
           }
         }
       }
 
       SimpleTest.finish();
--- a/accessible/tests/mochitest/test_nsIAccessibleDocument.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleDocument.html
@@ -29,17 +29,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
         // check if it is focusable, read-only.
         testStates(docAcc, (STATE_READONLY | STATE_FOCUSABLE));
 
         // No actions wanted on doc
         is(docAcc.actionCount, 0, "Wrong number of actions for document!");
 
         // attributes should contain tag:body
-        attributes = docAcc.attributes;
+        const attributes = docAcc.attributes;
         is(attributes.getStringProperty("tag"), "body",
            "Wrong attribute on document!");
 
         // Document URL.
         var rootDir = getRootDirectory(window.location.href);
         is(docAcc.URL, rootDir + "test_nsIAccessibleDocument.html",
            "Wrong URL for document!");
 
--- a/accessible/tests/mochitest/test_nsIAccessibleImage.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleImage.html
@@ -92,17 +92,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       // bug 429659: Make sure the SRC attribute is set for any image
       var attributes = {"src": aSRC};
       testAttrs(acc, attributes, true);
 
       var actionCount = aActionCount || 0;
       is(acc.actionCount, actionCount,
          "Wrong number of actions for " + aID + "!");
       if (actionCount) {
-        for (index = 0; index < aActionNames.length; index++) {
+        for (let index = 0; index < aActionNames.length; index++) {
           is(acc.getActionName(index), aActionNames[index],
              "Wrong action name for " + aID + ", index " + index + "!");
         }
       }
     }
 
     function doTest() {
       // Test non-linked image
--- a/accessible/tests/mochitest/textattrs/test_general.html
+++ b/accessible/tests/mochitest/textattrs/test_general.html
@@ -551,17 +551,17 @@
       // unexpected.
       ID = "area19";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
 
       attrs = {};
       testTextAttrs(ID, 0, attrs, defAttrs, 0, 10);
 
       ID = "area19mark";
-      defMarkAttrs = buildDefaultTextAttrs(ID, "12pt");
+      let defMarkAttrs = buildDefaultTextAttrs(ID, "12pt");
       attrs = {};
       testTextAttrs(ID, 0, attrs, defMarkAttrs, 0, 7);
 
       ID = "area19";
       attrs = {};
       testTextAttrs(ID, 11, attrs, defAttrs, 11, 22);
 
        // ////////////////////////////////////////////////////////////////////////
--- a/accessible/tests/mochitest/textrange/test_general.html
+++ b/accessible/tests/mochitest/textrange/test_general.html
@@ -17,17 +17,17 @@
     function doTest() {
       // enclosingRange
       var input = getAccessible("input", [ nsIAccessibleText ]);
       testTextRange(input.enclosingRange, "enclosing range for 'input'",
                     input, 0, input, 5, "hello", input);
 
       var ta = getAccessible("textarea", [ nsIAccessibleText ]);
       testTextRange(ta.enclosingRange, "enclosing range for 'textarea'",
-                    ta, 0, ta, 5, "hello", textarea);
+                    ta, 0, ta, 5, "hello", ta);
 
       var iframeDocNode = getNode("iframe").contentDocument;
       var iframeDoc = getAccessible(iframeDocNode, [ nsIAccessibleText ]);
       testTextRange(iframeDoc.enclosingRange, "enclosing range for iframe doc",
                     iframeDoc, 0, iframeDoc, 1, "hello",
                     iframeDoc, [ getNode("p", iframeDocNode) ]);
 
       // getRangeByChild
--- a/accessible/tests/mochitest/tree/test_aria_menu.html
+++ b/accessible/tests/mochitest/tree/test_aria_menu.html
@@ -10,17 +10,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="application/javascript">
   function doTest() {
     // Menuitem with no popup.
-    tree =
+    let tree =
       { SECTION: [ // container
         { MENUPOPUP: [ // menu
           { MENUITEM: [
             { STATICTEXT: [] }, // bullet
             { TEXT_LEAF: [] },
           ] },
         ] },
       ] };
--- a/accessible/tests/mochitest/treeupdate/test_ariahidden.html
+++ b/accessible/tests/mochitest/treeupdate/test_ariahidden.html
@@ -87,17 +87,17 @@
         return "t2: insert under aria-hidden";
       };
     }
 
     // gA11yEventDumpToConsole = true;
     function doTests() {
       ok(!isAccessible("t1_child"), "No accessible for aria-hidden");
 
-      gQueue = new eventQueue();
+      const gQueue = new eventQueue();
       gQueue.push(new t1_removeARIAHidden());
       gQueue.push(new t1_setARIAHidden());
       gQueue.push(new t2_setARIAHidden());
       gQueue.push(new t2_insertUnderARIAHidden());
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/treeupdate/test_bug1276857.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1276857.html
@@ -71,16 +71,17 @@
           SECTION: [ // c2
             { TEXT_LEAF: [] }, // Some text
             { TEXT_CONTAINER: [
               { TEXT_LEAF: [] }, // something with ..
             ] },
             { TEXT_LEAF: [] }, // More text
           ],
         };
+        const iframe = document.getElementById("iframe");
         testAccessibleTree(iframe.contentDocument.getElementById("c2"), tree);
 
         var shadowRoot = iframe.contentDocument.getElementById("c2_c").shadowRoot;
         shadowRoot.firstElementChild.querySelector("span").remove();
         // bug 1487312
         shadowRoot.firstElementChild.offsetTop;
         shadowRoot.appendChild(document.createElement("button"));
       };
@@ -88,16 +89,17 @@
       this.finalCheck = function runShadowTest_finalCheck() {
         var tree = {
           SECTION: [ // c2
             { TEXT_LEAF: [] }, // Some text
             { TEXT_LEAF: [] }, // More text
             { PUSHBUTTON: [] }, // The button we appended.
           ],
         };
+        const iframe = document.getElementById("iframe");
         testAccessibleTree(iframe.contentDocument.getElementById("c2"), tree);
       };
 
       this.getID = function runShadowTest_getID() {
         return "child DOM node is removed before the layout notifies the a11y about parent removal/show in shadow DOM";
       };
     }
 
--- a/accessible/tests/mochitest/treeupdate/test_optgroup.html
+++ b/accessible/tests/mochitest/treeupdate/test_optgroup.html
@@ -18,17 +18,17 @@
 
     function addOptGroup(aID) {
       this.selectNode = getNode(aID);
       this.select = getAccessible(this.selectNode);
       this.selectList = this.select.firstChild;
 
       this.invoke = function addOptGroup_invoke() {
         var optGroup = document.createElement("optgroup");
-        for (i = 0; i < 2; i++) {
+        for (let i = 0; i < 2; i++) {
           var opt = document.createElement("option");
           opt.value = i;
           opt.text = "Option: Value " + i;
 
           optGroup.appendChild(opt);
         }
 
         this.selectNode.add(optGroup, null);
@@ -91,17 +91,17 @@
       this.getID = function removeOptGroup_getID() {
         return "test optgroup's removal from a select";
       };
     }
 
     // gA11yEventDumpToConsole = true;
 
     function doTest() {
-      gQueue = new eventQueue();
+      const gQueue = new eventQueue();
 
       gQueue.push(new addOptGroup("select"));
       gQueue.push(new removeOptGroup("select"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/treeupdate/test_select.html
+++ b/accessible/tests/mochitest/treeupdate/test_select.html
@@ -17,17 +17,17 @@
   <script type="application/javascript">
 
     function addOptions(aID) {
       this.selectNode = getNode(aID);
       this.select = getAccessible(this.selectNode);
       this.selectList = this.select.firstChild;
 
       this.invoke = function addOptions_invoke() {
-        for (i = 0; i < 2; i++) {
+        for (let i = 0; i < 2; i++) {
           var opt = document.createElement("option");
           opt.value = i;
           opt.text = "Option: Value " + i;
 
           this.selectNode.add(opt, null);
         }
       };
 
@@ -106,17 +106,17 @@
       };
 
       this.getID = function removeptions_getID() {
         return "setting @href on select option";
       };
     }
 
     function doTest() {
-      gQueue = new eventQueue();
+      const gQueue = new eventQueue();
 
       gQueue.push(new addOptions("select"));
       gQueue.push(new removeOptions("select"));
       gQueue.push(new setHrefOnOption());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/treeupdate/test_table.html
+++ b/accessible/tests/mochitest/treeupdate/test_table.html
@@ -44,17 +44,17 @@
       };
 
       this.getID = function appendCaption_getID() {
         return "append caption";
       };
     }
 
     function doTest() {
-      gQueue = new eventQueue();
+      const gQueue = new eventQueue();
       gQueue.push(new appendCaption("table"));
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>