Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow legacyiterable and implements to be identifiers #369

Merged
merged 2 commits into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"extends": "eslint:recommended",
"rules": {
"no-console": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-eval": "error",
"no-implied-eval": "error",
Expand Down
2 changes: 1 addition & 1 deletion dist/webidl2.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/webidl2.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/productions/extended-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export class ExtendedAttributes extends ArrayBase {

*validate(defs) {
for (const extAttr of this) {
console.log(extAttr);
yield* extAttr.validate(defs);
}
}
Expand Down
2 changes: 0 additions & 2 deletions lib/tokeniser.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ const nonRegexTerminals = [
"double",
"false",
"float",
"implements",
"legacyiterable",
"long",
"mixin",
"null",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid/baseline/legacyiterable.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Syntax error at line 2 in legacyiterable.webidl, since `interface LegacyIterable`:
legacyiterable<long>;
^ Missing return type
^ Unsupported generic type legacyiterable
46 changes: 46 additions & 0 deletions test/syntax/baseline/obsolete-keywords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[
{
"type": "interface",
"name": "Keywords",
"inheritance": null,
"members": [
{
"type": "operation",
"name": "implements",
"idlType": {
"type": "return-type",
"extAttrs": [],
"generic": "",
"nullable": false,
"union": false,
"idlType": "void"
},
"arguments": [],
"extAttrs": [],
"special": ""
},
{
"type": "operation",
"name": "legacyiterable",
"idlType": {
"type": "return-type",
"extAttrs": [],
"generic": "",
"nullable": false,
"union": false,
"idlType": "void"
},
"arguments": [],
"extAttrs": [],
"special": ""
}
],
"extAttrs": [],
"partial": false
},
{
"type": "eof",
"value": "",
"trivia": "\n"
}
]
6 changes: 6 additions & 0 deletions test/syntax/idl/obsolete-keywords.webidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Keywords that have been removed from the spec
// can be used as an identifier
interface Keywords {
void implements();
void legacyiterable();
};