Bug 1577746 - Enable ESLint rule dot-notation for dom/. r=baku
authorMark Banner <standard8@mozilla.com>
Mon, 02 Sep 2019 11:23:05 +0000
changeset 491144 0c1543381629aae163598a82d706b3426e73928b
parent 491143 3b3c5e0e1bc4a58d8a7d5718745cc41153e06a76
child 491145 8459bff03c9544c8ad7dbe396fa66909635fec50
push id36522
push userdluca@mozilla.com
push dateMon, 02 Sep 2019 21:36:35 +0000
treeherdermozilla-central@0fe8d7dd713d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1577746
milestone70.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 1577746 - Enable ESLint rule dot-notation for dom/. r=baku Depends on D44149 Differential Revision: https://phabricator.services.mozilla.com/D44150
.eslintrc.js
dom/base/test/referrerHelper.js
dom/base/test/test_bug338583.html
dom/base/test/test_bug375314.html
dom/base/test/test_bug707142.html
dom/base/test/test_bug891952.html
dom/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html
dom/encoding/test/test_TLD.html
dom/events/test/pointerevents/mochitest_support_internal.js
dom/events/test/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
dom/events/test/pointerevents/pointerevent_releasepointercapture_invalid_pointerid-manual.html
dom/events/test/pointerevents/pointerevent_setpointercapture_invalid_pointerid-manual.html
dom/events/test/test_bug822898.html
dom/events/test/test_dom_wheel_event.html
dom/html/test/forms/test_bug1286509.html
dom/html/test/forms/test_input_typing_sanitization.html
dom/html/test/forms/test_meter_element.html
dom/html/test/forms/test_output_element.html
dom/html/test/forms/test_progress_element.html
dom/html/test/test_bug1261673.html
dom/html/test/test_bug1261674-1.html
dom/html/test/test_bug1261674-2.html
dom/html/test/test_bug332893-4.html
dom/html/test/test_bug332893-5.html
dom/html/test/test_bug332893-6.html
dom/html/test/test_bug332893-7.html
dom/html/test/test_bug353415-1.html
dom/html/test/test_bug353415-2.html
dom/html/test/test_bug481440.html
dom/html/test/test_bug529819.html
dom/html/test/test_bug567938-1.html
dom/html/test/test_bug567938-2.html
dom/html/test/test_bug567938-3.html
dom/media/webspeech/recognition/test/test_abort.html
dom/security/test/csp/test_frame_ancestors_ro.html
dom/security/test/csp/test_inlinestyle.html
dom/security/test/csp/test_multipartchannel.html
dom/security/test/csp/test_report.html
dom/security/test/csp/test_report_for_import.html
dom/security/test/general/test_block_toplevel_data_navigation.html
dom/security/test/mixedcontentblocker/test_bug803225.html
dom/security/test/mixedcontentblocker/test_frameNavigation.html
dom/security/test/mixedcontentblocker/test_main.html
dom/serviceworkers/test/fetch.js
dom/serviceworkers/test/notificationclick.js
dom/serviceworkers/test/notificationclose.js
dom/smil/test/test_smilAnimateMotionOverrideRules.xhtml
dom/tests/mochitest/bugs/bug458091_child.html
dom/tests/mochitest/bugs/test_bug458091.html
dom/tests/mochitest/chrome/489127.html
dom/tests/mochitest/chrome/test_sandbox_postMessage.html
dom/tests/mochitest/localstorage/frameKeySync.html
dom/tests/mochitest/localstorage/test_localStorageBase.html
dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html
dom/tests/mochitest/localstorage/test_localStorageBaseSessionOnly.html
dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html
dom/tests/mochitest/sessionstorage/test_sessionStorageBaseSessionOnly.html
dom/webauthn/tests/browser/browser_webauthn_telemetry.js
dom/webauthn/tests/test_webauthn_sameorigin.html
dom/workers/test/notification_worker.js
dom/xslt/tests/XSLTMark/XSLTMark-view.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -253,17 +253,16 @@ module.exports = {
       "dom/worklet/**",
       "dom/xbl/**",
       "dom/xml/**",
       "dom/xslt/**",
       "dom/xul/**",
     ],
     "rules": {
       "consistent-return": "off",
-      "dot-notation": "off",
       "mozilla/avoid-removeChild": "off",
       "mozilla/consistent-if-bracing": "off",
       "mozilla/no-arbitrary-setTimeout": "off",
       "mozilla/no-compare-against-boolean-literals": "off",
       "mozilla/no-define-cc-etc": "off",
       "mozilla/no-useless-parameters": "off",
       "mozilla/no-useless-run-test": "off",
       "mozilla/reject-importGlobalProperties": "off",
--- a/dom/base/test/referrerHelper.js
+++ b/dom/base/test/referrerHelper.js
@@ -55,29 +55,29 @@ function checkIndividualResults(testname
       var results = JSON.parse(xhr.responseText);
       info(xhr.responseText);
 
       ok(
         "img" in results,
         testname + " test: some image loads required in results object."
       );
       is(
-        results["img"].count,
+        results.img.count,
         2,
         testname + " Test: Expected 2 loads for image requests."
       );
 
       expected.forEach(function(ref) {
         ok(
-          results["img"].referrers.includes(ref),
+          results.img.referrers.includes(ref),
           testname +
             " Test: Expected " +
             ref +
             " referrer policy in test, results were " +
-            JSON.stringify(results["img"].referrers) +
+            JSON.stringify(results.img.referrers) +
             "."
         );
       });
       advance();
     },
     function(xhr) {
       ok(false, "Can't get results from the counter server.");
       SimpleTest.finish();
@@ -95,17 +95,17 @@ function checkExpectedGlobalResults(test
     function(xhr) {
       var response = JSON.parse(xhr.response);
 
       for (type in response) {
         for (scheme in response[type]) {
           for (policy in response[type][scheme]) {
             var expectedResult =
               EXPECTED_RESULTS[type] === undefined
-                ? EXPECTED_RESULTS["default"][scheme][policy]
+                ? EXPECTED_RESULTS.default[scheme][policy]
                 : EXPECTED_RESULTS[type][scheme][policy];
             is(
               response[type][scheme][policy],
               expectedResult,
               type + " " + scheme + " " + policy
             );
           }
         }
--- a/dom/base/test/test_bug338583.html
+++ b/dom/base/test/test_bug338583.html
@@ -71,27 +71,27 @@ https://bugzilla.mozilla.org/show_bug.cg
           setTestHasFinished(test_id);
         }
       }
     }, 60000 * stress_factor); // all tests together are supposed to take less than 1 minute
   }
 
   function fn_onmessage(e) {
     if (e.currentTarget == e.target && e.target.hits != null)
-      e.target.hits['fn_onmessage']++;
+      e.target.hits.fn_onmessage++;
   }
 
   function fn_event_listener_message(e) {
     if (e.currentTarget == e.target && e.target.hits != null)
-      e.target.hits['fn_event_listener_message']++;
+      e.target.hits.fn_event_listener_message++;
   }
 
   function fn_other_event_name(e) {
     if (e.currentTarget == e.target && e.target.hits != null)
-      e.target.hits['fn_other_event_name']++;
+      e.target.hits.fn_other_event_name++;
   }
 
   var gEventSourceObj1 = null, gEventSourceObj1_e, gEventSourceObj1_f;
   var gEventSourceObj2 = null;
   var gEventSourceObj3_a = null, gEventSourceObj3_b = null,
       gEventSourceObj3_c = null, gEventSourceObj3_d = null,
       gEventSourceObj3_e = null, gEventSourceObj3_f = null,
       gEventSourceObj3_g = null, gEventSourceObj3_h = null;
@@ -100,19 +100,19 @@ https://bugzilla.mozilla.org/show_bug.cg
       gEventSourceObj5_c = null, gEventSourceObj5_d = null,
       gEventSourceObj5_e = null, gEventSourceObj5_f = null;
   var gEventSourceObj6 = null;
   var gEventSourceObj7 = null;
   var stress_factor;  // used in the setTimeouts in order to help
                       // the test when running in slow machines
 
   function hasBeenHitFor1And2(obj, min) {
-    if (obj.hits['fn_onmessage'] < min ||
-        obj.hits['fn_event_listener_message'] < min ||
-        obj.hits['fn_other_event_name'] < min)
+    if (obj.hits.fn_onmessage < min ||
+        obj.hits.fn_event_listener_message < min ||
+        obj.hits.fn_other_event_name < min)
       return false;
     return true;
   }
 
 // in order to test (1):
 //   a) if the EventSource constructor parameter is equal to its url attribute
 //   b) let its fn_onmessage, fn_event_listener_message, and fn_other_event_name functions listeners be hit four times each
 //   c) the close method (we expect readyState == CLOSED)
@@ -125,21 +125,21 @@ https://bugzilla.mozilla.org/show_bug.cg
     ok(gEventSourceObj1.url == "http://mochi.test:8888/tests/dom/base/test/eventsource.resource", "Test 1.a failed.");
     ok(gEventSourceObj1.readyState == 0 || gEventSourceObj1.readyState == 1, "Test 1.a failed.");
 
     doTest1_b(test_id);
   }
 
   function doTest1_b(test_id) {
     gEventSourceObj1.hits = [];
-    gEventSourceObj1.hits['fn_onmessage'] = 0;
+    gEventSourceObj1.hits.fn_onmessage = 0;
     gEventSourceObj1.onmessage = fn_onmessage;
-    gEventSourceObj1.hits['fn_event_listener_message'] = 0;
+    gEventSourceObj1.hits.fn_event_listener_message = 0;
     gEventSourceObj1.addEventListener('message', fn_event_listener_message, true);
-    gEventSourceObj1.hits['fn_other_event_name'] = 0;
+    gEventSourceObj1.hits.fn_other_event_name = 0;
     gEventSourceObj1.addEventListener('other_event_name', fn_other_event_name, true);
 
     // the eventsources.res always use a retry of 0.5 second, so for four hits a timeout of 6 seconds is enough
     setTimeout(function(){
       bhits = hasBeenHitFor1And2(gEventSourceObj1, 4);
       ok(bhits, "Test 1.b failed.");
 
       doTest1_c(test_id);
@@ -149,19 +149,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   function doTest1_c(test_id) {
     gEventSourceObj1.close();
     ok(gEventSourceObj1.readyState == 2, "Test 1.c failed.");
 
     doTest1_d(test_id);
   }
 
   function doTest1_d(test_id) {
-    gEventSourceObj1.hits['fn_onmessage'] = 0;
-    gEventSourceObj1.hits['fn_event_listener_message'] = 0;
-    gEventSourceObj1.hits['fn_other_event_name'] = 0;
+    gEventSourceObj1.hits.fn_onmessage = 0;
+    gEventSourceObj1.hits.fn_event_listener_message = 0;
+    gEventSourceObj1.hits.fn_other_event_name = 0;
 
     setTimeout(function(){
       bhits = hasBeenHitFor1And2(gEventSourceObj1, 1);
       ok(!bhits, "Test 1.d failed.");
       gEventSourceObj1.close();
       setTestHasFinished(test_id);
     }, parseInt(2000*stress_factor));
   }
@@ -232,20 +232,20 @@ https://bugzilla.mozilla.org/show_bug.cg
 //   g) DNS error
 //   h) EventSource which last message doesn't end with an empty line. See bug 710546
 
   function doTest3(test_id) {
     gEventSourceObj3_a = new EventSource("http://example.org/tests/dom/base/test/eventsource.resource");
 
     gEventSourceObj3_a.onmessage = fn_onmessage;
     gEventSourceObj3_a.hits = [];
-    gEventSourceObj3_a.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_a.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_a.hits['fn_onmessage'] == 0, "Test 3.a failed");
+      ok(gEventSourceObj3_a.hits.fn_onmessage == 0, "Test 3.a failed");
       gEventSourceObj3_a.close();
       setTestHasFinished(test_id);
     }, parseInt(1500*stress_factor));
   }
 
   function doTest3_b(test_id) {
     // currently no support yet for local files for b2g/Android mochitest, see bug 838726
     if (navigator.appVersion.includes("Android") || SpecialPowers.Services.appinfo.name == "B2G") {
@@ -257,100 +257,100 @@ https://bugzilla.mozilla.org/show_bug.cg
     xhr.open("GET", "/dynamic/getMyDirectory.sjs", false);
     xhr.send();
     var basePath = xhr.responseText;
 
     gEventSourceObj3_b = new EventSource("file://" + basePath + "eventsource.resource");
 
     gEventSourceObj3_b.onmessage = fn_onmessage;
     gEventSourceObj3_b.hits = [];
-    gEventSourceObj3_b.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_b.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_b.hits['fn_onmessage'] == 0, "Test 3.b failed");
+      ok(gEventSourceObj3_b.hits.fn_onmessage == 0, "Test 3.b failed");
       gEventSourceObj3_b.close();
       setTestHasFinished(test_id);
     }, parseInt(1500*stress_factor));
   }
 
   function jsEvtSource()
   {
     return "event: message\n" +
            "data: 1\n\n";
   }
 
   function doTest3_c(test_id) {
     gEventSourceObj3_c = new EventSource("javascript: return jsEvtSource()");
 
     gEventSourceObj3_c.onmessage = fn_onmessage;
     gEventSourceObj3_c.hits = [];
-    gEventSourceObj3_c.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_c.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_c.hits['fn_onmessage'] == 0, "Test 3.c failed");
+      ok(gEventSourceObj3_c.hits.fn_onmessage == 0, "Test 3.c failed");
       gEventSourceObj3_c.close();
       setTestHasFinished(test_id);
     }, parseInt(1500*stress_factor));
   }
 
   function doTest3_d(test_id) {
     gEventSourceObj3_d = new EventSource("badContentType.eventsource");
 
     gEventSourceObj3_d.onmessage = fn_onmessage;
     gEventSourceObj3_d.hits = [];
-    gEventSourceObj3_d.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_d.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_d.hits['fn_onmessage'] == 0, "Test 3.d failed");
+      ok(gEventSourceObj3_d.hits.fn_onmessage == 0, "Test 3.d failed");
       gEventSourceObj3_d.close();
       setTestHasFinished(test_id);
     }, parseInt(1500*stress_factor));
   }
 
   function doTest3_e(test_id) {
     gEventSourceObj3_e = new EventSource("badHTTPResponseCode.eventsource");
 
     gEventSourceObj3_e.onmessage = fn_onmessage;
     gEventSourceObj3_e.hits = [];
-    gEventSourceObj3_e.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_e.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_e.hits['fn_onmessage'] == 0, "Test 3.e failed");
+      ok(gEventSourceObj3_e.hits.fn_onmessage == 0, "Test 3.e failed");
       gEventSourceObj3_e.close();
       setTestHasFinished(test_id);
     }, parseInt(1500*stress_factor));
   }
 
   function doTest3_f(test_id) {
     gEventSourceObj3_f = new EventSource("badMessageEvent.eventsource");
 
     gEventSourceObj3_f.onmessage = fn_onmessage;
     gEventSourceObj3_f.hits = [];
-    gEventSourceObj3_f.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_f.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_f.hits['fn_onmessage'] == 0, "Test 3.f failed");
+      ok(gEventSourceObj3_f.hits.fn_onmessage == 0, "Test 3.f failed");
       gEventSourceObj3_f.close();
       setTestHasFinished(test_id);
     }, parseInt(1500*stress_factor));
   }
 
   function fnInvalidNCName() {
     fnInvalidNCName.hits++;
   }
 
   function doTest3_g(test_id) {
     gEventSourceObj3_g = new EventSource("http://hdfskjghsbg.jtiyoejowe.dafsgbhjab.com");
 
     gEventSourceObj3_g.onmessage = fn_onmessage;
     gEventSourceObj3_g.hits = [];
-    gEventSourceObj3_g.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_g.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_g.hits['fn_onmessage'] == 0, "Test 3.g failed");
+      ok(gEventSourceObj3_g.hits.fn_onmessage == 0, "Test 3.g failed");
       gEventSourceObj3_g.close();
       setTestHasFinished(test_id);
     }, parseInt(1500*stress_factor));
   }
 
   function fnMessageListenerTest3h(e) {
     fnMessageListenerTest3h.msg_ok = (fnMessageListenerTest3h.msg_ok && e.data == "ok");
     fnMessageListenerTest3h.id_ok = (fnMessageListenerTest3h.id_ok && e.lastEventId == "");
@@ -360,21 +360,21 @@ https://bugzilla.mozilla.org/show_bug.cg
     gEventSourceObj3_h = new EventSource("badMessageEvent2.eventsource");
 
     gEventSourceObj3_h.addEventListener('message', fnMessageListenerTest3h, true);
     fnMessageListenerTest3h.msg_ok = true;
     fnMessageListenerTest3h.id_ok = true;
 
     gEventSourceObj3_h.onmessage = fn_onmessage;
     gEventSourceObj3_h.hits = [];
-    gEventSourceObj3_h.hits['fn_onmessage'] = 0;
+    gEventSourceObj3_h.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj3_h.hits['fn_onmessage'] > 1, "Test 3.h.1 failed");
-      if (gEventSourceObj3_h.hits['fn_onmessage'] > 1) {
+      ok(gEventSourceObj3_h.hits.fn_onmessage > 1, "Test 3.h.1 failed");
+      if (gEventSourceObj3_h.hits.fn_onmessage > 1) {
         ok(fnMessageListenerTest3h.msg_ok, "Test 3.h.2 failed");
         ok(fnMessageListenerTest3h.id_ok, "Test 3.h.3 failed");
       }
       gEventSourceObj3_h.close();
       setTestHasFinished(test_id);
     }, parseInt(6000*stress_factor));
   }
 
@@ -433,35 +433,35 @@ https://bugzilla.mozilla.org/show_bug.cg
 //   f) valid access-control xsite request on a restricted page when the parameter withCredentials is missing
 
   function doTest5(test_id)
   {
     gEventSourceObj5_a = new EventSource("http://example.org/tests/dom/base/test/accesscontrol.resource");
 
     gEventSourceObj5_a.onmessage = fn_onmessage;
     gEventSourceObj5_a.hits = [];
-    gEventSourceObj5_a.hits['fn_onmessage'] = 0;
+    gEventSourceObj5_a.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj5_a.hits['fn_onmessage'] != 0, "Test 5.a failed");
+      ok(gEventSourceObj5_a.hits.fn_onmessage != 0, "Test 5.a failed");
       gEventSourceObj5_a.close();
       setTestHasFinished(test_id);
     }, parseInt(3000*stress_factor));
   }
 
   function doTest5_b(test_id)
   {
     gEventSourceObj5_b = new EventSource("http://example.org/tests/dom/base/test/invalid_accesscontrol.resource");
 
     gEventSourceObj5_b.onmessage = fn_onmessage;
     gEventSourceObj5_b.hits = [];
-    gEventSourceObj5_b.hits['fn_onmessage'] = 0;
+    gEventSourceObj5_b.hits.fn_onmessage = 0;
 
     setTimeout(function() {
-      ok(gEventSourceObj5_b.hits['fn_onmessage'] == 0, "Test 5.b failed");
+      ok(gEventSourceObj5_b.hits.fn_onmessage == 0, "Test 5.b failed");
       gEventSourceObj5_b.close();
       setTestHasFinished(test_id);
     }, parseInt(3000*stress_factor));
   }
 
   function doTest5_c(test_id)
   {
     // credentials using the auth cache
@@ -476,20 +476,20 @@ https://bugzilla.mozilla.org/show_bug.cg
                                            { withCredentials: true } );
       ok(gEventSourceObj5_c.withCredentials, "Wrong withCredentials in test 5.c");
 
       gEventSourceObj5_c.onmessage = function(e) {
         ok(e.origin == "https://example.com", "Wrong Origin in test 5.c");
         fn_onmessage(e);
       };
       gEventSourceObj5_c.hits = [];
-      gEventSourceObj5_c.hits['fn_onmessage'] = 0;
+      gEventSourceObj5_c.hits.fn_onmessage = 0;
 
       setTimeout(function() {
-        ok(gEventSourceObj5_c.hits['fn_onmessage'] > 0, "Test 5.c failed");
+        ok(gEventSourceObj5_c.hits.fn_onmessage > 0, "Test 5.c failed");
         gEventSourceObj5_c.close();
         doTest5_d(test_id);
       }, parseInt(3000*stress_factor));
     };
   }
 
   function doTest5_d(test_id)
   {
@@ -502,20 +502,20 @@ https://bugzilla.mozilla.org/show_bug.cg
       gEventSourceObj5_d = new EventSource("https://example.com/tests/dom/base/test/file_restrictedEventSource.sjs?test=user2_evtsrc");
       ok(!gEventSourceObj5_d.withCredentials, "Wrong withCredentials in test 5.d");
 
       gEventSourceObj5_d.onmessage = function(e) {
         ok(e.origin == "https://example.com", "Wrong Origin in test 5.d");
         fn_onmessage(e);
       };
       gEventSourceObj5_d.hits = [];
-      gEventSourceObj5_d.hits['fn_onmessage'] = 0;
+      gEventSourceObj5_d.hits.fn_onmessage = 0;
 
       setTimeout(function() {
-        ok(gEventSourceObj5_d.hits['fn_onmessage'] == 0, "Test 5.d failed");
+        ok(gEventSourceObj5_d.hits.fn_onmessage == 0, "Test 5.d failed");
         gEventSourceObj5_d.close();
         setTestHasFinished(test_id);
       }, parseInt(3000*stress_factor));
     };
   }
 
   function doTest5_e(test_id)
   {
@@ -530,20 +530,20 @@ https://bugzilla.mozilla.org/show_bug.cg
                                            { get withCredentials() { return true; } } );
       ok(gEventSourceObj5_e.withCredentials, "Wrong withCredentials in test 5.e");
 
       gEventSourceObj5_e.onmessage = function(e) {
         ok(e.origin == "http://example.org", "Wrong Origin in test 5.e");
         fn_onmessage(e);
       };
       gEventSourceObj5_e.hits = [];
-      gEventSourceObj5_e.hits['fn_onmessage'] = 0;
+      gEventSourceObj5_e.hits.fn_onmessage = 0;
 
       setTimeout(function() {
-        ok(gEventSourceObj5_e.hits['fn_onmessage'] > 0, "Test 5.e failed");
+        ok(gEventSourceObj5_e.hits.fn_onmessage > 0, "Test 5.e failed");
         gEventSourceObj5_e.close();
         doTest5_f(test_id);
       }, parseInt(5000*stress_factor));
     };
   }
 
   function doTest5_f(test_id)
   {
@@ -557,20 +557,20 @@ https://bugzilla.mozilla.org/show_bug.cg
                                            { });
       ok(!gEventSourceObj5_f.withCredentials, "Wrong withCredentials in test 5.f");
 
       gEventSourceObj5_f.onmessage = function(e) {
         ok(e.origin == "http://example.org", "Wrong Origin in test 5.f");
         fn_onmessage(e);
       };
       gEventSourceObj5_f.hits = [];
-      gEventSourceObj5_f.hits['fn_onmessage'] = 0;
+      gEventSourceObj5_f.hits.fn_onmessage = 0;
 
       setTimeout(function() {
-        ok(gEventSourceObj5_f.hits['fn_onmessage'] == 0, "Test 5.f failed");
+        ok(gEventSourceObj5_f.hits.fn_onmessage == 0, "Test 5.f failed");
         gEventSourceObj5_f.close();
         setTestHasFinished(test_id);
       }, parseInt(3000*stress_factor));
     };
   }
 
   function doTest6(test_id)
   {
--- a/dom/base/test/test_bug375314.html
+++ b/dom/base/test/test_bug375314.html
@@ -152,17 +152,17 @@ function request_object() {
   object.setAttribute("src", testURL);
   content.appendChild(object);
 }
 
 function request_document() {
   // GeckoView shows an error page for CSP errors, which breaks this test, so just skip in that case.
   try {
     if (!SpecialPowers.Cc["@mozilla.org/android/bridge;1"].getService(SpecialPowers.Ci.nsIAndroidBridge).isFennec) {
-      lastContentType = Ci.nsIContentPolicy["TYPE_DOCUMENT"];
+      lastContentType = Ci.nsIContentPolicy.TYPE_DOCUMENT;
       return;
     }
   } catch (e){}
 
   top.location.href = testURL;
 }
 
 function request_subdocument() {
--- a/dom/base/test/test_bug707142.html
+++ b/dom/base/test/test_bug707142.html
@@ -18,20 +18,20 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
 
 /** Test for Bug 707142 **/
 
 SimpleTest.waitForExplicitFinish();
 
 var xhr = new XMLHttpRequest();
 xhr.onload = function() {
-  is(xhr.response["foo"], "bar", "Should have gotten bar on baseline");
+  is(xhr.response.foo, "bar", "Should have gotten bar on baseline");
   
   xhr.onload = function() {
-    is(xhr.response["foo"], "bar", "Should have gotten bar with BOM");
+    is(xhr.response.foo, "bar", "Should have gotten bar with BOM");
 
     xhr.onload = function() {
       is(xhr.response, null, "Should have gotten null response with UTF-16 JSON");
 
       SimpleTest.finish();
     };
     xhr.open("GET", "file_bug707142_utf-16.json");
     xhr.responseType = "json";
--- a/dom/base/test/test_bug891952.html
+++ b/dom/base/test/test_bug891952.html
@@ -9,17 +9,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
   /** Test for Bug 891952 **/
     SimpleTest.waitForExplicitFinish();
     addLoadEvent(function() {
       var all = document.all;
-      is(all["content"], $("content"), "Should find the content");
+      is(all.content, $("content"), "Should find the content");
       ok(!("" in all), "Should not have an empty string prop on document.all");
       is(all[""], undefined, "Should not get empty string on document.all");
       is(all.namedItem(""), null,
          "namedItem for empty string should return null on document.all");
 
       var divs = document.getElementsByTagName("div");
       ok(!("" in divs), "Should not have an empty string prop on getElementsByTagName");
       is(divs[""], undefined, "Should not get empty string on getElementsByTagName");
--- a/dom/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html
+++ b/dom/canvas/test/webgl-mochitest/test_webgl_request_mismatch.html
@@ -4,17 +4,17 @@
 <script src="/tests/SimpleTest/SimpleTest.js"></script>
 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
 </head>
 <body>
 <script>
 
 WEBGL_TYPES = {};
 WEBGL_TYPES['experimental-webgl'] = true;
-WEBGL_TYPES['webgl'] = true;
+WEBGL_TYPES.webgl = true;
 
 function AreBothIn(a, b, set) {
     return (a in set) && (b in set);
 }
 
 function IsAlias(typeA, typeB) {
     if (typeA == typeB)
         return true;
@@ -68,17 +68,17 @@ function IsWebGLConformant() {
 var typeList = ['2d', 'experimental-webgl', 'webgl'];
 var functionalTypeSet = {};
 functionalTypeSet['2d'] = true;
 
 if (IsWebGLFunctional())
     functionalTypeSet['experimental-webgl'] = true;
 
 if (IsWebGLConformant())
-    functionalTypeSet['webgl'] = true;
+    functionalTypeSet.webgl = true;
 
 for (var i in typeList) {
     var creationType = typeList[i];
 
     for (var j in typeList) {
         var requestType = typeList[j];
 
         TestContextRetrieval(creationType, requestType, functionalTypeSet);
--- a/dom/encoding/test/test_TLD.html
+++ b/dom/encoding/test/test_TLD.html
@@ -28,24 +28,24 @@ https://bugzilla.mozilla.org/show_bug.cg
   function runTest() {
     iframe = document.getElementsByTagName("iframe")[0];
     window.addEventListener("message", next);
     next(null);
   }
 
   function next(event) {
     if (event) {
-      is(event.data, current['encoding'], "Got bad encoding for " + current["tld"]);
+      is(event.data, current.encoding, "Got bad encoding for " + current.tld);
     }
     current = tlds.shift();
     if (!current) {
       SimpleTest.finish();
       return;
     }
-    iframe.src = "http://example." + current["tld"] + "/tests/dom/encoding/test/file_TLD.html";
+    iframe.src = "http://example." + current.tld + "/tests/dom/encoding/test/file_TLD.html";
   }
 
   </script>
 </head>
 <body onload="runTest();">
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=910211">Mozilla Bug 910211</a>
 <p id="display"></p>
 <div id="content" style="display: none">
--- a/dom/events/test/pointerevents/mochitest_support_internal.js
+++ b/dom/events/test/pointerevents/mochitest_support_internal.js
@@ -15,24 +15,24 @@ const POINTER_TOUCH_ID = 9; // Extend fo
 // Setup environment.
 addListeners(document.getElementById("target0"));
 addListeners(document.getElementById("target1"));
 
 // Setup communication between mochitest_support_external.js.
 // Function allows to initialize prerequisites before testing
 // and adds some callbacks to support mochitest system.
 function resultCallback(aTestObj) {
-  var message = aTestObj["name"] + " (";
-  message += "Get: " + JSON.stringify(aTestObj["status"]) + ", ";
-  message += "Expect: " + JSON.stringify(aTestObj["PASS"]) + ")";
+  var message = aTestObj.name + " (";
+  message += "Get: " + JSON.stringify(aTestObj.status) + ", ";
+  message += "Expect: " + JSON.stringify(aTestObj.PASS) + ")";
   window.opener.postMessage(
     {
       type: "RESULT",
       message,
-      result: aTestObj["status"] === aTestObj["PASS"],
+      result: aTestObj.status === aTestObj.PASS,
     },
     PARENT_ORIGIN
   );
 }
 
 add_result_callback(resultCallback);
 add_completion_callback(() => {
   window.opener.postMessage({ type: "FIN" }, PARENT_ORIGIN);
--- a/dom/events/test/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
@@ -99,17 +99,17 @@
                     }
                 }
             }
 
             function run() {
                 test_pointerEvent = setup_pointerevent_test("got/lost pointercapture: subsequent events to target", ALL_POINTERS);  // set up test harness
                 var listener = document.getElementById("listener");
                 var target0 = document.getElementById("target0");
-                target0.style["touchAction"] = "none";
+                target0.style.touchAction = "none";
 
                 // target0 and listener - handle all events
                 for (var i = 0; i < All_Pointer_Events.length; i++) {
                     on_event(target0, All_Pointer_Events[i], targetEventHandler);
                     on_event(listener, All_Pointer_Events[i], listenerEventHandler);
                 }
             }
         </script>
--- a/dom/events/test/pointerevents/pointerevent_releasepointercapture_invalid_pointerid-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_releasepointercapture_invalid_pointerid-manual.html
@@ -20,17 +20,17 @@
             // Requirements: the callback function will reference the test_pointerEvent object and
             // will fail unless the async_test is created with the var name "test_pointerEvent".
             add_completion_callback(showPointerTypes);
 
             var invalid_pointerId = 314159265358973923;
 
             function run() {
                 var target0 = document.getElementById("target0");
-                target0.style["touchAction"] = "none";
+                target0.style.touchAction = "none";
                 var listener = document.getElementById("listener");
 
                 // try to release pointer capture with an invalid id
                 on_event(listener, "pointermove", function (event) {
                     detected_pointertypes[event.pointerType] = true;
 
                     try {
                         listener.releasePointerCapture(invalid_pointerId);
--- a/dom/events/test/pointerevents/pointerevent_setpointercapture_invalid_pointerid-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_setpointercapture_invalid_pointerid-manual.html
@@ -19,17 +19,17 @@
             // Requirements: the callback function will reference the test_pointerEvent object and
             // will fail unless the async_test is created with the var name "test_pointerEvent".
             add_completion_callback(showPointerTypes);
 
             var INVALID_POINTERID = -39548;
 
             function run() {
                 var target0 = document.getElementById("target0");
-                target0.style["touchAction"] = "none";
+                target0.style.touchAction = "none";
                 var listener = document.getElementById("complete-notice");
 
                 on_event(target0, "pointerdown", function (event) {
                     detected_pointertypes[event.pointerType] = true;
 
                     try {
                         listener.setPointerCapture(INVALID_POINTERID);
 
--- a/dom/events/test/test_bug822898.html
+++ b/dom/events/test/test_bug822898.html
@@ -179,48 +179,48 @@ function testBlockBubbling() {
   testTarget.dispatchEvent(event);
   parent.removeEventListener("pointerdown", unreachableListener);
 
   nextTest();
 }
 
 function testOnPointerProperty()
 {
-  iframeBody.onpointerdown = function (e) { gOnPointerPropHandled["pointerdown"] = true; }
-  iframeBody.onpointerup = function (e) { gOnPointerPropHandled["pointerup"] = true; }
-  iframeBody.onpointermove = function (e) { gOnPointerPropHandled["pointermove"] = true; }
-  iframeBody.onpointerout = function (e) { gOnPointerPropHandled["pointerout"] = true; }
-  iframeBody.onpointerover = function (e) { gOnPointerPropHandled["pointerover"] = true; }
-  iframeBody.onpointerenter = function (e) { gOnPointerPropHandled["pointerenter"] = true; }
-  iframeBody.onpointerleave = function (e) { gOnPointerPropHandled["pointerleave"] = true; }
-  iframeBody.onpointercancel = function (e) { gOnPointerPropHandled["pointercancel"] = true; }
+  iframeBody.onpointerdown = function (e) { gOnPointerPropHandled.pointerdown = true; }
+  iframeBody.onpointerup = function (e) { gOnPointerPropHandled.pointerup = true; }
+  iframeBody.onpointermove = function (e) { gOnPointerPropHandled.pointermove = true; }
+  iframeBody.onpointerout = function (e) { gOnPointerPropHandled.pointerout = true; }
+  iframeBody.onpointerover = function (e) { gOnPointerPropHandled.pointerover = true; }
+  iframeBody.onpointerenter = function (e) { gOnPointerPropHandled.pointerenter = true; }
+  iframeBody.onpointerleave = function (e) { gOnPointerPropHandled.pointerleave = true; }
+  iframeBody.onpointercancel = function (e) { gOnPointerPropHandled.pointercancel = true; }
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointerdown"));
-  is(gOnPointerPropHandled['pointerdown'], true, "pointerdown property is performed");
+  is(gOnPointerPropHandled.pointerdown, true, "pointerdown property is performed");
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointerup"));
-  is(gOnPointerPropHandled['pointerup'], true, "pointerup property is performed");
+  is(gOnPointerPropHandled.pointerup, true, "pointerup property is performed");
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointermove"));
-  is(gOnPointerPropHandled['pointermove'], true, "pointermove property is performed");
+  is(gOnPointerPropHandled.pointermove, true, "pointermove property is performed");
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointerout"));
-  is(gOnPointerPropHandled['pointerout'], true, "pointerout property is performed");
+  is(gOnPointerPropHandled.pointerout, true, "pointerout property is performed");
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointerover"));
-  is(gOnPointerPropHandled['pointerover'], true, "pointerover property is performed");
+  is(gOnPointerPropHandled.pointerover, true, "pointerover property is performed");
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointerenter"));
-  is(gOnPointerPropHandled['pointerenter'], true, "pointerenter property is performed");
+  is(gOnPointerPropHandled.pointerenter, true, "pointerenter property is performed");
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointerleave"));
-  is(gOnPointerPropHandled['pointerleave'], true, "pointerleave property is performed");
+  is(gOnPointerPropHandled.pointerleave, true, "pointerleave property is performed");
 
   iframeBody.dispatchEvent(getDefaultArgEvent("pointercancel"));
-  is(gOnPointerPropHandled['pointercancel'], true, "pointercancel property is performed");
+  is(gOnPointerPropHandled.pointercancel, true, "pointercancel property is performed");
 
   nextTest();
 }
 
 function testPointerEventCTORS()
 {
   // TODO: This should go to test_eventctors.html, when PointerEvents enabled by default
   var receivedEvent;
--- a/dom/events/test/test_dom_wheel_event.html
+++ b/dom/events/test/test_dom_wheel_event.html
@@ -717,19 +717,19 @@ function* testOnWheelAttr()
 
   document.documentElement.setAttribute("onwheel", onWheelHandledString("html"));
   document.body.setAttribute("onwheel", onWheelHandledString("body"));
   gScrollableElement.setAttribute("onwheel", onWheelHandledString("div"));
   var target = document.getElementById("onwheel");
   yield synthesizeWheel(gScrollableElement, 10, 10,
                         { deltaMode: WheelEvent.DOM_DELTA_LINE,
                         deltaX: 1.0, deltaY: 2.0 });
-  ok(gOnWheelAttrHandled['html'], "html element's onwheel attribute isn't performed");
-  ok(gOnWheelAttrHandled['body'], "body element's onwheel attribute isn't performed");
-  ok(gOnWheelAttrHandled['div'], "div element's onwheel attribute isn't performed");
+  ok(gOnWheelAttrHandled.html, "html element's onwheel attribute isn't performed");
+  ok(gOnWheelAttrHandled.body, "body element's onwheel attribute isn't performed");
+  ok(gOnWheelAttrHandled.div, "div element's onwheel attribute isn't performed");
 }
 
 var gOnWheelPropHandled = new Array;
 var gOnWheelPropCount = 0;
 
 function* testOnWheelProperty()
 {
   const handleOnWheelProp = prop => e => {
@@ -746,21 +746,21 @@ function* testOnWheelProperty()
   document.body.onwheel = handleOnWheelProp('body');
   gScrollableElement.onwheel = handleOnWheelProp('div');
 
   var target = document.getElementById("onwheel");
   yield synthesizeWheel(gScrollableElement, 10, 10,
                         { deltaMode: WheelEvent.DOM_DELTA_LINE,
                           deltaX: 1.0, deltaY: 2.0 });
 
-  ok(gOnWheelPropHandled['window'], "window's onwheel property isn't performed");
-  ok(gOnWheelPropHandled['document'], "document's onwheel property isn't performed");
-  ok(gOnWheelPropHandled['html'], "html element's onwheel property isn't performed");
-  ok(gOnWheelPropHandled['body'], "body element's onwheel property isn't performed");
-  ok(gOnWheelPropHandled['div'], "div element's onwheel property isn't performed");
+  ok(gOnWheelPropHandled.window, "window's onwheel property isn't performed");
+  ok(gOnWheelPropHandled.document, "document's onwheel property isn't performed");
+  ok(gOnWheelPropHandled.html, "html element's onwheel property isn't performed");
+  ok(gOnWheelPropHandled.body, "body element's onwheel property isn't performed");
+  ok(gOnWheelPropHandled.div, "div element's onwheel property isn't performed");
 }
 
 function* testBody()
 {
   yield* prepareScrollUnits();
   testMakingUntrustedEvent();
   yield* testDeltaMultiplierPrefs();
   testDispatchingUntrustEvent();
--- a/dom/html/test/forms/test_bug1286509.html
+++ b/dom/html/test/forms/test_bug1286509.html
@@ -34,16 +34,16 @@ https://bugzilla.mozilla.org/show_bug.cg
         is(expectedEventSequence[expectedEventIdx], e.type, "Events sequence should be keydown, change, keyup");
         expectedEventIdx = (expectedEventIdx + 1) % 3;
       });
     });
     synthesizeKey("KEY_ArrowUp");
     synthesizeKey("KEY_ArrowDown");
     synthesizeKey("KEY_ArrowLeft");
     synthesizeKey("KEY_ArrowRight");
-    is(eventCounts['change'], 4, "Expect key up/down/left/right should trigger range input to fire change events");
+    is(eventCounts.change, 4, "Expect key up/down/left/right should trigger range input to fire change events");
     SimpleTest.finish();
   }
   addLoadEvent(test);
   </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/forms/test_input_typing_sanitization.html
+++ b/dom/html/test/forms/test_input_typing_sanitization.html
@@ -51,17 +51,17 @@ function runTestsForNextInputType()
   let {done} = testRunner.next();
   if (done) {
     SimpleTest.finish();
   }
 }
 
 function checkValueSubmittedIsValid()
 {
-  is(frames['submit_frame'].location.href,
+  is(frames.submit_frame.location.href,
      'http://mochi.test:8888/tests/dom/html/test/forms/foo?i='
      + urlify(gValidData[valueIndex++]),
      "The submitted value should not have been sanitized");
 
   input.value = "";
 
   if (valueIndex >= gValidData.length) {
     if (gCurrentTest.canHaveBadInputValidityState) {
@@ -74,17 +74,17 @@ function checkValueSubmittedIsValid()
     submitFrame.onload = checkValueSubmittedIsInvalid;
     testData = gInvalidData;
   }
   testSubmissions();
 }
 
 function checkValueSubmittedIsInvalid()
 {
-  is(frames['submit_frame'].location.href,
+  is(frames.submit_frame.location.href,
      'http://mochi.test:8888/tests/dom/html/test/forms/foo?i=',
      "The submitted value should have been sanitized");
 
   valueIndex++;
   input.value = "";
 
   if (valueIndex >= gInvalidData.length) {
     if (submitMethod == sendKeyEventToSubmitForm) {
--- a/dom/html/test/forms/test_meter_element.html
+++ b/dom/html/test/forms/test_meter_element.html
@@ -306,17 +306,17 @@ function checkNotResetableAndFormSubmiss
   input.value = 'tulip';
   form.appendChild(input);
 
   // Setting values.
   aElement.value = 42.0;
   aElement.max = 100.0;
 
   document.getElementsByName('submit_frame')[0].addEventListener("load", function() {
-    is(frames['submit_frame'].location.href,
+    is(frames.submit_frame.location.href,
       'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=tulip',
        "The meter element value should not be submitted");
 
     checkNotResetable();
   }, {once: true});
 
   form.submit();
 }
--- a/dom/html/test/forms/test_output_element.html
+++ b/dom/html/test/forms/test_output_element.html
@@ -5,17 +5,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 <head>
   <title>Test for Bug 346485</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="../reflect.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
     frameLoaded = function() {
-      is(frames['submit_frame'].location.href, "about:blank",
+      is(frames.submit_frame.location.href, "about:blank",
          "Blank frame loaded");
     }
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=346485">Mozilla Bug 346485</a>
 <p id="display"></p>
 <iframe name="submit_frame" onload="frameLoaded()" style="visibility: hidden;"></iframe>
@@ -130,17 +130,17 @@ function submitForm()
 function checkFormSubmission()
 {
   /**
    * All elements values have been set just before the submission.
    * The input elements values should be in the submit url but the ouput
    * element value should not appear.
    */
 
-  is(frames['submit_frame'].location.href,
+  is(frames.submit_frame.location.href,
     'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=afield&b=bfield',
      "The output element value should not be submitted");
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   reflectString({
--- a/dom/html/test/forms/test_progress_element.html
+++ b/dom/html/test/forms/test_progress_element.html
@@ -242,17 +242,17 @@ function checkNotResetableAndFormSubmiss
   input.value = 'tulip';
   form.appendChild(input);
 
   // Setting values.
   aElement.value = 42.0;
   aElement.max = 100.0;
 
   document.getElementsByName('submit_frame')[0].addEventListener("load", function() {
-    is(frames['submit_frame'].location.href,
+    is(frames.submit_frame.location.href,
       'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=tulip',
        "The progress element value should not be submitted");
 
     checkNotResetable();
   }, {once: true});
 
   form.submit();
 }
--- a/dom/html/test/test_bug1261673.html
+++ b/dom/html/test/test_bug1261673.html
@@ -47,20 +47,20 @@ function runTests() {
   let expectChange = 0;
 
   input.addEventListener("change", () => {
     ++numberChange;
   });
 
   function runNext() {
     let p = params[testIdx];
-    (p["focus"]) ? input.focus() : input.blur();
-    expectChange = p["valueChanged"] == 0 ? expectChange : expectChange + 1;
-    result += parseInt(p["valueChanged"]);
-    sendWheelAndPaint(input, 1, 1, { deltaY: p["deltaY"], deltaMode: p["deltaMode"] }, () => {
+    (p.focus) ? input.focus() : input.blur();
+    expectChange = p.valueChanged == 0 ? expectChange : expectChange + 1;
+    result += parseInt(p.valueChanged);
+    sendWheelAndPaint(input, 1, 1, { deltaY: p.deltaY, deltaMode: p.deltaMode }, () => {
       ok(input.value == result,
         "Handle wheel in number input test-" + testIdx + " expect " + result +
         " get " + input.value);
       ok(numberChange == expectChange,
          "UA should fire change event when input's value changed, expect " + expectChange + " get " + numberChange);
       (++testIdx >= params.length) ? SimpleTest.finish() : runNext();
     });
   }
--- a/dom/html/test/test_bug1261674-1.html
+++ b/dom/html/test/test_bug1261674-1.html
@@ -47,20 +47,20 @@ function runTests() {
   let expectChange = 0;
 
   input.addEventListener("change", () => {
     ++rangeChange;
   });
 
   function runNext() {
     let p = params[testIdx];
-    (p["focus"]) ? input.focus() : input.blur();
-    expectChange = p["valueChanged"] == 0 ? expectChange : expectChange + 1;
-    result += parseInt(p["valueChanged"]);
-    sendWheelAndPaint(input, 1, 1, { deltaY: p["deltaY"], deltaMode: p["deltaMode"] }, () => {
+    (p.focus) ? input.focus() : input.blur();
+    expectChange = p.valueChanged == 0 ? expectChange : expectChange + 1;
+    result += parseInt(p.valueChanged);
+    sendWheelAndPaint(input, 1, 1, { deltaY: p.deltaY, deltaMode: p.deltaMode }, () => {
       ok(input.value == result,
          "Handle wheel in range input test-" + testIdx + " expect " + result + " get " + input.value);
       ok(rangeChange == expectChange,
          "UA should fire change event when input's value changed, expect " + expectChange + " get " + rangeChange);
       (++testIdx >= params.length) ? SimpleTest.finish() : runNext();
     });
   }
 
--- a/dom/html/test/test_bug1261674-2.html
+++ b/dom/html/test/test_bug1261674-2.html
@@ -44,18 +44,18 @@ function runTests() {
   let rangeChange = 0;
 
   input.addEventListener("change", () => {
     ++rangeChange;
   });
 
   function runNext() {
     let p = params[testIdx];
-    (p["focus"]) ? input.focus() : input.blur();
-    sendWheelAndPaint(input, 1, 1, { deltaY: p["deltaY"], deltaMode: p["deltaMode"] }, () => {
+    (p.focus) ? input.focus() : input.blur();
+    sendWheelAndPaint(input, 1, 1, { deltaY: p.deltaY, deltaMode: p.deltaMode }, () => {
       ok(input.value == result,
          "Handle wheel in range input test-" + testIdx + " expect " + result + " get " + input.value);
       ok(rangeChange == 0, "Wheel event should not trigger change event when max < min");
       testIdx++;
       (testIdx >= params.length) ? SimpleTest.finish() : runNext();
     });
   }
 
--- a/dom/html/test/test_bug332893-4.html
+++ b/dom/html/test/test_bug332893-4.html
@@ -11,19 +11,19 @@
    <input id="input3" type="input" name="input" value="3"/>
 </form>
 <script>
 	var input1 = document.getElementById("input1");
       var input2 = document.getElementById("input2");
       var form1 = document.getElementById("form1");
       form1.insertBefore(input2, input1);
 
-	is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
-	is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
-	is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
-	is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct");
+	is(form1.elements.input.length, 3, "Form 1 'input' has the correct length");
+	is(form1.elements.input[0].value, "2", "Form 1 element 1 is correct");
+	is(form1.elements.input[1].value, "1", "Form 1 element 2 is correct");
+	is(form1.elements.input[2].value, "3", "Form 1 element 3 is correct");
 
-	is(form1.elements["input"][0].id, "input2", "Form 1 element 1 id is correct");
-	is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
-	is(form1.elements["input"][2].id, "input3", "Form 1 element 3 id is correct");
+	is(form1.elements.input[0].id, "input2", "Form 1 element 1 id is correct");
+	is(form1.elements.input[1].id, "input1", "Form 1 element 2 id is correct");
+	is(form1.elements.input[2].id, "input3", "Form 1 element 3 id is correct");
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug332893-5.html
+++ b/dom/html/test/test_bug332893-5.html
@@ -11,19 +11,19 @@
    <input id="input3" type="input" name="input" value="3"/>
 </form>
 <script>
 	var input1 = document.getElementById("input1");
       var input2 = document.getElementById("input");
       var form1 = document.getElementById("form1");
       form1.insertBefore(input2, input1);
 
-	is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
-	is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
-	is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
-	is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct");
+	is(form1.elements.input.length, 3, "Form 1 'input' has the correct length");
+	is(form1.elements.input[0].value, "2", "Form 1 element 1 is correct");
+	is(form1.elements.input[1].value, "1", "Form 1 element 2 is correct");
+	is(form1.elements.input[2].value, "3", "Form 1 element 3 is correct");
 
-	is(form1.elements["input"][0].id, "input", "Form 1 element 1 id is correct");
-	is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
-	is(form1.elements["input"][2].id, "input3", "Form 1 element 3 id is correct");
+	is(form1.elements.input[0].id, "input", "Form 1 element 1 id is correct");
+	is(form1.elements.input[1].id, "input1", "Form 1 element 2 id is correct");
+	is(form1.elements.input[2].id, "input3", "Form 1 element 3 id is correct");
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug332893-6.html
+++ b/dom/html/test/test_bug332893-6.html
@@ -11,17 +11,17 @@
    <input id="input3" type="input" name="input" value="3"/>
 </form>
 <script>
 	var input1 = document.getElementById("input1");
       var input2 = document.getElementById("input");
       var form1 = document.getElementById("form1");
       form1.insertBefore(input2, input1);
 
-	is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
-	is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
-	is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
+	is(form1.elements.input.length, 3, "Form 1 'input' has the correct length");
+	is(form1.elements.input[0].value, "2", "Form 1 element 1 is correct");
+	is(form1.elements.input[1].value, "1", "Form 1 element 2 is correct");
 
-	is(form1.elements["input"][0].id, "input", "Form 1 element 1 id is correct");
-	is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
+	is(form1.elements.input[0].id, "input", "Form 1 element 1 id is correct");
+	is(form1.elements.input[1].id, "input1", "Form 1 element 2 id is correct");
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug332893-7.html
+++ b/dom/html/test/test_bug332893-7.html
@@ -36,34 +36,34 @@
 
 	var form1 = document.getElementById("form1");
 
 	form1.insertBefore(input2, input1);
 	form1.insertBefore(input10, input6);
 	form1.insertBefore(input8, input4);
 	form1.insertBefore(input9, input2);
 
-	is(form1.elements["input"].length, 10, "Form 1 'input' has the correct length");
-	is(form1.elements["input"][0].value, "9", "Form 1 element 1 is correct");
-	is(form1.elements["input"][1].value, "2", "Form 1 element 2 is correct");
-	is(form1.elements["input"][2].value, "1", "Form 1 element 3 is correct");
-	is(form1.elements["input"][3].value, "3", "Form 1 element 4 is correct");
-	is(form1.elements["input"][4].value, "8", "Form 1 element 5 is correct");
-	is(form1.elements["input"][5].value, "4", "Form 1 element 6 is correct");
-	is(form1.elements["input"][6].value, "5", "Form 1 element 7 is correct");
-	is(form1.elements["input"][7].value, "10", "Form 1 element 8 is correct");
-	is(form1.elements["input"][8].value, "6", "Form 1 element 9 is correct");
-	is(form1.elements["input"][9].value, "7", "Form 1 element 10 is correct");
+	is(form1.elements.input.length, 10, "Form 1 'input' has the correct length");
+	is(form1.elements.input[0].value, "9", "Form 1 element 1 is correct");
+	is(form1.elements.input[1].value, "2", "Form 1 element 2 is correct");
+	is(form1.elements.input[2].value, "1", "Form 1 element 3 is correct");
+	is(form1.elements.input[3].value, "3", "Form 1 element 4 is correct");
+	is(form1.elements.input[4].value, "8", "Form 1 element 5 is correct");
+	is(form1.elements.input[5].value, "4", "Form 1 element 6 is correct");
+	is(form1.elements.input[6].value, "5", "Form 1 element 7 is correct");
+	is(form1.elements.input[7].value, "10", "Form 1 element 8 is correct");
+	is(form1.elements.input[8].value, "6", "Form 1 element 9 is correct");
+	is(form1.elements.input[9].value, "7", "Form 1 element 10 is correct");
 
-	is(form1.elements["input"][0].id, "input9", "Form 1 element 1 id is correct");
-	is(form1.elements["input"][1].id, "input2", "Form 1 element 2 id is correct");
-	is(form1.elements["input"][2].id, "input1", "Form 1 element 3 id is correct");
-	is(form1.elements["input"][3].id, "input3", "Form 1 element 4 id is correct");
-	is(form1.elements["input"][4].id, "input8", "Form 1 element 5 id is correct");
-	is(form1.elements["input"][5].id, "input4", "Form 1 element 6 id is correct");
-	is(form1.elements["input"][6].id, "input5", "Form 1 element 7 id is correct");
-	is(form1.elements["input"][7].id, "input10", "Form 1 element 8 id is correct");
-	is(form1.elements["input"][8].id, "input6", "Form 1 element 9 id is correct");
-	is(form1.elements["input"][9].id, "input7", "Form 1 element 10  id is correct");
+	is(form1.elements.input[0].id, "input9", "Form 1 element 1 id is correct");
+	is(form1.elements.input[1].id, "input2", "Form 1 element 2 id is correct");
+	is(form1.elements.input[2].id, "input1", "Form 1 element 3 id is correct");
+	is(form1.elements.input[3].id, "input3", "Form 1 element 4 id is correct");
+	is(form1.elements.input[4].id, "input8", "Form 1 element 5 id is correct");
+	is(form1.elements.input[5].id, "input4", "Form 1 element 6 id is correct");
+	is(form1.elements.input[6].id, "input5", "Form 1 element 7 id is correct");
+	is(form1.elements.input[7].id, "input10", "Form 1 element 8 id is correct");
+	is(form1.elements.input[8].id, "input6", "Form 1 element 9 id is correct");
+	is(form1.elements.input[9].id, "input7", "Form 1 element 10  id is correct");
 
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug353415-1.html
+++ b/dom/html/test/test_bug353415-1.html
@@ -26,17 +26,17 @@
 <input name="field12">
 <input type="button" name="field13" value="button">
 </form>
 <script>
   SimpleTest.waitForExplicitFinish();
 
   addLoadEvent(function() {
     document.getElementsByName('submit_frame')[0].onload = function() {
-      is(frames['submit_frame'].location.href, "http://mochi.test:8888/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=", "Submit string was correct.");
+      is(frames.submit_frame.location.href, "http://mochi.test:8888/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=", "Submit string was correct.");
       SimpleTest.finish();
     };
 
     document.forms[0].submit();
   });
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug353415-2.html
+++ b/dom/html/test/test_bug353415-2.html
@@ -51,17 +51,17 @@
 </tr>
 </table>
 </form>
 <script>
   SimpleTest.waitForExplicitFinish();
 
   addLoadEvent(function() {
     document.getElementsByName('submit_frame')[0].onload = function() {
-      is(frames['submit_frame'].location.href, "http://mochi.test:8888/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14", "Submit string was correct.");
+      is(frames.submit_frame.location.href, "http://mochi.test:8888/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14", "Submit string was correct.");
       SimpleTest.finish();
     };
 
     document.forms[0].submit();
   });
 </script>
 </body>
 </html>
--- a/dom/html/test/test_bug481440.html
+++ b/dom/html/test/test_bug481440.html
@@ -17,14 +17,14 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 481440 **/
 // Do a bunch of getElementById calls to catch hashtables auto-going live
 for (var i = 0; i < 500; ++i) {
   document.getElementById(i);
 }
-is(document.all["x"], document.getElementById("y"),
+is(document.all.x, document.getElementById("y"),
    "Unexpected node");
 </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/test_bug529819.html
+++ b/dom/html/test/test_bug529819.html
@@ -17,16 +17,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   <input name="bar" type="radio">
   <input name="bar" id="bar" type="radio">
 </form>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 529819 **/
-is($("form").elements["foo"] instanceof HTMLInputElement, true, "Should have an element here");
-is($("form").elements["bar"] instanceof HTMLInputElement, false, "Should have a list here");
-is($("form").elements["bar"].length, 2, "Should have a list with two elements here");
+is($("form").elements.foo instanceof HTMLInputElement, true, "Should have an element here");
+is($("form").elements.bar instanceof HTMLInputElement, false, "Should have a list here");
+is($("form").elements.bar.length, 2, "Should have a list with two elements here");
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/test_bug567938-1.html
+++ b/dom/html/test/test_bug567938-1.html
@@ -43,17 +43,17 @@ function initializeNextTest()
   form.appendChild(element);
 
   sendMouseEvent({type: 'click'}, 'i');
 }
 
 function runTests()
 {
   document.getElementById('iframe').addEventListener('load', function(aEvent) {
-    is(frames['submit_frame'].location.href,
+    is(frames.submit_frame.location.href,
        "http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest],
        "The form should have been submitted");
     gCurrentTest++;
     if (gCurrentTest < gTestData.length) {
       initializeNextTest();
     } else {
       aEvent.target.removeEventListener('load', arguments.callee);
       SimpleTest.finish();
--- a/dom/html/test/test_bug567938-2.html
+++ b/dom/html/test/test_bug567938-2.html
@@ -44,17 +44,17 @@ function initializeNextTest()
   form.appendChild(element);
 
   sendMouseEvent({type: 'click'}, 'i');
 }
 
 function runTests()
 {
   document.getElementById('iframe').addEventListener('load', function(aEvent) {
-    is(frames['submit_frame'].location.href,
+    is(frames.submit_frame.location.href,
        "http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest],
        "The form should have been submitted");
     gCurrentTest++;
     if (gCurrentTest < gTestData.length) {
       initializeNextTest();
     } else {
       aEvent.target.removeEventListener('load', arguments.callee);
       SimpleTest.finish();
--- a/dom/html/test/test_bug567938-3.html
+++ b/dom/html/test/test_bug567938-3.html
@@ -44,17 +44,17 @@ function initializeNextTest()
   form.action = gTestData[gCurrentTest];
 
   sendMouseEvent({type: 'click'}, 'i');
 }
 
 function runTests()
 {
   document.getElementById('iframe').addEventListener('load', function(aEvent) {
-    is(frames['submit_frame'].location.href,
+    is(frames.submit_frame.location.href,
        "http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest],
        "The form should have been submitted");
     gCurrentTest++;
     if (gCurrentTest < gTestData.length) {
       initializeNextTest();
     } else {
       aEvent.target.removeEventListener('load', arguments.callee);
       SimpleTest.finish();
--- a/dom/media/webspeech/recognition/test/test_abort.html
+++ b/dom/media/webspeech/recognition/test/test_abort.html
@@ -37,21 +37,21 @@ https://bugzilla.mozilla.org/show_bug.cg
     var expectedEvents = {
       "start": null,
       "audiostart": null,
       "audioend": null,
       "end": null
     };
 
     if (nextEventIdx >= eventsToAbortOn.indexOf("speechstart")) {
-        expectedEvents["speechstart"] = null;
+        expectedEvents.speechstart = null;
     }
 
     if (nextEventIdx >= eventsToAbortOn.indexOf("speechend")) {
-        expectedEvents["speechend"] = null;
+        expectedEvents.speechend = null;
     }
 
     info("Aborting on " + nextEvent);
     expectedEvents[nextEvent] = function(evt, sr) {
       sr.abort();
     };
 
     nextEventIdx++;
--- a/dom/security/test/csp/test_frame_ancestors_ro.html
+++ b/dom/security/test/csp/test_frame_ancestors_ro.html
@@ -16,17 +16,17 @@ let testResults = {
   frameLoaded: false
 };
 
 function checkResults(reportObj) {
   let cspReport = reportObj["csp-report"];
   is(cspReport["document-uri"], docUri, "Incorrect document-uri");
 
   // we can not test for the whole referrer since it includes platform specific information
-  is(cspReport["referrer"], document.location.toString(), "Incorrect referrer");
+  is(cspReport.referrer, document.location.toString(), "Incorrect referrer");
   is(cspReport["blocked-uri"], document.location.toString(), "Incorrect blocked-uri");
   is(cspReport["violated-directive"], "frame-ancestors", "Incorrect violated-directive");
   is(cspReport["original-policy"], "frame-ancestors 'none'; report-uri http://mochi.test:8888/foo.sjs", "Incorrect original-policy");
   testResults.reportFired = true;
 }
 
 let chromeScriptUrl = SimpleTest.getTestFileURL("file_report_chromescript.js");
 let script = SpecialPowers.loadChromeScript(chromeScriptUrl);
--- a/dom/security/test/csp/test_inlinestyle.html
+++ b/dom/security/test/csp/test_inlinestyle.html
@@ -24,70 +24,70 @@ var done = 0;
 // styles applied by <style> element, style attribute, and SMIL <animate> and <set> tags
 // (when it's not explicitly allowed.)
 function checkStyles(evt) {
   var cspframe = document.getElementById('cspframe1');
   var color;
 
   // black means the style wasn't applied.  green colors are used for styles
   //expected to be applied.  A color is red if a style is erroneously applied
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv')).color;
   ok('rgb(0, 255, 0)' === color, 'External Stylesheet (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv')).color;
   ok('rgb(0, 0, 0)' === color, 'Inline Style TAG (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv')).color;
   ok('rgb(0, 0, 0)' === color, 'Style Attribute (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv')).color;
   ok('rgb(0, 255, 0)' === color, 'cssText (' + color + ')');
   // SMIL tests
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null)).fill;
   ok('rgb(0, 0, 0)' === color, 'XML Attribute styling (SMIL) (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null)).fill;
   ok('rgb(0, 0, 0)' === color, 'CSS Override styling (SMIL) (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null)).fill;
   ok('rgb(0, 0, 0)' === color, 'CSS Override styling via ID lookup (SMIL) (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null)).fill;
   ok('rgb(0, 0, 0)' === color, 'CSS Set Element styling via ID lookup (SMIL) (' + color + ')');
 
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv')).color;
   ok('rgb(0, 255, 0)' === color, 'Modify loaded style sheet via cssText (' + color + ')');
 
   checkIfDone();
 }
 
 // When a CSP 1.0 compliant policy is specified we should allow inline
 // styles when it is explicitly allowed.
 function checkStylesAllowed(evt) {
   var cspframe = document.getElementById('cspframe2');
   var color;
 
   // black means the style wasn't applied.  green colors are used for styles
   // expected to be applied.  A color is red if a style is erroneously applied
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv')).color;
   ok('rgb(0, 255, 0)' === color, 'External Stylesheet (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv')).color;
   ok('rgb(0, 255, 0)' === color, 'Inline Style TAG (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv')).color;
   ok('rgb(0, 255, 0)' === color, 'Style Attribute (' + color + ')');
 
   // Note that the below test will fail if "script-src: 'unsafe-inline'" breaks,
   // since it relies on executing script to set .cssText
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv')).color;
   ok('rgb(0, 255, 0)' === color, 'style.cssText (' + color + ')');
   // SMIL tests
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null)).fill;
   ok('rgb(0, 255, 0)' === color, 'XML Attribute styling (SMIL) (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null)).fill;
   ok('rgb(0, 255, 0)' === color, 'CSS Override styling (SMIL) (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null)).fill;
   ok('rgb(0, 255, 0)' === color, 'CSS Override styling via ID lookup (SMIL) (' + color + ')');
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null))['fill'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null)).fill;
   ok('rgb(0, 255, 0)' === color, 'CSS Set Element styling via ID lookup (SMIL) (' + color + ')');
 
-  color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv'))['color'];
+  color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv')).color;
   ok('rgb(0, 255, 0)' === color, 'Modify loaded style sheet via cssText (' + color + ')');
 
   checkIfDone();
 }
 
 function checkIfDone() {
   done++;
   if (done == 2)
--- a/dom/security/test/csp/test_multipartchannel.html
+++ b/dom/security/test/csp/test_multipartchannel.html
@@ -39,25 +39,25 @@ function checkTestsCompleted() {
  * second part correctly based on its CSP accordingly.
  */
 
 window.addEventListener("message", receiveMessage);
 function receiveMessage(event) {
   switch (event.data.test) {
     case "rootCSP_test":
       is(event.data.msg, "img-blocked", "image should be blocked");
-      testsToRunMultipartCSP["rootCSP_test"] = true;
+      testsToRunMultipartCSP.rootCSP_test = true;
       break;
     case "part1CSP_test":
       is(event.data.msg, "part1-img-loaded", "Part1 image should be loaded");
-      testsToRunMultipartCSP["part1CSP_test"] = true;
+      testsToRunMultipartCSP.part1CSP_test = true;
       break;
     case "part2CSP_test":
       is(event.data.msg, "part2-img-blocked", "Part2 image should be blocked");
-      testsToRunMultipartCSP["part2CSP_test"] = true;
+      testsToRunMultipartCSP.part2CSP_test = true;
       break;
   }
   checkTestsCompleted();
 }
 
 // start the test
 document.getElementById("testframe").src = "file_multipart_testserver.sjs?doc";
 document.getElementById("testPartCSPframe").src =
--- a/dom/security/test/csp/test_report.html
+++ b/dom/security/test/csp/test_report.html
@@ -40,17 +40,17 @@ window.checkResults = function(reportObj
   // The following uris' fragments should be stripped before reporting:
   //    * document-uri
   //    * blocked-uri
   //    * source-file
   // see http://www.w3.org/TR/CSP11/#violation-reports
   is(cspReport["document-uri"], docUri, "Incorrect document-uri");
 
   // we can not test for the whole referrer since it includes platform specific information
-  ok(cspReport["referrer"].startsWith("http://mochi.test:8888/tests/dom/security/test/csp/test_report.html"),
+  ok(cspReport.referrer.startsWith("http://mochi.test:8888/tests/dom/security/test/csp/test_report.html"),
      "Incorrect referrer");
 
   is(cspReport["blocked-uri"], "inline", "Incorrect blocked-uri");
 
   is(cspReport["violated-directive"], "default-src", "Incorrect violated-directive");
 
   is(cspReport["original-policy"], "default-src 'none' 'report-sample'; report-uri http://mochi.test:8888/foo.sjs",
      "Incorrect original-policy");
--- a/dom/security/test/csp/test_report_for_import.html
+++ b/dom/security/test/csp/test_report_for_import.html
@@ -41,17 +41,17 @@ const DOC_URI =
   "file_report_for_import_server.sjs%3Freport";
 
 function checkResults(reportStr) {
   try {
     var reportObj = JSON.parse(reportStr);
     var cspReport = reportObj["csp-report"];
 
     is(cspReport["document-uri"], DOC_URI, "Incorrect document-uri");
-    is(cspReport["referrer"],
+    is(cspReport.referrer,
        "http://mochi.test:8888/tests/dom/security/test/csp/test_report_for_import.html",
        "Incorrect referrer");
     is(cspReport["violated-directive"],
        "style-src",
        "Incorrect violated-directive");
     is(cspReport["original-policy"], POLICY, "Incorrect original-policy");
     is(cspReport["blocked-uri"],
        "http://example.com/tests/dom/security/test/csp/file_report_for_import_server.sjs?stylesheet",
--- a/dom/security/test/general/test_block_toplevel_data_navigation.html
+++ b/dom/security/test/general/test_block_toplevel_data_navigation.html
@@ -23,31 +23,31 @@ var testsToRun = {
 };
 
 // test1 and test3 event messages will not be received if toplevel data: URI
 // is blocked.
 window.addEventListener("message", receiveMessage);
 function receiveMessage(event) {
   switch (event.data) {
     case "test1":
-      testsToRun["test1"] = true;
+      testsToRun.test1 = true;
       break;
     case "test3":
-      testsToRun["test3"] = true;
+      testsToRun.test3 = true;
       break;
   }
 }
 
 function test1() {
   // simple data: URI click navigation should be prevented
   let TEST_FILE = "file_block_toplevel_data_navigation.html";
   let win1 = window.open(TEST_FILE);
   // testsToRun["test1"] will be false if toplevel data: URI is blocked
   setTimeout(function () {
-    is(testsToRun["test1"], false,
+    is(testsToRun.test1, false,
       "toplevel data: URI navigation through click() should be blocked");
     win1.close();
     test2();
   }, 1000);
 }
 
 function test2() {
   // data: URI in iframe which opens data: URI in _blank should be blocked 
@@ -62,17 +62,17 @@ function test2() {
   }
 }
 
 function test3() {
   // navigating to a data: URI using window.location.href should be blocked
   let win3 = window.open("file_block_toplevel_data_navigation3.html");
   // testsToRun["test3"] will be false if toplevel data: URI is blocked
   setTimeout(function () {
-    is(testsToRun["test3"], false,
+    is(testsToRun.test3, false,
       "data: URI navigation through win.loc.href should be blocked");
     win3.close();
     test4();
   }, 1000);
 }
 
 function test4() {
   // navigating to a data: URI using window.open() should be blocked
--- a/dom/security/test/mixedcontentblocker/test_bug803225.html
+++ b/dom/security/test/mixedcontentblocker/test_bug803225.html
@@ -86,48 +86,48 @@ https://bugzilla.mozilla.org/show_bug.cg
     // test that the load type matches the pref for this type of content
     // (i.e. active vs. display)
 
     switch(event.data.test) {
 
       /* Mixed Script tests */
       case "about":
         ok(event.data.msg == "resource with about protocol loaded", "resource with about protocol did not load");
-        testsToRun["about"] = true;
+        testsToRun.about = true;
         break;
 
       case "resource":
         ok(event.data.msg == "resource with resource protocol loaded", "resource with resource protocol did not load");
-        testsToRun["resource"] = true;
+        testsToRun.resource = true;
         break;
 
       case "unsafe_about":
         // This one should not load
         ok(event.data.msg == "resource with unsafe about protocol did not load", "resource with unsafe about protocol loaded");
-        testsToRun["unsafe_about"] = true;
+        testsToRun.unsafe_about = true;
         break;
 
       case "data_protocol":
         ok(event.data.msg == "resource with data protocol loaded", "resource with data protocol did not load");
-        testsToRun["data_protocol"] = true;
+        testsToRun.data_protocol = true;
         break;
 
       case "javascript":
         ok(event.data.msg == "resource with javascript protocol loaded", "resource with javascript protocol did not load");
-        testsToRun["javascript"] = true;
+        testsToRun.javascript = true;
         break;
 
       case "wss":
         ok(event.data.msg == "resource with wss protocol loaded", "resource with wss protocol did not load");
-        testsToRun["wss"] = true;
+        testsToRun.wss = true;
         break;
 
       case "mailto":
         ok(event.data.msg == "resource with mailto protocol loaded", "resource with mailto protocol did not load");
-        testsToRun["mailto"] = true;
+        testsToRun.mailto = true;
         break;
     }
     checkTestsCompleted();
   }
 
   function startTest() {
     //Set the first set of settings (true, true) and increment the counter.
     changePrefs(function() {
--- a/dom/security/test/mixedcontentblocker/test_frameNavigation.html
+++ b/dom/security/test/mixedcontentblocker/test_frameNavigation.html
@@ -86,32 +86,32 @@ https://bugzilla.mozilla.org/show_bug.cg
     log("test: "+event.data.test+", msg: "+event.data.msg + ".");
     // test that the load type matches the pref for this type of content
     // (i.e. active vs. display)
 
     switch(event.data.test) {
 
       case "insecurePage_navigate_child":
         is(event.data.msg, "navigated to insecure iframe on insecure page", "navigating to insecure iframe blocked on insecure page");
-        testsToRunInsecure["insecurePage_navigate_child"] = true;
+        testsToRunInsecure.insecurePage_navigate_child = true;
         break;
 
       case "insecurePage_navigate_grandchild":
         is(event.data.msg, "navigated to insecure grandchild iframe on insecure page", "navigating to insecure grandchild iframe blocked on insecure page");
-        testsToRunInsecure["insecurePage_navigate_grandchild"] = true;
+        testsToRunInsecure.insecurePage_navigate_grandchild = true;
         break;
 
       case "securePage_navigate_child":
         ok(blockActive == (event.data.msg == "navigating to insecure iframe blocked on secure page"), "navigated to insecure iframe on secure page");
-        testsToRunSecure["securePage_navigate_child"] = true;
+        testsToRunSecure.securePage_navigate_child = true;
         break;
 
       case "blankTarget":
         is(event.data.msg, "opened an http link with target=_blank from a secure page", "couldn't open an http link in a new window from a secure page");
-        testsToRunSecure["blankTarget"] = true;
+        testsToRunSecure.blankTarget = true;
         break;
 
     }
     checkTestsCompleted();
   }
 
   SimpleTest.waitForExplicitFinish();
   </script>
--- a/dom/security/test/mixedcontentblocker/test_main.html
+++ b/dom/security/test/mixedcontentblocker/test_main.html
@@ -109,106 +109,106 @@ https://bugzilla.mozilla.org/show_bug.cg
     // test that the load type matches the pref for this type of content
     // (i.e. active vs. display)
 
     switch(event.data.test) {
 
       /* Mixed Script tests */
       case "iframe":
         ok(blockActive == (event.data.msg == "insecure iframe blocked"), "iframe did not follow block_active_content pref");
-        testsToRun["iframe"] = true;
+        testsToRun.iframe = true;
         break;
 
       case "object":
         ok(blockActive == (event.data.msg == "insecure object blocked"), "object did not follow block_active_content pref");
-        testsToRun["object"] = true;
+        testsToRun.object = true;
         break;
 
       case "script":
         ok(blockActive == (event.data.msg == "insecure script blocked"), "script did not follow block_active_content pref");
-        testsToRun["script"] = true;
+        testsToRun.script = true;
         break;
 
       case "stylesheet":
         ok(blockActive == (event.data.msg == "insecure stylesheet blocked"), "stylesheet did not follow block_active_content pref");
-        testsToRun["stylesheet"] = true;
+        testsToRun.stylesheet = true;
         break;
 
       case "xhr":
         ok(blockActive == (event.data.msg == "insecure xhr blocked"), "xhr did not follow block_active_content pref");
-        testsToRun["xhr"] = true;
+        testsToRun.xhr = true;
         break;
 
       /* Mixed Display tests */
       case "image":
         //test that the image load matches the pref for display content
         if (upgradeDisplay) {
           ok(event.data.msg == "secure image loaded after upgrade", "image did not follow upgrade_display_content pref");
         } else {
           ok(blockDisplay == (event.data.msg == "insecure image blocked"), "image did not follow block_display_content pref");
         }
-        testsToRun["image"] = true;
+        testsToRun.image = true;
         break;
 
       case "media":
         if (upgradeDisplay) {
           ok(event.data.msg == "secure media loaded after upgrade", "media did not follow upgrade_display_content pref");
         } else {
           ok(blockDisplay == (event.data.msg == "insecure media blocked"), "media did not follow block_display_content pref");
         }
-        testsToRun["media"] = true;
+        testsToRun.media = true;
         break;
 
       /* Images using the "imageset" policy, from <img srcset> and <picture>, do not get the mixed display exception */
       case "imageSrcset":
         // When blockDisplay && blockActive && upgradeDisplay are all true the request is blocked
         // This appears to be a side effect of blockDisplay taking precedence here.
         if (event.data.msg == "secure image loaded after upgrade") {
           ok(upgradeDisplay, "imageSrcset did not follow upgrade_display_content pref");
         } else {
           ok(blockActive == (event.data.msg == "insecure image blocked"), "imageSrcset did not follow block_active_content pref");
         }
-        testsToRun["imageSrcset"] = true;
+        testsToRun.imageSrcset = true;
         break;
 
       case "imageSrcsetFallback":
         if (event.data.msg == "secure image loaded after upgrade") {
           ok(upgradeDisplay, "imageSrcsetFallback did not follow upgrade_display_content pref");
         } else {
           ok(blockActive == (event.data.msg == "insecure image blocked"), "imageSrcsetFallback did not follow block_active_content pref");
         }
-        testsToRun["imageSrcsetFallback"] = true;
+        testsToRun.imageSrcsetFallback = true;
         break;
 
       case "imagePicture":
         if (event.data.msg == "secure image loaded after upgrade") {
           ok(upgradeDisplay, "imagePicture did not follow upgrade_display_content pref");
         } else {
           ok(blockActive == (event.data.msg == "insecure image blocked"), "imagePicture did not follow block_active_content pref");
         }
-        testsToRun["imagePicture"] = true;
+        testsToRun.imagePicture = true;
         break;
 
       case "imageJoinPicture":
         if (event.data.msg == "secure image loaded after upgrade") {
           ok(upgradeDisplay, "imageJoinPicture did not follow upgrade_display_content pref");
         } else {
           ok(blockActive == (event.data.msg == "insecure image blocked"), "imageJoinPicture did not follow block_active_content pref");
         }
-        testsToRun["imageJoinPicture"] = true;
+        testsToRun.imageJoinPicture = true;
         break;
 
       // Should return to mixed display mode
       case "imageLeavePicture":
         if (event.data.msg == "secure image loaded after upgrade") {
           ok(upgradeDisplay, "imageLeavePicture did not follow upgrade_display_content pref");
         } else {
           ok(blockDisplay == (event.data.msg == "insecure image blocked"), "imageLeavePicture did not follow block_display_content pref");
         }
-        testsToRun["imageLeavePicture"] = true;
+        testsToRun.imageLeavePicture = true;
         break;
 
     }
     checkTestsCompleted();
   }
 
   function startTest() {
     //Set the first set of mixed content settings and increment the counter.
--- a/dom/serviceworkers/test/fetch.js
+++ b/dom/serviceworkers/test/fetch.js
@@ -16,18 +16,18 @@ addEventListener("fetch", function(event
   if (event.request.url.includes("fail.html")) {
     event.respondWith(fetch("hello.html", { integrity: "abc" }));
   } else if (event.request.url.includes("fake.html")) {
     event.respondWith(fetch("hello.html"));
   } else if (event.request.url.includes("file_js_cache")) {
     event.respondWith(fetch(event.request));
   } else if (event.request.url.includes("redirect")) {
     let param = get_query_params(event.request.url);
-    let url = param["url"];
-    let mode = param["mode"];
+    let url = param.url;
+    let mode = param.mode;
 
     event.respondWith(fetch(url, { mode }));
   }
 });
 
 addEventListener("message", function(event) {
   if (event.data === "claim") {
     event.waitUntil(clients.claim());
--- a/dom/serviceworkers/test/notificationclick.js
+++ b/dom/serviceworkers/test/notificationclick.js
@@ -9,15 +9,15 @@ onnotificationclick = function(e) {
       );
       return;
     }
 
     clients.forEach(function(client) {
       client.postMessage({
         result:
           e.notification.data &&
-          e.notification.data["complex"] &&
-          e.notification.data["complex"][0] == "jsval" &&
-          e.notification.data["complex"][1] == 5,
+          e.notification.data.complex &&
+          e.notification.data.complex[0] == "jsval" &&
+          e.notification.data.complex[1] == 5,
       });
     });
   });
 };
--- a/dom/serviceworkers/test/notificationclose.js
+++ b/dom/serviceworkers/test/notificationclose.js
@@ -14,18 +14,18 @@ onnotificationclose = function(e) {
           dump("*** CLIENTS LIST EMPTY! Test will timeout! ***\n");
           return;
         }
 
         clients.forEach(function(client) {
           client.postMessage({
             result:
               e.notification.data &&
-              e.notification.data["complex"] &&
-              e.notification.data["complex"][0] == "jsval" &&
-              e.notification.data["complex"][1] == 5,
+              e.notification.data.complex &&
+              e.notification.data.complex[0] == "jsval" &&
+              e.notification.data.complex[1] == 5,
             windowOpened,
           });
         });
       });
     })()
   );
 };
--- a/dom/smil/test/test_smilAnimateMotionOverrideRules.xhtml
+++ b/dom/smil/test/test_smilAnimateMotionOverrideRules.xhtml
@@ -96,71 +96,71 @@ function runTest() {
   };
 
   // Test that <mpath> overrides everything below it
   testAttrSettings(attrSettings, gMpathCTM,
                    "<mpath> should win");
   var mpathInvalidTargets = [gMpathInvalidTargetA, gMpathInvalidTargetB];
   for (var i in mpathInvalidTargets) {
     var curInvalidValue = mpathInvalidTargets[i];
-    attrSettings["mpath"] = curInvalidValue;
+    attrSettings.mpath = curInvalidValue;
     testAttrSettings(attrSettings, gUnAnimatedCTM,
                      "invalid <mpath> should block animation");
   }
-  delete attrSettings["mpath"];
+  delete attrSettings.mpath;
 
   // Test that 'path' overrides everything below it
   testAttrSettings(attrSettings, gPathCTM,
                    "'path' should win vs all but mpath");
-  attrSettings["path"] = gInvalidAttrValue;
+  attrSettings.path = gInvalidAttrValue;
   testAttrSettings(attrSettings, gUnAnimatedCTM,
                    "invalid 'path' should block animation vs all but mpath");
-  delete attrSettings["path"];
+  delete attrSettings.path;
 
   // Test that 'values' overrides everything below it
   testAttrSettings(attrSettings, gValuesCTM,
                    "'values' should win vs from/by/to");
-  attrSettings["values"] = gInvalidAttrValue;
+  attrSettings.values = gInvalidAttrValue;
   testAttrSettings(attrSettings, gUnAnimatedCTM,
                    "invalid 'values' should block animation vs from/by/to");
-  delete attrSettings["values"];
+  delete attrSettings.values;
 
   // Test that 'from' & 'to' overrides 'by'
   testAttrSettings(attrSettings, gFromToCTM,
                    "'from/to' should win vs 'by'");
-  attrSettings["to"] = gInvalidAttrValue;
+  attrSettings.to = gInvalidAttrValue;
   testAttrSettings(attrSettings, gUnAnimatedCTM,
                    "invalid 'to' should block animation vs 'by'");
-  delete attrSettings["to"];
+  delete attrSettings.to;
 
   // Test that 'from' & 'by' are effective
   testAttrSettings(attrSettings, gFromByCTM,
                    "'from/by' should be visible");
-  attrSettings["by"] = gInvalidAttrValue;
+  attrSettings.by = gInvalidAttrValue;
   testAttrSettings(attrSettings, gUnAnimatedCTM,
                    "invalid 'by' should block animation");
-  delete attrSettings["from"];
+  delete attrSettings.from;
 
   // REINSERT "to" & fix up "by" so we can test pure-"to" vs pure-"by"
-  attrSettings["to"] = gToValidValue;
-  attrSettings["by"] = gByValidValue;
+  attrSettings.to = gToValidValue;
+  attrSettings.by = gByValidValue;
   testAttrSettings(attrSettings, gPureToCTM,
                    "pure-'to' should be effective & beat pure-'by'");
-  attrSettings["to"] = gInvalidAttrValue;
+  attrSettings.to = gInvalidAttrValue;
   testAttrSettings(attrSettings, gUnAnimatedCTM,
                    "invalid pure-'to' should block animation vs pure-'by'");
-  delete attrSettings["to"];
+  delete attrSettings.to;
 
   // Test that pure-"by" is effective
   testAttrSettings(attrSettings, gPureByCTM,
                    "pure-by should be visible");
-  attrSettings["by"] = gInvalidAttrValue;
+  attrSettings.by = gInvalidAttrValue;
   testAttrSettings(attrSettings, gUnAnimatedCTM,
                    "invalid 'by' should block animation");
-  delete attrSettings["by"];
+  delete attrSettings.by;
 
   // Make sure that our hash is empty now.
   for (var unexpectedKey in attrSettings) {
     ok(false, "Unexpected mapping remains in attrSettings: " +
        unexpectedKey + "-->" + unexpectedValue);
   }
 }
 
--- a/dom/tests/mochitest/bugs/bug458091_child.html
+++ b/dom/tests/mochitest/bugs/bug458091_child.html
@@ -1,13 +1,13 @@
 <html> <head>
 <title></title>
 <script type="text/javascript">
 function finish() {
-  window.opener.finish(sessionStorage["testItem"]);
+  window.opener.finish(sessionStorage.testItem);
   window.close();
 }
 </script>
 </head>
 
 <body onload="finish();">
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug458091.html
+++ b/dom/tests/mochitest/bugs/test_bug458091.html
@@ -43,17 +43,17 @@ function finish(val)
   if (--gRunningTests == 0) {
     runNextTest();
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 
 function test1() {
-  sessionStorage["testItem"] = "correct value";
+  sessionStorage.testItem = "correct value";
 
   gRunningTests++;
   window.open('javascript:window.opener.finish(sessionStorage["testItem"]);window.close();');
 
   gRunningTests++;
   window.open("bug458091_child.html");
 
   gRunningTests++;
@@ -73,17 +73,17 @@ function test1() {
   gTestWin = window.open("about:blank", "testWindow");
   gTestWin.location = 'javascript:window.opener.finish(sessionStorage["testItem"]);';
 }
 
 function test2() {
   // Now change session storage and load a new item in gTestWin, to
   // verify that they properly diverged after window.open().
   gRunningTests++;
-  sessionStorage["testItem"] = "incorrect value";
+  sessionStorage.testItem = "incorrect value";
   gTestWin.location = 'javascript:window.opener.finish(sessionStorage["testItem"]);';
 }
 
 function test3()
 {
   // Now, with session storage still changed, try the window.open()
   // path, make sure it doesn't overwrite the session storage.
   gRunningTests++;
--- a/dom/tests/mochitest/chrome/489127.html
+++ b/dom/tests/mochitest/chrome/489127.html
@@ -37,17 +37,17 @@
     ok(true, "All correct nodes found for rect "  +
              "[" + x + "," + y + "], " + 
              "[" + top + "," + right + "," + bottom + "," + left + "]");
   }
 
   function doTest() {
 
     // Set up shortcut access to elements
-    e['html'] = document.getElementsByTagName("html")[0];
+    e.html = document.getElementsByTagName("html")[0];
     ['h1', 'd1', 'd2', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'span',
      'a1', 'a2', 'a3', 'transf', 'iframe1', 'body'].forEach(function(a) {
       e[a] = document.getElementById(a);
     });
 
     window.scrollTo(0, 0);
 
     // Top, Right, Bottom, Left directions:
--- a/dom/tests/mochitest/chrome/test_sandbox_postMessage.html
+++ b/dom/tests/mochitest/chrome/test_sandbox_postMessage.html
@@ -3,17 +3,17 @@
 <head>
   <title>Testing postMessage from sandbox</title>
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
 <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   function doTest() {
     var sandbox = Cu.Sandbox("http://mochi.test:8888/", { wantXrays: true });
-    var win = window.frames["sameDomain"];
+    var win = window.frames.sameDomain;
     sandbox.win = win;
     sandbox.is = is;
     sandbox.done = SimpleTest.finish;
 
     result = Cu.evalInSandbox('var data = {some:"data"};'
     +'win.addEventListener("message", receiveMessage, false);'
     +'function receiveMessage(event)'
     +'{'
--- a/dom/tests/mochitest/localstorage/frameKeySync.html
+++ b/dom/tests/mochitest/localstorage/frameKeySync.html
@@ -12,27 +12,27 @@ function doStep()
   switch (currentStep)
   {
     case 1:
       localStorage.clear();
       break;
 
     case 2:
       localStorage.setItem("a", "1");
-      is(localStorage["a"], "1", "Value a=1 set");
+      is(localStorage.a, "1", "Value a=1 set");
       break;
 
     case 3:
       try {
         is(localStorage.key(0), "a", "Key 'a' present in 'key' array")
       }
       catch (exc) {
         ok(false, "Shouldn't throw when accessing key(0) " + exc);
       }
-      is(localStorage["a"], "1", "Value a=1 set");
+      is(localStorage.a, "1", "Value a=1 set");
       break;
 
     default:
       return finishTest();
   }
 
   // Increase by two to as odd number are executed in a window separate from
   // where even step are.
--- a/dom/tests/mochitest/localstorage/test_localStorageBase.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageBase.html
@@ -36,25 +36,25 @@ var expectedEvents = [
 function startTest()
 {
   // Initially check the localStorage is empty
   is(localStorage.length, 0, "The storage is empty [1]");
   is(localStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
   is(localStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
-  is(localStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
+  is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
   is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
   localStorage.removeItem("nonexisting"); // Just check there is no exception
 
   is(typeof localStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
-  is(typeof localStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
+  is(typeof localStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
   is(typeof localStorage.nonexisting, "undefined", "nonexisting is undefined");
   is(typeof localStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
-  is(typeof localStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
+  is(typeof localStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
   is(typeof localStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
 
   var localStorageCopy = localStorage;
 
   function onStorageChanged(e) {
     if (e.storageArea == localStorageCopy) {
       ok(expectedEvents.length > 0, "Not more then expected events encountered");
       var receivedEvent = e.key + "," + e.oldValue + "," + e.newValue;
@@ -63,55 +63,55 @@ function startTest()
   }
 
   // Listen for MozLocalStorageChanged
   SpecialPowers.addChromeEventListener("MozLocalStorageChanged", onStorageChanged, true);
 
   // add an empty-value key
   localStorage.setItem("empty", "");
   is(localStorage.getItem("empty"), "", "Empty value (getItem())");
-  is(localStorage["empty"], "", "Empty value (array access)");
+  is(localStorage.empty, "", "Empty value (array access)");
   is(localStorage.empty, "", "Empty value (property access)");
   is(typeof localStorage.getItem("empty"), "string", "getItem('empty') is string");
-  is(typeof localStorage["empty"], "string", "['empty'] is string");
+  is(typeof localStorage.empty, "string", "['empty'] is string");
   is(typeof localStorage.empty, "string", "empty is string");
   localStorage.removeItem("empty");
   is(localStorage.length, 0, "The storage has no keys");
   is(localStorage.getItem("empty"), null, "empty item is null (getItem())");
-  is(localStorage["empty"], undefined, "empty item is undefined (array access)");
+  is(localStorage.empty, undefined, "empty item is undefined (array access)");
   is(localStorage.empty, undefined, "empty item is undefined (property access)");
   is(typeof localStorage.getItem("empty"), "object", "getItem('empty') is object");
-  is(typeof localStorage["empty"], "undefined", "['empty'] is undefined");
+  is(typeof localStorage.empty, "undefined", "['empty'] is undefined");
   is(typeof localStorage.empty, "undefined", "empty is undefined");
 
   // add one key, check it is there
   localStorage.setItem("key1", "value1");
   is(localStorage.length, 1, "The storage has one key-value pair");
   is(localStorage.key(0), "key1");
   is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
 
   // check all access method give the correct result
   // and are of the correct type
   is(localStorage.getItem("key1"), "value1", "getItem('key1') == value1");
-  is(localStorage["key1"], "value1", "['key1'] == value1");
+  is(localStorage.key1, "value1", "['key1'] == value1");
   is(localStorage.key1, "value1", "key1 == value1");
 
   is(typeof localStorage.getItem("key1"), "string", "getItem('key1') is string");
-  is(typeof localStorage["key1"], "string", "['key1'] is string");
+  is(typeof localStorage.key1, "string", "['key1'] is string");
   is(typeof localStorage.key1, "string", "key1 is string");
 
   // remove the previously added key and check the storage is empty
   localStorage.removeItem("key1");
   is(localStorage.length, 0, "The storage is empty [2]");
   is(localStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(localStorage.getItem("key1"), null, "\'key1\' removed");
 
   is(typeof localStorage.getItem("key1"), "object", "getItem('key1') is object");
-  is(typeof localStorage["key1"], "undefined", "['key1'] is object");
+  is(typeof localStorage.key1, "undefined", "['key1'] is object");
   is(typeof localStorage.key1, "undefined", "key1 is object");
 
   // add one key, check it is there
   localStorage.setItem("key1", "value1");
   is(localStorage.length, 1, "The storage has one key-value pair");
   is(localStorage.key(0), "key1");
   is(localStorage.getItem("key1"), "value1");
 
@@ -152,62 +152,62 @@ function startTest()
   is(localStorage.key(0), "key1");
   is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
   is(localStorage.getItem("key1"), "value1-2");
 
   // JS property test
   localStorage.testA = "valueA";
   is(localStorage.testA, "valueA");
-  is(localStorage["testA"], "valueA");
+  is(localStorage.testA, "valueA");
   is(localStorage.getItem("testA"), "valueA");
 
   localStorage.testA = "valueA2";
   is(localStorage.testA, "valueA2");
-  is(localStorage["testA"], "valueA2");
+  is(localStorage.testA, "valueA2");
   is(localStorage.getItem("testA"), "valueA2");
 
-  localStorage["testB"] = "valueB";
+  localStorage.testB = "valueB";
   is(localStorage.testB, "valueB");
-  is(localStorage["testB"], "valueB");
+  is(localStorage.testB, "valueB");
   is(localStorage.getItem("testB"), "valueB");
 
-  localStorage["testB"] = "valueB2";
+  localStorage.testB = "valueB2";
   is(localStorage.testB, "valueB2");
-  is(localStorage["testB"], "valueB2");
+  is(localStorage.testB, "valueB2");
   is(localStorage.getItem("testB"), "valueB2");
 
   localStorage.setItem("testC", "valueC");
   is(localStorage.testC, "valueC");
-  is(localStorage["testC"], "valueC");
+  is(localStorage.testC, "valueC");
   is(localStorage.getItem("testC"), "valueC");
 
   localStorage.setItem("testC", "valueC2");
   is(localStorage.testC, "valueC2");
-  is(localStorage["testC"], "valueC2");
+  is(localStorage.testC, "valueC2");
   is(localStorage.getItem("testC"), "valueC2");
 
   localStorage.setItem("testC", null);
   is("testC" in localStorage, true);
   is(localStorage.getItem("testC"), "null");
-  is(localStorage["testC"], "null");
+  is(localStorage.testC, "null");
   is(localStorage.testC, "null");
 
   localStorage.removeItem("testC");
-  localStorage["testC"] = null;
+  localStorage.testC = null;
   is("testC" in localStorage, true);
   is(localStorage.getItem("testC"), "null");
-  is(localStorage["testC"], "null");
+  is(localStorage.testC, "null");
   is(localStorage.testC, "null");
 
   localStorage.setItem(null, "test");
   is("null" in localStorage, true);
   is(localStorage.getItem("null"), "test");
   is(localStorage.getItem(null), "test");
-  is(localStorage["null"], "test");
+  is(localStorage.null, "test");
   localStorage.removeItem(null, "test");
   is("null" in localStorage, false);
 
   localStorage.setItem(null, "test");
   is("null" in localStorage, true);
   localStorage.removeItem("null", "test");
   is("null" in localStorage, false);
 
--- a/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html
@@ -45,69 +45,69 @@ function doTest() {
       is(privateWin.content.localStorage.getItem("persistent"), null, "previous values are inaccessible");
 
       // Initially check the privateWin.content.localStorage is empty
       is(privateWin.content.localStorage.length, 0, "The storage is empty [1]");
       is(privateWin.content.localStorage.key(0), null, "key() should return null for out-of-bounds access");
       is(privateWin.content.localStorage.key(-1), null, "key() should return null for out-of-bounds access");
       is(privateWin.content.localStorage.key(1), null, "key() should return null for out-of-bounds access");
       is(privateWin.content.localStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
-      is(privateWin.content.localStorage["nonexisting"], undefined, "Nonexisting item is null (array access)");
+      is(privateWin.content.localStorage.nonexisting, undefined, "Nonexisting item is null (array access)");
       is(privateWin.content.localStorage.nonexisting, undefined, "Nonexisting item is null (property access)");
       privateWin.content.localStorage.removeItem("nonexisting"); // Just check there is no exception
 
       is(typeof privateWin.content.localStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
-      is(typeof privateWin.content.localStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
+      is(typeof privateWin.content.localStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
       is(typeof privateWin.content.localStorage.nonexisting, "undefined", "nonexisting is undefined");
       is(typeof privateWin.content.localStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
-      is(typeof privateWin.content.localStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
+      is(typeof privateWin.content.localStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
       is(typeof privateWin.content.localStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
 
       // add an empty-value key
       privateWin.content.localStorage.setItem("empty", "");
       is(privateWin.content.localStorage.getItem("empty"), "", "Empty value (getItem())");
-      is(privateWin.content.localStorage["empty"], "", "Empty value (array access)");
+      is(privateWin.content.localStorage.empty, "", "Empty value (array access)");
       is(privateWin.content.localStorage.empty, "", "Empty value (property access)");
       is(typeof privateWin.content.localStorage.getItem("empty"), "string", "getItem('empty') is string");
-      is(typeof privateWin.content.localStorage["empty"], "string", "['empty'] is string");
+      is(typeof privateWin.content.localStorage.empty, "string", "['empty'] is string");
       is(typeof privateWin.content.localStorage.empty, "string", "empty is string");
       privateWin.content.localStorage.removeItem("empty");
       is(privateWin.content.localStorage.length, 0, "The storage has no keys");
       is(privateWin.content.localStorage.getItem("empty"), null, "empty item is null (getItem())");
-      is(privateWin.content.localStorage["empty"], undefined, "empty item is undefined (array access)");
+      is(privateWin.content.localStorage.empty, undefined, "empty item is undefined (array access)");
       is(privateWin.content.localStorage.empty, undefined, "empty item is undefined (property access)");
       is(typeof privateWin.content.localStorage.getItem("empty"), "object", "getItem('empty') is object");
-      is(typeof privateWin.content.localStorage["empty"], "undefined", "['empty'] is undefined");
+      is(typeof privateWin.content.localStorage.empty, "undefined", "['empty'] is undefined");
       is(typeof privateWin.content.localStorage.empty, "undefined", "empty is undefined");
 
       // add one key, check it is there
       privateWin.content.localStorage.setItem("key1", "value1");
       is(privateWin.content.localStorage.length, 1, "The storage has one key-value pair");
       is(privateWin.content.localStorage.key(0), "key1");
       is(privateWin.content.localStorage.key(-1), null, "key() should return null for out-of-bounds access");
       is(privateWin.content.localStorage.key(1), null, "key() should return null for out-of-bounds access");
 
       // check all access method give the correct result
       // and are of the correct type
       is(privateWin.content.localStorage.getItem("key1"), "value1", "getItem('key1') == value1");
-      is(privateWin.content.localStorage["key1"], "value1", "['key1'] == value1");
+      is(privateWin.content.localStorage.key1, "value1", "['key1'] == value1");
       is(privateWin.content.localStorage.key1, "value1", "key1 == value1");
 
       is(typeof privateWin.content.localStorage.getItem("key1"), "string", "getItem('key1') is string");
-      is(typeof privateWin.content.localStorage["key1"], "string", "['key1'] is string");
+      is(typeof privateWin.content.localStorage.key1, "string", "['key1'] is string");
       is(typeof privateWin.content.localStorage.key1, "string", "key1 is string");
 
       // remove the previously added key and check the storage is empty
       privateWin.content.localStorage.removeItem("key1");
       is(privateWin.content.localStorage.length, 0, "The storage is empty [2]");
       is(privateWin.content.localStorage.key(0), null, "key() should return null for out-of-bounds access");
       is(privateWin.content.localStorage.getItem("key1"), null, "\'key1\' removed");
 
       is(typeof privateWin.content.localStorage.getItem("key1"), "object", "getItem('key1') is object");
-      is(typeof privateWin.content.localStorage["key1"], "undefined", "['key1'] is undefined");
+      is(typeof privateWin.content.localStorage.key1, "undefined", "['key1'] is undefined");
       is(typeof privateWin.content.localStorage.key1, "undefined", "key1 is undefined");
 
       // add one key, check it is there
       privateWin.content.localStorage.setItem("key1", "value1");
       is(privateWin.content.localStorage.length, 1, "The storage has one key-value pair");
       is(privateWin.content.localStorage.key(0), "key1");
       is(privateWin.content.localStorage.getItem("key1"), "value1");
 
@@ -148,62 +148,62 @@ function doTest() {
       is(privateWin.content.localStorage.key(0), "key1");
       is(privateWin.content.localStorage.key(-1), null, "key() should return null for out-of-bounds access");
       is(privateWin.content.localStorage.key(1), null, "key() should return null for out-of-bounds access");
       is(privateWin.content.localStorage.getItem("key1"), "value1-2");
 
       // JS property test
       privateWin.content.localStorage.testA = "valueA";
       is(privateWin.content.localStorage.testA, "valueA");
-      is(privateWin.content.localStorage["testA"], "valueA");
+      is(privateWin.content.localStorage.testA, "valueA");
       is(privateWin.content.localStorage.getItem("testA"), "valueA");
 
       privateWin.content.localStorage.testA = "valueA2";
       is(privateWin.content.localStorage.testA, "valueA2");
-      is(privateWin.content.localStorage["testA"], "valueA2");
+      is(privateWin.content.localStorage.testA, "valueA2");
       is(privateWin.content.localStorage.getItem("testA"), "valueA2");
 
-      privateWin.content.localStorage["testB"] = "valueB";
+      privateWin.content.localStorage.testB = "valueB";
       is(privateWin.content.localStorage.testB, "valueB");
-      is(privateWin.content.localStorage["testB"], "valueB");
+      is(privateWin.content.localStorage.testB, "valueB");
       is(privateWin.content.localStorage.getItem("testB"), "valueB");
 
-      privateWin.content.localStorage["testB"] = "valueB2";
+      privateWin.content.localStorage.testB = "valueB2";
       is(privateWin.content.localStorage.testB, "valueB2");
-      is(privateWin.content.localStorage["testB"], "valueB2");
+      is(privateWin.content.localStorage.testB, "valueB2");
       is(privateWin.content.localStorage.getItem("testB"), "valueB2");
 
       privateWin.content.localStorage.setItem("testC", "valueC");
       is(privateWin.content.localStorage.testC, "valueC");
-      is(privateWin.content.localStorage["testC"], "valueC");
+      is(privateWin.content.localStorage.testC, "valueC");
       is(privateWin.content.localStorage.getItem("testC"), "valueC");
 
       privateWin.content.localStorage.setItem("testC", "valueC2");
       is(privateWin.content.localStorage.testC, "valueC2");
-      is(privateWin.content.localStorage["testC"], "valueC2");
+      is(privateWin.content.localStorage.testC, "valueC2");
       is(privateWin.content.localStorage.getItem("testC"), "valueC2");
 
       privateWin.content.localStorage.setItem("testC", null);
       is("testC" in privateWin.content.localStorage, true);
       is(privateWin.content.localStorage.getItem("testC"), "null");
-      is(privateWin.content.localStorage["testC"], "null");
+      is(privateWin.content.localStorage.testC, "null");
       is(privateWin.content.localStorage.testC, "null");
 
       privateWin.content.localStorage.removeItem("testC");
-      privateWin.content.localStorage["testC"] = null;
+      privateWin.content.localStorage.testC = null;
       is("testC" in privateWin.content.localStorage, true);
       is(privateWin.content.localStorage.getItem("testC"), "null");
-      is(privateWin.content.localStorage["testC"], "null");
+      is(privateWin.content.localStorage.testC, "null");
       is(privateWin.content.localStorage.testC, "null");
 
       privateWin.content.localStorage.setItem(null, "test");
       is("null" in privateWin.content.localStorage, true);
       is(privateWin.content.localStorage.getItem("null"), "test");
       is(privateWin.content.localStorage.getItem(null), "test");
-      is(privateWin.content.localStorage["null"], "test");
+      is(privateWin.content.localStorage.null, "test");
       privateWin.content.localStorage.removeItem(null, "test");
       is("null" in privateWin.content.localStorage, false);
 
       privateWin.content.localStorage.setItem(null, "test");
       is("null" in privateWin.content.localStorage, true);
       privateWin.content.localStorage.removeItem("null", "test");
       is("null" in privateWin.content.localStorage, false);
 
--- a/dom/tests/mochitest/localstorage/test_localStorageBaseSessionOnly.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageBaseSessionOnly.html
@@ -20,69 +20,69 @@ function startTest()
 
 function test1() {
   // Initially check the localStorage is empty
   is(localStorage.length, 0, "The storage is empty [1]");
   is(localStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
   is(localStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
-  is(localStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
+  is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
   is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
   localStorage.removeItem("nonexisting"); // Just check there is no exception
 
   is(typeof localStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
-  is(typeof localStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
+  is(typeof localStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
   is(typeof localStorage.nonexisting, "undefined", "nonexisting is undefined");
   is(typeof localStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
-  is(typeof localStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
+  is(typeof localStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
   is(typeof localStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
 
   // add an empty-value key
   localStorage.setItem("empty", "");
   is(localStorage.getItem("empty"), "", "Empty value (getItem())");
-  is(localStorage["empty"], "", "Empty value (array access)");
+  is(localStorage.empty, "", "Empty value (array access)");
   is(localStorage.empty, "", "Empty value (property access)");
   is(typeof localStorage.getItem("empty"), "string", "getItem('empty') is string");
-  is(typeof localStorage["empty"], "string", "['empty'] is string");
+  is(typeof localStorage.empty, "string", "['empty'] is string");
   is(typeof localStorage.empty, "string", "empty is string");
   localStorage.removeItem("empty");
   is(localStorage.length, 0, "The storage has no keys");
   is(localStorage.getItem("empty"), null, "empty item is null (getItem())");
-  is(localStorage["empty"], undefined, "empty item is undefined (array access)");
+  is(localStorage.empty, undefined, "empty item is undefined (array access)");
   is(localStorage.empty, undefined, "empty item is undefined (property access)");
   is(typeof localStorage.getItem("empty"), "object", "getItem('empty') is object");
-  is(typeof localStorage["empty"], "undefined", "['empty'] is undefined");
+  is(typeof localStorage.empty, "undefined", "['empty'] is undefined");
   is(typeof localStorage.empty, "undefined", "empty is undefined");
 
   // add one key, check it is there
   localStorage.setItem("key1", "value1");
   is(localStorage.length, 1, "The storage has one key-value pair");
   is(localStorage.key(0), "key1");
   is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
 
   // check all access method give the correct result
   // and are of the correct type
   is(localStorage.getItem("key1"), "value1", "getItem('key1') == value1");
-  is(localStorage["key1"], "value1", "['key1'] == value1");
+  is(localStorage.key1, "value1", "['key1'] == value1");
   is(localStorage.key1, "value1", "key1 == value1");
 
   is(typeof localStorage.getItem("key1"), "string", "getItem('key1') is string");
-  is(typeof localStorage["key1"], "string", "['key1'] is string");
+  is(typeof localStorage.key1, "string", "['key1'] is string");
   is(typeof localStorage.key1, "string", "key1 is string");
 
   // remove the previously added key and check the storage is empty
   localStorage.removeItem("key1");
   is(localStorage.length, 0, "The storage is empty [2]");
   is(localStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(localStorage.getItem("key1"), null, "\'key1\' removed");
 
   is(typeof localStorage.getItem("key1"), "object", "getItem('key1') is object");
-  is(typeof localStorage["key1"], "undefined", "['key1'] is undefined");
+  is(typeof localStorage.key1, "undefined", "['key1'] is undefined");
   is(typeof localStorage.key1, "undefined", "key1 is undefined");
 
   // add one key, check it is there
   localStorage.setItem("key1", "value1");
   is(localStorage.length, 1, "The storage has one key-value pair");
   is(localStorage.key(0), "key1");
   is(localStorage.getItem("key1"), "value1");
 
@@ -123,62 +123,62 @@ function test1() {
   is(localStorage.key(0), "key1");
   is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
   is(localStorage.getItem("key1"), "value1-2");
 
   // JS property test
   localStorage.testA = "valueA";
   is(localStorage.testA, "valueA");
-  is(localStorage["testA"], "valueA");
+  is(localStorage.testA, "valueA");
   is(localStorage.getItem("testA"), "valueA");
 
   localStorage.testA = "valueA2";
   is(localStorage.testA, "valueA2");
-  is(localStorage["testA"], "valueA2");
+  is(localStorage.testA, "valueA2");
   is(localStorage.getItem("testA"), "valueA2");
 
-  localStorage["testB"] = "valueB";
+  localStorage.testB = "valueB";
   is(localStorage.testB, "valueB");
-  is(localStorage["testB"], "valueB");
+  is(localStorage.testB, "valueB");
   is(localStorage.getItem("testB"), "valueB");
 
-  localStorage["testB"] = "valueB2";
+  localStorage.testB = "valueB2";
   is(localStorage.testB, "valueB2");
-  is(localStorage["testB"], "valueB2");
+  is(localStorage.testB, "valueB2");
   is(localStorage.getItem("testB"), "valueB2");
 
   localStorage.setItem("testC", "valueC");
   is(localStorage.testC, "valueC");
-  is(localStorage["testC"], "valueC");
+  is(localStorage.testC, "valueC");
   is(localStorage.getItem("testC"), "valueC");
 
   localStorage.setItem("testC", "valueC2");
   is(localStorage.testC, "valueC2");
-  is(localStorage["testC"], "valueC2");
+  is(localStorage.testC, "valueC2");
   is(localStorage.getItem("testC"), "valueC2");
 
   localStorage.setItem("testC", null);
   is("testC" in localStorage, true);
   is(localStorage.getItem("testC"), "null");
-  is(localStorage["testC"], "null");
+  is(localStorage.testC, "null");
   is(localStorage.testC, "null");
 
   localStorage.removeItem("testC");
-  localStorage["testC"] = null;
+  localStorage.testC = null;
   is("testC" in localStorage, true);
   is(localStorage.getItem("testC"), "null");
-  is(localStorage["testC"], "null");
+  is(localStorage.testC, "null");
   is(localStorage.testC, "null");
 
   localStorage.setItem(null, "test");
   is("null" in localStorage, true);
   is(localStorage.getItem("null"), "test");
   is(localStorage.getItem(null), "test");
-  is(localStorage["null"], "test");
+  is(localStorage.null, "test");
   localStorage.removeItem(null, "test");
   is("null" in localStorage, false);
 
   localStorage.setItem(null, "test");
   is("null" in localStorage, true);
   localStorage.removeItem("null", "test");
   is("null" in localStorage, false);
 
--- a/dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html
+++ b/dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html
@@ -28,25 +28,25 @@ function setup() {
 function startTest()
 {
   // Initially check the sessionStorage is empty
   is(sessionStorage.length, 0, "The storage is empty [1]");
   is(sessionStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.key(1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
-  is(sessionStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
+  is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
   is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
   sessionStorage.removeItem("nonexisting"); // Just check there is no exception
 
   is(typeof sessionStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
-  is(typeof sessionStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
+  is(typeof sessionStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
   is(typeof sessionStorage.nonexisting, "undefined", "nonexisting is undefined");
   is(typeof sessionStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
-  is(typeof sessionStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
+  is(typeof sessionStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
   is(typeof sessionStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
 
   var sessionStorageCopy = sessionStorage;
 
   function onStorageChanged(e) {
     if (e.storageArea == sessionStorageCopy) {
       ok(expectedEvents.length > 0, "Not more then expected events encountered");
       var receivedEvent = e.key + "," + e.oldValue + "," + e.newValue;
@@ -55,55 +55,55 @@ function startTest()
   }
 
   // Listen for MozSessionStorageChanged
   SpecialPowers.addChromeEventListener("MozSessionStorageChanged", onStorageChanged, true);
 
   // add an empty-value key
   sessionStorage.setItem("empty", "");
   is(sessionStorage.getItem("empty"), "", "Empty value (getItem())");
-  is(sessionStorage["empty"], "", "Empty value (array access)");
+  is(sessionStorage.empty, "", "Empty value (array access)");
   is(sessionStorage.empty, "", "Empty value (property access)");
   is(typeof sessionStorage.getItem("empty"), "string", "getItem('empty') is string");
-  is(typeof sessionStorage["empty"], "string", "['empty'] is string");
+  is(typeof sessionStorage.empty, "string", "['empty'] is string");
   is(typeof sessionStorage.empty, "string", "empty is string");
   sessionStorage.removeItem("empty");
   is(sessionStorage.length, 0, "The storage has no keys");
   is(sessionStorage.getItem("empty"), null, "empty item is null (getItem())");
-  is(sessionStorage["empty"], undefined, "empty item is undefined (array access)");
+  is(sessionStorage.empty, undefined, "empty item is undefined (array access)");
   is(sessionStorage.empty, undefined, "empty item is undefined (property access)");
   is(typeof sessionStorage.getItem("empty"), "object", "getItem('empty') is object");
-  is(typeof sessionStorage["empty"], "undefined", "['empty'] is undefined");
+  is(typeof sessionStorage.empty, "undefined", "['empty'] is undefined");
   is(typeof sessionStorage.empty, "undefined", "empty is undefined");
 
   // add one key, check it is there
   sessionStorage.setItem("key1", "value1");
   is(sessionStorage.length, 1, "The storage has one key-value pair");
   is(sessionStorage.key(0), "key1");
   is(sessionStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.key(1), null, "key() should return null for out-of-bounds access");
 
   // check all access method give the correct result
   // and are of the correct type
   is(sessionStorage.getItem("key1"), "value1", "getItem('key1') == value1");
-  is(sessionStorage["key1"], "value1", "['key1'] == value1");
+  is(sessionStorage.key1, "value1", "['key1'] == value1");
   is(sessionStorage.key1, "value1", "key1 == value1");
 
   is(typeof sessionStorage.getItem("key1"), "string", "getItem('key1') is string");
-  is(typeof sessionStorage["key1"], "string", "['key1'] is string");
+  is(typeof sessionStorage.key1, "string", "['key1'] is string");
   is(typeof sessionStorage.key1, "string", "key1 is string");
 
   // remove the previously added key and check the storage is empty
   sessionStorage.removeItem("key1");
   is(sessionStorage.length, 0, "The storage is empty [2]");
   is(sessionStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.getItem("key1"), null, "\'key1\' removed");
 
   is(typeof sessionStorage.getItem("key1"), "object", "getItem('key1') is object");
-  is(typeof sessionStorage["key1"], "undefined", "['key1'] is undefined");
+  is(typeof sessionStorage.key1, "undefined", "['key1'] is undefined");
   is(typeof sessionStorage.key1, "undefined", "key1 is undefined");
 
   // add one key, check it is there
   sessionStorage.setItem("key1", "value1");
   is(sessionStorage.length, 1, "The storage has one key-value pair");
   is(sessionStorage.key(0), "key1");
   is(sessionStorage.getItem("key1"), "value1");
 
--- a/dom/tests/mochitest/sessionstorage/test_sessionStorageBaseSessionOnly.html
+++ b/dom/tests/mochitest/sessionstorage/test_sessionStorageBaseSessionOnly.html
@@ -36,69 +36,69 @@ function startTest() {
 function test1() {
 
   // Initially check the sessionStorage is empty
   is(sessionStorage.length, 0, "The storage is empty [1]");
   is(sessionStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.key(1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
-  is(sessionStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
+  is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
   is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
   sessionStorage.removeItem("nonexisting"); // Just check there is no exception
 
   is(typeof sessionStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
-  is(typeof sessionStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
+  is(typeof sessionStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
   is(typeof sessionStorage.nonexisting, "undefined", "nonexisting is undefined");
   is(typeof sessionStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
-  is(typeof sessionStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
+  is(typeof sessionStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
   is(typeof sessionStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
 
   // add an empty-value key
   sessionStorage.setItem("empty", "");
   is(sessionStorage.getItem("empty"), "", "Empty value (getItem())");
-  is(sessionStorage["empty"], "", "Empty value (array access)");
+  is(sessionStorage.empty, "", "Empty value (array access)");
   is(sessionStorage.empty, "", "Empty value (property access)");
   is(typeof sessionStorage.getItem("empty"), "string", "getItem('empty') is string");
-  is(typeof sessionStorage["empty"], "string", "['empty'] is string");
+  is(typeof sessionStorage.empty, "string", "['empty'] is string");
   is(typeof sessionStorage.empty, "string", "empty is string");
   sessionStorage.removeItem("empty");
   is(sessionStorage.length, 0, "The storage has no keys");
   is(sessionStorage.getItem("empty"), null, "empty item is null (getItem())");
-  is(sessionStorage["empty"], undefined, "empty item is undefined (array access)");
+  is(sessionStorage.empty, undefined, "empty item is undefined (array access)");
   is(sessionStorage.empty, undefined, "empty item is undefined (property access)");
   is(typeof sessionStorage.getItem("empty"), "object", "getItem('empty') is object");
-  is(typeof sessionStorage["empty"], "undefined", "['empty'] is undefined");
+  is(typeof sessionStorage.empty, "undefined", "['empty'] is undefined");
   is(typeof sessionStorage.empty, "undefined", "empty is undefined");
 
   // add one key, check it is there
   sessionStorage.setItem("key1", "value1");
   is(sessionStorage.length, 1, "The storage has one key-value pair");
   is(sessionStorage.key(0), "key1");
   is(sessionStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.key(1), null, "key() should return null for out-of-bounds access");
 
   // check all access method give the correct result
   // and are of the correct type
   is(sessionStorage.getItem("key1"), "value1", "getItem('key1') == value1");
-  is(sessionStorage["key1"], "value1", "['key1'] == value1");
+  is(sessionStorage.key1, "value1", "['key1'] == value1");
   is(sessionStorage.key1, "value1", "key1 == value1");
 
   is(typeof sessionStorage.getItem("key1"), "string", "getItem('key1') is string");
-  is(typeof sessionStorage["key1"], "string", "['key1'] is string");
+  is(typeof sessionStorage.key1, "string", "['key1'] is string");
   is(typeof sessionStorage.key1, "string", "key1 is string");
 
   // remove the previously added key and check the storage is empty
   sessionStorage.removeItem("key1");
   is(sessionStorage.length, 0, "The storage is empty [2]");
   is(sessionStorage.key(0), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.getItem("key1"), null, "\'key1\' removed");
 
   is(typeof sessionStorage.getItem("key1"), "object", "getItem('key1') is object");
-  is(typeof sessionStorage["key1"], "undefined", "['key1'] is undefined");
+  is(typeof sessionStorage.key1, "undefined", "['key1'] is undefined");
   is(typeof sessionStorage.key1, "undefined", "key1 is undefined");
 
   // add one key, check it is there
   sessionStorage.setItem("key1", "value1");
   is(sessionStorage.length, 1, "The storage has one key-value pair");
   is(sessionStorage.key(0), "key1");
   is(sessionStorage.getItem("key1"), "value1");
 
@@ -139,62 +139,62 @@ function test1() {
   is(sessionStorage.key(0), "key1");
   is(sessionStorage.key(-1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.key(1), null, "key() should return null for out-of-bounds access");
   is(sessionStorage.getItem("key1"), "value1-2");
 
   // JS property test
   sessionStorage.testA = "valueA";
   is(sessionStorage.testA, "valueA");
-  is(sessionStorage["testA"], "valueA");
+  is(sessionStorage.testA, "valueA");
   is(sessionStorage.getItem("testA"), "valueA");
 
   sessionStorage.testA = "valueA2";
   is(sessionStorage.testA, "valueA2");
-  is(sessionStorage["testA"], "valueA2");
+  is(sessionStorage.testA, "valueA2");
   is(sessionStorage.getItem("testA"), "valueA2");
 
-  sessionStorage["testB"] = "valueB";
+  sessionStorage.testB = "valueB";
   is(sessionStorage.testB, "valueB");
-  is(sessionStorage["testB"], "valueB");
+  is(sessionStorage.testB, "valueB");
   is(sessionStorage.getItem("testB"), "valueB");
 
-  sessionStorage["testB"] = "valueB2";
+  sessionStorage.testB = "valueB2";
   is(sessionStorage.testB, "valueB2");
-  is(sessionStorage["testB"], "valueB2");
+  is(sessionStorage.testB, "valueB2");
   is(sessionStorage.getItem("testB"), "valueB2");
 
   sessionStorage.setItem("testC", "valueC");
   is(sessionStorage.testC, "valueC");
-  is(sessionStorage["testC"], "valueC");
+  is(sessionStorage.testC, "valueC");
   is(sessionStorage.getItem("testC"), "valueC");
 
   sessionStorage.setItem("testC", "valueC2");
   is(sessionStorage.testC, "valueC2");
-  is(sessionStorage["testC"], "valueC2");
+  is(sessionStorage.testC, "valueC2");
   is(sessionStorage.getItem("testC"), "valueC2");
 
   sessionStorage.setItem("testC", null);
   is("testC" in sessionStorage, true);
   is(sessionStorage.getItem("testC"), "null");
-  is(sessionStorage["testC"], "null");
+  is(sessionStorage.testC, "null");
   is(sessionStorage.testC, "null");
 
   sessionStorage.removeItem("testC");
-  sessionStorage["testC"] = null;
+  sessionStorage.testC = null;
   is("testC" in sessionStorage, true);
   is(sessionStorage.getItem("testC"), "null");
-  is(sessionStorage["testC"], "null");
+  is(sessionStorage.testC, "null");
   is(sessionStorage.testC, "null");
 
   sessionStorage.setItem(null, "test");
   is("null" in sessionStorage, true);
   is(sessionStorage.getItem("null"), "test");
   is(sessionStorage.getItem(null), "test");
-  is(sessionStorage["null"], "test");
+  is(sessionStorage.null, "test");
   sessionStorage.removeItem(null, "test");
   is("null" in sessionStorage, false);
 
   sessionStorage.setItem(null, "test");
   is("null" in sessionStorage, true);
   sessionStorage.removeItem("null", "test");
   is("null" in sessionStorage, false);
 
--- a/dom/webauthn/tests/browser/browser_webauthn_telemetry.js
+++ b/dom/webauthn/tests/browser/browser_webauthn_telemetry.js
@@ -176,32 +176,32 @@ add_task(async function test() {
 
   // Check telemetry data.
   let webauthn_used = getTelemetryForScalar("security.webauthn_used");
   ok(
     webauthn_used,
     "Scalar keys are set: " + Object.keys(webauthn_used).join(", ")
   );
   is(
-    webauthn_used["U2FRegisterFinish"],
+    webauthn_used.U2FRegisterFinish,
     1,
     "webauthn_used U2FRegisterFinish scalar should be 1"
   );
   is(
-    webauthn_used["U2FSignFinish"],
+    webauthn_used.U2FSignFinish,
     1,
     "webauthn_used U2FSignFinish scalar should be 1"
   );
   is(
-    webauthn_used["U2FSignAbort"],
+    webauthn_used.U2FSignAbort,
     undefined,
     "webauthn_used U2FSignAbort scalar must be unset"
   );
   is(
-    webauthn_used["U2FRegisterAbort"],
+    webauthn_used.U2FRegisterAbort,
     undefined,
     "webauthn_used U2FRegisterAbort scalar must be unset"
   );
 
   validateHistogramEntryCount("WEBAUTHN_CREATE_CREDENTIAL_MS", 1);
   validateHistogramEntryCount("WEBAUTHN_GET_ASSERTION_MS", 1);
 
   BrowserTestUtils.removeTab(tab);
--- a/dom/webauthn/tests/test_webauthn_sameorigin.html
+++ b/dom/webauthn/tests/test_webauthn_sameorigin.html
@@ -154,93 +154,93 @@
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test basic good call
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: document.domain,
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsGood)
                       .catch(arrivingHereIsBad);
         },
         function () {
           // Test rpId being unset
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsGood)
                       .catch(arrivingHereIsBad);
         },
         function () {
           // Test this origin with optional fields
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: "user:pass@" + document.origin + ":8888",
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test blank rpId
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: "",
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test subdomain of this origin
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: "subdomain." + document.domain,
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test the same origin
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: "example.com",
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsGood)
                       .catch(arrivingHereIsBad);
         },
         function() {
           // Test the eTLD
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: "com",
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test a different domain within the same TLD
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: "alt.test",
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test basic good Create call but using an origin (Bug 1380421)
           let rp = {id: window.origin, name: "none"};
@@ -251,39 +251,39 @@
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test basic good Get call but using an origin (Bug 1380421)
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: window.origin,
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(expectSecurityError);
         },
         function () {
           // Test with an rpId that is not a valid domain string
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: document.domain + ":somejunk",
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(arrivingHereIsGood);
         },
         function () {
           // Test with another rpId that is not a valid domain string
           let publicKeyCredentialRequestOptions = {
             challenge: chall,
             rpId: document.domain + ":8888",
-            allowCredentials: [gTrackedCredential["basic"]]
+            allowCredentials: [gTrackedCredential.basic]
           };
           return credm.get({publicKey: publicKeyCredentialRequestOptions})
                       .then(arrivingHereIsBad)
                       .catch(arrivingHereIsGood);
         },
       ];
       var i = 0;
       var runNextTest = () => {
--- a/dom/workers/test/notification_worker.js
+++ b/dom/workers/test/notification_worker.js
@@ -42,17 +42,17 @@ if (self.Notification) {
       is(notification.tag, options.tag, "tag should get set");
       is(notification.icon, options.icon, "icon should get set");
       is(
         notification.data[0],
         "a complex object that should be",
         "data item 0 should be a matching string"
       );
       is(
-        notification.data[1]["structured"],
+        notification.data[1].structured,
         "cloned",
         "data item 1 should be a matching object literal"
       );
 
       // store notification in test context
       this.notification = notification;
 
       notification.onshow = function() {
--- a/dom/xslt/tests/XSLTMark/XSLTMark-view.js
+++ b/dom/xslt/tests/XSLTMark/XSLTMark-view.js
@@ -41,17 +41,17 @@ var view = {
     var line, res;
     var head = /^\[(.+)\]$/;
     var instruct = /^(.+)=(.+)$/;
     while (lines.length) {
       line = lines.shift();
       if (head.test(line)) {
         test = new Object();
         res = head.exec(line);
-        test["title"] = res[1];
+        test.title = res[1];
         this.testArray.push(test);
       } else if (line == "") {
         test = undefined;
       } else {
         res = instruct.exec(line);
         test[res[1]] = res[2];
       }
     }