diff --git a/README.md b/README.md index 31ccd938..c0a4e51f 100644 --- a/README.md +++ b/README.md @@ -45,23 +45,6 @@ In the browser: ``` -### Advanced Parsing - -`parse()` can optionally accept a second parameter, an options object, which can be used to -modify parsing behavior. - -The following options are recognized: -```JS -{ - allowNestedTypedefs: false -} -``` - -And their meanings are as follows: - -* `allowNestedTypedefs`: Boolean indicating whether the parser should accept `typedef`s as valid members of `interface`s. -This is non-standard syntax and therefore the default is `false`. - ### Errors When there is a syntax error in the WebIDL, it throws an exception object with the following diff --git a/lib/webidl2.js b/lib/webidl2.js index f2f9c547..635643e4 100644 --- a/lib/webidl2.js +++ b/lib/webidl2.js @@ -86,7 +86,7 @@ } } - function parse(tokens, opt) { + function parse(tokens) { let line = 1; tokens = tokens.slice(); const names = new Map(); @@ -656,8 +656,7 @@ ret.members.push(cnt); continue; } - const mem = (opt.allowNestedTypedefs && typedef()) || - static_member() || + const mem = static_member() || stringifier() || iterable() || attribute() || @@ -926,10 +925,9 @@ } const obj = { - parse(str, opt) { - if (!opt) opt = {}; + parse(str) { const tokens = tokenise(str); - return parse(tokens, opt); + return parse(tokens); } }; diff --git a/test/syntax/opt/typedef-nested.json b/test/syntax/opt/typedef-nested.json deleted file mode 100644 index f0794e74..00000000 --- a/test/syntax/opt/typedef-nested.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowNestedTypedefs": true -} \ No newline at end of file