Repository: w3c/webidl2.js
Pull request #216 (2018-06-18 08:02:59)

BREAKING CHANGE: remove support for legacyiterable
As heycam/webidl#68 removed it in 2015.


Patch:
diff --git a/README.md b/README.md
index 8fded8b..2db4c84 100644
--- a/README.md
+++ b/README.md
@@ -633,13 +633,13 @@ For Infinity:
 
 * `negative`: Boolean indicating whether this is negative Infinity or not.
 
-### `iterable<>`, `legacyiterable<>`, `maplike<>`, `setlike<>` declarations
+### `iterable<>`, `maplike<>`, `setlike<>` declarations
 
 These appear as members of interfaces that look like this:
 
 ```JS
 {
-  "type": "maplike", // or "legacyiterable" / "iterable" / "setlike"
+  "type": "maplike", // or "iterable" / "setlike"
   "idlType": /* One or two types */ ,
   "readonly": null, // only for maplike and setlike
   "trivia": {
@@ -654,7 +654,7 @@ These appear as members of interfaces that look like this:
 
 The fields are as follows:
 
-* `type`: Always one of "iterable", "legacyiterable", "maplike" or "setlike".
+* `type`: Always one of "iterable", "maplike" or "setlike".
 * `idlType`: An array with one or more [IDL Types](#idl-type) representing the declared type arguments.
 * `readonly`: An object with a string type field `trivia` if the maplike or setlike is declared as read only.
 * `trivia`: A trivia object.
diff --git a/lib/webidl2.js b/lib/webidl2.js
index 685c185..5be5015 100644
--- a/lib/webidl2.js
+++ b/lib/webidl2.js
@@ -819,7 +819,7 @@
     }
 
     function iterable_type() {
-      return consume("iterable", "legacyiterable", "maplike", "setlike");
+      return consume("iterable", "maplike", "setlike");
     }
 
     function readonly_iterable_type() {


Test patch:
diff --git a/test/syntax/idl/legacyiterable.widl b/test/invalid/idl/legacyiterable.widl
similarity index 100%
rename from test/syntax/idl/legacyiterable.widl
rename to test/invalid/idl/legacyiterable.widl
diff --git a/test/invalid/json/legacyiterable.json b/test/invalid/json/legacyiterable.json
new file mode 100644
index 0000000..0bfaa8f
--- /dev/null
+++ b/test/invalid/json/legacyiterable.json
@@ -0,0 +1,4 @@
+{
+    "message": "Got an error during or right after parsing `interface LegacyIterable`: Missing return type",
+    "line": 2
+}
diff --git a/test/syntax/json/legacyiterable.json b/test/syntax/json/legacyiterable.json
deleted file mode 100644
index e4a7534..0000000
--- a/test/syntax/json/legacyiterable.json
+++ /dev/null
@@ -1,49 +0,0 @@
-[
-    {
-        "type": "interface",
-        "name": "LegacyIterable",
-        "partial": null,
-        "members": [
-            {
-                "type": "legacyiterable",
-                "idlType": [
-                    {
-                        "type": null,
-                        "generic": null,
-                        "nullable": null,
-                        "union": false,
-                        "idlType": "long",
-                        "baseName": "long",
-                        "prefix": null,
-                        "postfix": null,
-                        "separator": null,
-                        "extAttrs": null,
-                        "trivia": {
-                            "base": ""
-                        }
-                    }
-                ],
-                "trivia": {
-                    "base": "\n  ",
-                    "open": "",
-                    "close": "",
-                    "termination": ""
-                },
-                "extAttrs": null
-            }
-        ],
-        "trivia": {
-            "base": "",
-            "name": " ",
-            "open": " ",
-            "close": "\n",
-            "termination": ""
-        },
-        "inheritance": null,
-        "extAttrs": null
-    },
-    {
-        "type": "eof",
-        "trivia": "\n"
-    }
-]