Bug 1069416 - Part 7: Remove JS_HAS_SYMBOLS from dom. r=smaug
authorTooru Fujisawa <arai_a@mac.com>
Wed, 28 Jan 2015 13:06:38 +0900
changeset 239556 5f3d5ec3d30b5bf5ca77cf1191488ad58ed84d3f
parent 239555 1c34cc2fa5d9d09feedb676976e7a59708c47170
child 239557 3256cb6f0bc92cff4b6377dc3b3f0e290649c217
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewerssmaug
bugs1069416
milestone38.0a1
Bug 1069416 - Part 7: Remove JS_HAS_SYMBOLS from dom. r=smaug
dom/bindings/test/test_sequence_detection.html
dom/html/test/test_formelements.html
dom/html/test/test_htmlcollection.html
dom/html/test/test_named_options.html
dom/html/test/test_rowscollection.html
--- a/dom/bindings/test/test_sequence_detection.html
+++ b/dom/bindings/test/test_sequence_detection.html
@@ -11,19 +11,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript">
 
   /** Test for Bug 1066432 **/
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]}, function() {
     var testInterfaceJS = new TestInterfaceJS();
     ok(testInterfaceJS, "got a TestInterfaceJS object");
 
-    var JS_HAS_SYMBOLS = typeof Symbol === "function";
-    var std_iterator = JS_HAS_SYMBOLS ? Symbol.iterator : "@@iterator";
-    var nonIterableObject = {[std_iterator]: 5};
+    var nonIterableObject = {[Symbol.iterator]: 5};
 
     try {
       testInterfaceJS.testSequenceOverload(nonIterableObject);
       ok(false, "Should have thrown in the overload case");  // see long comment above!
     } catch (e) {
       ise(e.name, "TypeError", "Should get a TypeError for the overload case");
       ok(e.message.contains("not iterable"),
          "Should have a message about being non-iterable in the overload case");
--- a/dom/html/test/test_formelements.html
+++ b/dom/html/test/test_formelements.html
@@ -27,33 +27,26 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 772869 **/
 var x = $("f").elements;
 x.something = "another";
 names = [];
 for (var name in x) {
   names.push(name);
 }
-var JS_HAS_SYMBOLS = typeof Symbol === "function";
-is(names.length, JS_HAS_SYMBOLS ? 9 : 10,
-   "Should have 9 enumerated names (or 10 with '@@iterator')");
+is(names.length, 9, "Should have 9 enumerated names");
 is(names[0], "0", "Enum entry 1");
 is(names[1], "1", "Enum entry 2");
 is(names[2], "2", "Enum entry 3");
 is(names[3], "3", "Enum entry 4");
 is(names[4], "4", "Enum entry 5");
 is(names[5], "something", "Enum entry 6");
 is(names[6], "namedItem", "Enum entry 7");
 is(names[7], "item", "Enum entry 8");
-if (JS_HAS_SYMBOLS) {
-  is(names[8], "length", "Enum entry 9");
-} else {
-  is(names[8], "@@iterator", "Enum entry 9");
-  is(names[9], "length", "Enum entry 10");
-}
+is(names[8], "length", "Enum entry 9");
 
 names = Object.getOwnPropertyNames(x);
 is(names.length, 10, "Should have 10 items");
 // Now sort entries 5 through 8, for comparison purposes.  We don't sort the
 // whole array, because we want to make sure the ordering between the parts
 // is correct
 temp = names.slice(5, 9);
 temp.sort();
--- a/dom/html/test/test_htmlcollection.html
+++ b/dom/html/test/test_htmlcollection.html
@@ -23,32 +23,25 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 772869 **/
 var x = document.getElementsByClassName("foo");
 x.something = "another";
 var names = [];
 for (var name in x) {
   names.push(name);
 }
-var JS_HAS_SYMBOLS = typeof Symbol === "function";
-is(names.length, JS_HAS_SYMBOLS ? 8 : 9,
-   "Should have 8 enumerated names (or 9 with '@@iterator')");
+is(names.length, 8, "Should have 8 enumerated names");
 is(names[0], "0", "Enum entry 1")
 is(names[1], "1", "Enum entry 2")
 is(names[2], "2", "Enum entry 3")
 is(names[3], "3", "Enum entry 4")
 is(names[4], "something", "Enum entry 5")
 is(names[5], "item", "Enum entry 6")
 is(names[6], "namedItem", "Enum entry 7")
-if (JS_HAS_SYMBOLS) {
-  is(names[7], "length", "Enum entry 8");
-} else {
-  is(names[7], "@@iterator", "Enum entry 8");
-  is(names[8], "length", "Enum entry 9");
-}
+is(names[7], "length", "Enum entry 8");
 
 names = Object.getOwnPropertyNames(x);
 is(names.length, 9, "Should have 9 items");
 is(names[0], "0", "Entry 1")
 is(names[1], "1", "Entry 2")
 is(names[2], "2", "Entry 3")
 is(names[3], "3", "Entry 4")
 is(names[4], "x", "Entry 5")
--- a/dom/html/test/test_named_options.html
+++ b/dom/html/test/test_named_options.html
@@ -37,30 +37,25 @@ is(names[5], "y", "Entry 6")
 is(names[6], "z", "Entry 7")
 is(names[7], "w", "Entry 8")
 is(names[8], "loopy", "Entry 9")
 
 var names2 = [];
 for (var name in opt) {
   names2.push(name);
 }
-var JS_HAS_SYMBOLS = typeof Symbol === "function";
-is(names2.length, JS_HAS_SYMBOLS ? 11 : 12,
-   "Should have eleven enumerated names (or twelve with '@@iterator')");
+is(names2.length, 11, "Should have eleven enumerated names");
 is(names2[0], "0", "Enum entry 1")
 is(names2[1], "1", "Enum entry 2")
 is(names2[2], "2", "Enum entry 3")
 is(names2[3], "3", "Enum entry 4")
 is(names2[4], "loopy", "Enum entry 5")
 is(names2[5], "add", "Enum entrry 6")
 is(names2[6], "remove", "Enum entry 7")
 is(names2[7], "length", "Enum entry 8")
 is(names2[8], "selectedIndex", "Enum entry 9")
 is(names2[9], "item", "Enum entry 10")
 is(names2[10], "namedItem", "Enum entry 11")
-if (!JS_HAS_SYMBOLS) {
-  is(names2[11], "@@iterator", "Enum entry 12");
-}
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/test_rowscollection.html
+++ b/dom/html/test/test_rowscollection.html
@@ -33,34 +33,27 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 772869 **/
 var x = $("f").rows;
 x.something = "another";
 var names = [];
 for (var name in x) {
   names.push(name);
 }
-var JS_HAS_SYMBOLS = typeof Symbol === "function";
-is(names.length, JS_HAS_SYMBOLS ? 10 : 11,
-   "Should have 10 enumerated names (or 11 with '@@iterator')");
+is(names.length, 10, "Should have 10 enumerated names");
 is(names[0], "0", "Enum entry 1")
 is(names[1], "1", "Enum entry 2")
 is(names[2], "2", "Enum entry 3")
 is(names[3], "3", "Enum entry 4")
 is(names[4], "4", "Enum entry 5")
 is(names[5], "5", "Enum entry 6")
 is(names[6], "something", "Enum entry 7")
 is(names[7], "item", "Enum entry 8")
 is(names[8], "namedItem", "Enum entry 9")
-if (JS_HAS_SYMBOLS) {
-  is(names[9], "length", "Enum entry 10");
-} else {
-  is(names[9], "@@iterator", "Enum entry 10");
-  is(names[10], "length", "Enum entry 11");
-}
+is(names[9], "length", "Enum entry 10");
 
 names = Object.getOwnPropertyNames(x);
 is(names.length, 11, "Should have 11 items");
 is(names[0], "0", "Entry 1")
 is(names[1], "1", "Entry 2")
 is(names[2], "2", "Entry 3")
 is(names[3], "3", "Entry 4")
 is(names[4], "4", "Entry 5")