Update web-platform-tests to revision 4f397167b4ed552a02201c92d363cfaecfe2c7f0

This commit is contained in:
WPT Sync Bot 2018-04-26 21:09:36 -04:00 committed by Anthony Ramine
parent 73b5bf201f
commit 84b40513c3
182 changed files with 4779 additions and 1937 deletions

View file

@ -2,3 +2,4 @@ language: node_js
node_js:
- node
- lts/*
- 6

View file

@ -1,5 +1,73 @@
# Change Log
## [v10.2.0](https://github.com/w3c/webidl2.js/tree/v10.2.0) (2018-01-30)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v10.1.0...v10.2.0)
**Merged pull requests:**
- Type on union idlType [\#135](https://github.com/w3c/webidl2.js/pull/135) ([saschanaz](https://github.com/saschanaz))
- feat: add argument/return type [\#134](https://github.com/w3c/webidl2.js/pull/134) ([saschanaz](https://github.com/saschanaz))
- feat: add dictionary/typedef-type [\#133](https://github.com/w3c/webidl2.js/pull/133) ([saschanaz](https://github.com/saschanaz))
- feat: add const-type for idlTypes [\#132](https://github.com/w3c/webidl2.js/pull/132) ([saschanaz](https://github.com/saschanaz))
- feat: add types on idlTypes [\#131](https://github.com/w3c/webidl2.js/pull/131) ([saschanaz](https://github.com/saschanaz))
- Auto acquisition for parser result changes [\#130](https://github.com/w3c/webidl2.js/pull/130) ([saschanaz](https://github.com/saschanaz))
## [v10.1.0](https://github.com/w3c/webidl2.js/tree/v10.1.0) (2018-01-19)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v10.0.0...v10.1.0)
**Closed issues:**
- Support `raises` and `setraises` [\#128](https://github.com/w3c/webidl2.js/issues/128)
- Support `legacycaller` [\#127](https://github.com/w3c/webidl2.js/issues/127)
- Improve "No semicolon after enum" message [\#119](https://github.com/w3c/webidl2.js/issues/119)
**Merged pull requests:**
- Let error messages include the current definition name [\#129](https://github.com/w3c/webidl2.js/pull/129) ([saschanaz](https://github.com/saschanaz))
## [v10.0.0](https://github.com/w3c/webidl2.js/tree/v10.0.0) (2017-12-20)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v9.0.0...v10.0.0)
**Closed issues:**
- Always return an array for idlType, etc. [\#113](https://github.com/w3c/webidl2.js/issues/113)
- Maintain writer.js or not? [\#109](https://github.com/w3c/webidl2.js/issues/109)
**Merged pull requests:**
- Remove typeExtAttrs from docs [\#124](https://github.com/w3c/webidl2.js/pull/124) ([saschanaz](https://github.com/saschanaz))
- Remove iterator documentation [\#123](https://github.com/w3c/webidl2.js/pull/123) ([saschanaz](https://github.com/saschanaz))
- Maintain writer.js [\#122](https://github.com/w3c/webidl2.js/pull/122) ([saschanaz](https://github.com/saschanaz))
- BREAKING CHANGE: remove deprecated iterator operation [\#121](https://github.com/w3c/webidl2.js/pull/121) ([saschanaz](https://github.com/saschanaz))
- Use for-of on tests [\#120](https://github.com/w3c/webidl2.js/pull/120) ([saschanaz](https://github.com/saschanaz))
- docs\(README\): iterables ildType is always array [\#118](https://github.com/w3c/webidl2.js/pull/118) ([marcoscaceres](https://github.com/marcoscaceres))
## [v9.0.0](https://github.com/w3c/webidl2.js/tree/v9.0.0) (2017-11-30)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v8.1.0...v9.0.0)
**Closed issues:**
- Code quality [\#116](https://github.com/w3c/webidl2.js/issues/116)
- Unable to parse HTMLAllCollection interface [\#114](https://github.com/w3c/webidl2.js/issues/114)
- Add support for mixin syntax [\#112](https://github.com/w3c/webidl2.js/issues/112)
- Whitespace issues [\#111](https://github.com/w3c/webidl2.js/issues/111)
**Merged pull requests:**
- Consistent array type for iterable.idlType [\#117](https://github.com/w3c/webidl2.js/pull/117) ([saschanaz](https://github.com/saschanaz))
- Revert "chore: drop Node 6 support \(\#102\)" [\#115](https://github.com/w3c/webidl2.js/pull/115) ([TimothyGu](https://github.com/TimothyGu))
## [v8.1.0](https://github.com/w3c/webidl2.js/tree/v8.1.0) (2017-11-03)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v8.0.1...v8.1.0)
**Closed issues:**
- Extended Attributes `rhs` should always be there [\#96](https://github.com/w3c/webidl2.js/issues/96)
**Merged pull requests:**
- Always add rhs property [\#110](https://github.com/w3c/webidl2.js/pull/110) ([saschanaz](https://github.com/saschanaz))
## [v8.0.1](https://github.com/w3c/webidl2.js/tree/v8.0.1) (2017-11-03)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v8.0.0...v8.0.1)
@ -9,7 +77,7 @@
**Merged pull requests:**
- Remove m postfix from all\_ws\(\) [\#108](https://github.com/w3c/webidl2.js/pull/108) ([SaschaNaz](https://github.com/SaschaNaz))
- Remove m postfix from all\_ws\(\) [\#108](https://github.com/w3c/webidl2.js/pull/108) ([saschanaz](https://github.com/saschanaz))
## [v8.0.0](https://github.com/w3c/webidl2.js/tree/v8.0.0) (2017-11-03)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v7.0.0...v8.0.0)
@ -21,9 +89,9 @@
**Merged pull requests:**
- Support mixins + includes statements [\#105](https://github.com/w3c/webidl2.js/pull/105) ([SaschaNaz](https://github.com/SaschaNaz))
- Support mixins + includes statements [\#105](https://github.com/w3c/webidl2.js/pull/105) ([saschanaz](https://github.com/saschanaz))
- chore: drop Node 6 support [\#102](https://github.com/w3c/webidl2.js/pull/102) ([marcoscaceres](https://github.com/marcoscaceres))
- BREAKING CHANGE: drop creator support [\#101](https://github.com/w3c/webidl2.js/pull/101) ([SaschaNaz](https://github.com/SaschaNaz))
- BREAKING CHANGE: drop creator support [\#101](https://github.com/w3c/webidl2.js/pull/101) ([saschanaz](https://github.com/saschanaz))
- Normalize some whitespace to pass wpt's lint [\#99](https://github.com/w3c/webidl2.js/pull/99) ([foolip](https://github.com/foolip))
## [v7.0.0](https://github.com/w3c/webidl2.js/tree/v7.0.0) (2017-10-27)
@ -54,7 +122,7 @@
**Merged pull requests:**
- Use ES2015 syntax for tests [\#88](https://github.com/w3c/webidl2.js/pull/88) ([SaschaNaz](https://github.com/SaschaNaz))
- Use ES2015 syntax for tests [\#88](https://github.com/w3c/webidl2.js/pull/88) ([saschanaz](https://github.com/saschanaz))
## [v6.0.0](https://github.com/w3c/webidl2.js/tree/v6.0.0) (2017-10-17)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v5.0.0...v6.0.0)
@ -73,7 +141,7 @@
**Merged pull requests:**
- BREAKING CHANGE: Use ES2015 syntax [\#84](https://github.com/w3c/webidl2.js/pull/84) ([SaschaNaz](https://github.com/SaschaNaz))
- BREAKING CHANGE: Use ES2015 syntax [\#84](https://github.com/w3c/webidl2.js/pull/84) ([saschanaz](https://github.com/saschanaz))
## [v4.2.0](https://github.com/w3c/webidl2.js/tree/v4.2.0) (2017-10-16)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v4.1.0...v4.2.0)
@ -85,8 +153,8 @@
**Merged pull requests:**
- Check duplicated names [\#80](https://github.com/w3c/webidl2.js/pull/80) ([SaschaNaz](https://github.com/SaschaNaz))
- Remove legacycaller [\#79](https://github.com/w3c/webidl2.js/pull/79) ([SaschaNaz](https://github.com/SaschaNaz))
- Check duplicated names [\#80](https://github.com/w3c/webidl2.js/pull/80) ([saschanaz](https://github.com/saschanaz))
- Remove legacycaller [\#79](https://github.com/w3c/webidl2.js/pull/79) ([saschanaz](https://github.com/saschanaz))
- Add "sequence" property to IDL Type AST definition [\#76](https://github.com/w3c/webidl2.js/pull/76) ([lerouche](https://github.com/lerouche))
## [v4.1.0](https://github.com/w3c/webidl2.js/tree/v4.1.0) (2017-07-04)
@ -98,7 +166,7 @@
**Merged pull requests:**
- Support TypeWithExtendedAttributes on generics [\#75](https://github.com/w3c/webidl2.js/pull/75) ([SaschaNaz](https://github.com/SaschaNaz))
- Support TypeWithExtendedAttributes on generics [\#75](https://github.com/w3c/webidl2.js/pull/75) ([saschanaz](https://github.com/saschanaz))
## [v4.0.0](https://github.com/w3c/webidl2.js/tree/v4.0.0) (2017-06-27)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v3.0.2...v4.0.0)
@ -112,7 +180,7 @@
**Merged pull requests:**
- BREAKING CHANGE: remove serializers \(closes \#73\) [\#74](https://github.com/w3c/webidl2.js/pull/74) ([marcoscaceres](https://github.com/marcoscaceres))
- Add documentation for namespaces [\#70](https://github.com/w3c/webidl2.js/pull/70) ([SaschaNaz](https://github.com/SaschaNaz))
- Add documentation for namespaces [\#70](https://github.com/w3c/webidl2.js/pull/70) ([saschanaz](https://github.com/saschanaz))
## [v3.0.2](https://github.com/w3c/webidl2.js/tree/v3.0.2) (2017-05-29)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v3.0.1...v3.0.2)
@ -123,7 +191,7 @@
**Merged pull requests:**
- Test for latest LTS/stable node versions [\#69](https://github.com/w3c/webidl2.js/pull/69) ([SaschaNaz](https://github.com/SaschaNaz))
- Test for latest LTS/stable node versions [\#69](https://github.com/w3c/webidl2.js/pull/69) ([saschanaz](https://github.com/saschanaz))
## [v3.0.1](https://github.com/w3c/webidl2.js/tree/v3.0.1) (2017-05-18)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v2.4.0...v3.0.1)
@ -135,8 +203,8 @@
**Merged pull requests:**
- Fix whitespace error on parsing extended attributes [\#68](https://github.com/w3c/webidl2.js/pull/68) ([SaschaNaz](https://github.com/SaschaNaz))
- Remove deprecated IDL arrays and exceptions [\#67](https://github.com/w3c/webidl2.js/pull/67) ([SaschaNaz](https://github.com/SaschaNaz))
- Fix whitespace error on parsing extended attributes [\#68](https://github.com/w3c/webidl2.js/pull/68) ([saschanaz](https://github.com/saschanaz))
- Remove deprecated IDL arrays and exceptions [\#67](https://github.com/w3c/webidl2.js/pull/67) ([saschanaz](https://github.com/saschanaz))
## [v2.4.0](https://github.com/w3c/webidl2.js/tree/v2.4.0) (2017-04-12)
[Full Changelog](https://github.com/w3c/webidl2.js/compare/v2.1.0...v2.4.0)
@ -157,7 +225,7 @@
- Update webidl2.js [\#63](https://github.com/w3c/webidl2.js/pull/63) ([tqeto](https://github.com/tqeto))
- Remove support for MapClass \(no longer valid in WebIDL\) [\#62](https://github.com/w3c/webidl2.js/pull/62) ([dontcallmedom](https://github.com/dontcallmedom))
- Add support for annotated types [\#61](https://github.com/w3c/webidl2.js/pull/61) ([dontcallmedom](https://github.com/dontcallmedom))
- Support namespaces [\#58](https://github.com/w3c/webidl2.js/pull/58) ([SaschaNaz](https://github.com/SaschaNaz))
- Support namespaces [\#58](https://github.com/w3c/webidl2.js/pull/58) ([saschanaz](https://github.com/saschanaz))
- Add support for records [\#57](https://github.com/w3c/webidl2.js/pull/57) ([TimothyGu](https://github.com/TimothyGu))
- Refactor [\#50](https://github.com/w3c/webidl2.js/pull/50) ([marcoscaceres](https://github.com/marcoscaceres))
- feat\(lib\): add AMD export support \(closes \#48\) [\#49](https://github.com/w3c/webidl2.js/pull/49) ([marcoscaceres](https://github.com/marcoscaceres))

View file

@ -310,7 +310,6 @@ A typedef looks like this:
```JS
{
"type": "typedef",
"typeExtAttrs": [],
"idlType": {
"sequence": true,
"generic": "sequence",
@ -336,8 +335,6 @@ The fields are as follows:
* `name`: The typedef's name.
* `idlType`: An [IDL Type](#idl-type) describing what typedef's type.
* `extAttrs`: A list of [extended attributes](#extended-attributes).
* `typeExtAttrs`: A list of [extended attributes](#extended-attributes) that apply to the
type rather than to the typedef as a whole.
### Implements
@ -489,34 +486,6 @@ The fields are as follows:
* `value`: The constant value as described by [Const Values](#default-and-const-values)
* `extAttrs`: A list of [extended attributes](#extended-attributes).
### Iterator Member
Iterator members look like this
```JS
{
"type": "iterator",
"getter": false,
"setter": false,
"deleter": false,
"static": false,
"stringifier": false,
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "Session2"
},
"iteratorObject": "SessionIterator",
"extAttrs": []
}
```
* `type`: Always "iterator".
* `iteratorObject`: The string on the right-hand side; absent if there isn't one.
* the rest: same as on [operations](#operation-member).
### Arguments
The arguments (e.g. for an operation) look like this:
@ -611,7 +580,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".
* `idlType`: An [IDL Type](#idl-type) (or an array of two types) representing the declared type arguments.
* `idlType`: An array with one or more [IDL Types](#idl-type) representing the declared type arguments.
* `readonly`: Whether the maplike or setlike is declared as read only.
* `extAttrs`: A list of [extended attributes](#extended-attributes).

View file

@ -1,33 +1,82 @@
"use strict";
(() => {
// These regular expressions use the sticky flag so they will only match at
// the current location (ie. the offset of lastIndex).
const tokenRe = {
// This expression uses a lookahead assertion to catch false matches
// against integers early.
"float": /-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,
"integer": /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,
"identifier": /[A-Z_a-z][0-9A-Z_a-z-]*/y,
"string": /"[^"]*"/y,
"whitespace": /[\t\n\r ]+/y,
"comment": /((\/(\/.*|\*([^*]|\*[^\/])*\*\/)[\t\n\r ]*)+)/y,
"other": /[^\t\n\r 0-9A-Z_a-z]/y
};
function attemptTokenMatch(str, type, re, lastIndex, tokens) {
re.lastIndex = lastIndex;
const result = re.exec(str);
if (result) {
tokens.push({ type, value: result[0] });
return re.lastIndex;
}
return -1;
}
function tokenise(str) {
const tokens = [];
const re = {
"float": /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/,
"integer": /^-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/,
"identifier": /^[A-Z_a-z][0-9A-Z_a-z-]*/,
"string": /^"[^"]*"/,
"whitespace": /^(?:[\t\n\r ]+|[\t\n\r ]*((\/\/.*|\/\*(.|\n|\r)*?\*\/)[\t\n\r ]*))+/,
"other": /^[^\t\n\r 0-9A-Z_a-z]/
};
const types = ["float", "integer", "identifier", "string", "whitespace", "other"];
while (str.length > 0) {
let matched = false;
for (var i in types) {
const type = types[i];
str = str.replace(re[type], tok => {
tokens.push({ type, value: tok });
matched = true;
return "";
});
if (matched) break;
let lastIndex = 0;
while (lastIndex < str.length) {
const nextChar = str.charAt(lastIndex);
let result = -1;
if (/[-0-9.]/.test(nextChar)) {
result = attemptTokenMatch(str, "float", tokenRe.float, lastIndex,
tokens);
if (result === -1) {
result = attemptTokenMatch(str, "integer", tokenRe.integer, lastIndex,
tokens);
}
if (result === -1) {
// '-' and '.' can also match "other".
result = attemptTokenMatch(str, "other", tokenRe.other,
lastIndex, tokens);
}
} else if (/[A-Z_a-z]/.test(nextChar)) {
result = attemptTokenMatch(str, "identifier", tokenRe.identifier,
lastIndex, tokens);
} else if (nextChar === '"') {
result = attemptTokenMatch(str, "string", tokenRe.string,
lastIndex, tokens);
if (result === -1) {
// '"' can also match "other".
result = attemptTokenMatch(str, "other", tokenRe.other,
lastIndex, tokens);
}
} else if (/[\t\n\r ]/.test(nextChar)) {
result = attemptTokenMatch(str, "whitespace", tokenRe.whitespace,
lastIndex, tokens);
} else if (nextChar === '/') {
// The parser expects comments to be labelled as "whitespace".
result = attemptTokenMatch(str, "whitespace", tokenRe.comment,
lastIndex, tokens);
if (result === -1) {
// '/' can also match "other".
result = attemptTokenMatch(str, "other", tokenRe.other,
lastIndex, tokens);
}
} else {
result = attemptTokenMatch(str, "other", tokenRe.other,
lastIndex, tokens);
}
if (matched) continue;
throw new Error("Token stream not progressing");
if (result === -1) {
throw new Error("Token stream not progressing");
}
lastIndex = result;
}
return tokens;
};
}
class WebIDLParseError {
constructor(str, line, input, tokens) {
@ -46,6 +95,7 @@
let line = 1;
tokens = tokens.slice();
const names = new Map();
let current = null;
const FLOAT = "float";
const INT = "integer";
@ -58,7 +108,7 @@
getter: false,
setter: false,
deleter: false,
"static": false,
static: false,
stringifier: false
});
@ -70,8 +120,18 @@
tok += tokens[numTokens].value;
numTokens++;
}
throw new WebIDLParseError(str, line, tok, tokens.slice(0, maxTokens));
};
let message;
if (current) {
message = `Got an error during or right after parsing \`${current.partial ? "partial " : ""}${current.type} ${current.name}\`: ${str}`
}
else {
// throwing before any valid definition
message = `Got an error before parsing any named definition: ${str}`;
}
throw new WebIDLParseError(message, line, tok, tokens.slice(0, maxTokens));
}
function sanitize_name(name, type) {
if (names.has(name)) {
@ -87,23 +147,34 @@
if (!tokens.length || tokens[0].type !== type) return;
if (typeof value === "undefined" || tokens[0].value === value) {
last_token = tokens.shift();
if (type === ID) last_token.value = last_token.value.replace(/^_/, "");
if (type === ID && last_token.value.startsWith('_'))
last_token.value = last_token.value.substring(1);
return last_token;
}
};
}
function count(str, char) {
let total = 0;
for (let i = str.indexOf(char); i !== -1; i = str.indexOf(char, i + 1)) {
++total;
}
return total;
}
function ws() {
if (!tokens.length) return;
if (tokens[0].type === "whitespace") {
const t = tokens.shift();
t.value.replace(/\n/g, m => {
line++;
return m;
});
line += count(t.value, '\n');
return t;
}
};
}
const all_ws_re = {
"ws": /([\t\n\r ]+)/y,
"line-comment": /\/\/(.*)\r?\n?/y,
"multiline-comment": /\/\*((?:[^*]|\*[^/])*)\*\//y
};
function all_ws(store, pea) { // pea == post extended attribute, tpea = same for types
const t = { type: "whitespace", value: "" };
while (true) {
@ -114,31 +185,30 @@
if (t.value.length > 0) {
if (store) {
let w = t.value;
const re = {
"ws": /^([\t\n\r ]+)/,
"line-comment": /^\/\/(.*)\r?\n?/,
"multiline-comment": /^\/\*((?:.|\n|\r)*?)\*\//
};
const wsTypes = [];
for (var k in re) wsTypes.push(k);
while (w.length) {
let lastIndex = 0;
while (lastIndex < w.length) {
let matched = false;
for (var i in wsTypes) {
const type = wsTypes[i];
w = w.replace(re[type], (tok, m1) => {
store.push({ type: type + (pea ? ("-" + pea) : ""), value: m1 });
// Servo doesn't support using "const" in this construction yet.
// See https://github.com/servo/servo/issues/20231.
// |type| can be made const once Servo supports it.
for (let type in all_ws_re) {
const re = all_ws_re[type];
re.lastIndex = lastIndex;
const result = re.exec(w);
if (result) {
store.push({ type: type + (pea ? ("-" + pea) : ""), value: result[1] });
matched = true;
return "";
});
if (matched) break;
lastIndex = re.lastIndex;
break;
}
}
if (matched) continue;
throw new Error("Surprising white space construct."); // this shouldn't happen
if (!matched)
throw new Error("Surprising white space construct."); // this shouldn't happen
}
}
return t;
}
};
}
function integer_type() {
let ret = "";
@ -153,7 +223,7 @@
return ret;
}
if (ret) error("Failed to parse integer type");
};
}
function float_type() {
let ret = "";
@ -163,7 +233,7 @@
if (consume(ID, "float")) return ret + "float";
if (consume(ID, "double")) return ret + "double";
if (ret) error("Failed to parse float type");
};
}
function primitive_type() {
const num_type = integer_type() || float_type();
@ -172,7 +242,7 @@
if (consume(ID, "boolean")) return "boolean";
if (consume(ID, "byte")) return "byte";
if (consume(ID, "octet")) return "octet";
};
}
function const_value() {
if (consume(ID, "true")) return { type: "boolean", value: true };
@ -187,7 +257,7 @@
if (consume(ID, "Infinity")) return { type: "Infinity", negative: true };
else tokens.unshift(tok);
}
};
}
function type_suffix(obj) {
while (true) {
@ -197,11 +267,11 @@
obj.nullable = true;
} else return;
}
};
}
function single_type() {
function single_type(typeName) {
const prim = primitive_type();
const ret = { sequence: false, generic: null, nullable: false, union: false };
const ret = { type: typeName || null, sequence: false, generic: null, nullable: false, union: false };
let name;
let value;
if (prim) {
@ -219,7 +289,7 @@
const types = [];
do {
all_ws();
types.push(type_with_extended_attributes() || error("Error parsing generic type " + value));
types.push(type_with_extended_attributes(typeName) || error("Error parsing generic type " + value));
all_ws();
}
while (consume(OTHER, ","));
@ -248,12 +318,12 @@
type_suffix(ret);
if (ret.nullable && ret.idlType === "any") error("Type any cannot be made nullable");
return ret;
};
}
function union_type() {
function union_type(typeName) {
all_ws();
if (!consume(OTHER, "(")) return;
const ret = { sequence: false, generic: null, nullable: false, union: true, idlType: [] };
const ret = { type: typeName || null, sequence: false, generic: null, nullable: false, union: true, idlType: [] };
const fst = type_with_extended_attributes() || error("Union type with no content");
ret.idlType.push(fst);
while (true) {
@ -265,18 +335,18 @@
if (!consume(OTHER, ")")) error("Unterminated union type");
type_suffix(ret);
return ret;
};
}
function type() {
return single_type() || union_type();
};
function type(typeName) {
return single_type(typeName) || union_type(typeName);
}
function type_with_extended_attributes() {
function type_with_extended_attributes(typeName) {
const extAttrs = extended_attrs();
const ret = single_type() || union_type();
const ret = single_type(typeName) || union_type(typeName);
if (extAttrs.length && ret) ret.extAttrs = extAttrs;
return ret;
};
}
function argument(store) {
const ret = { optional: false, variadic: false };
@ -287,7 +357,7 @@
ret.optional = true;
all_ws();
}
ret.idlType = type_with_extended_attributes();
ret.idlType = type_with_extended_attributes("argument-type");
if (!ret.idlType) {
if (opt_token) tokens.unshift(opt_token);
return;
@ -322,7 +392,7 @@
}
}
return ret;
};
}
function argument_list(store) {
const ret = [];
@ -335,7 +405,7 @@
const nxt = argument(store ? ret : null) || error("Trailing comma in arguments list");
ret.push(nxt);
}
};
}
function simple_extended_attr(store) {
all_ws();
@ -386,7 +456,7 @@
consume(OTHER, ")") || error("Unexpected token in extended attribute argument list");
}
return ret;
};
}
// Note: we parse something simpler than the official syntax. It's all that ever
// seems to be used
@ -406,7 +476,7 @@
all_ws();
consume(OTHER, "]") || error("No end of extended attribute");
return eas;
};
}
function default_() {
all_ws();
@ -420,11 +490,11 @@
return { type: "sequence", value: [] };
} else {
const str = consume(STR) || error("No value for default");
str.value = str.value.replace(/^"/, "").replace(/"$/, "");
str.value = str.value.slice(1, -1);
return str;
}
}
};
}
function const_(store) {
all_ws(store, "pea");
@ -436,7 +506,7 @@
typ = consume(ID) || error("No type for const");
typ = typ.value;
}
ret.idlType = typ;
ret.idlType = { type: "const-type", idlType: typ };
all_ws();
if (consume(OTHER, "?")) {
ret.nullable = true;
@ -453,7 +523,7 @@
all_ws();
consume(OTHER, ";") || error("Unterminated const");
return ret;
};
}
function inheritance() {
all_ws();
@ -462,7 +532,7 @@
const inh = consume(ID) || error("No type in inheritance");
return inh.value;
}
};
}
function operation_rest(ret, store) {
all_ws();
@ -477,7 +547,7 @@
all_ws();
consume(OTHER, ";") || error("Unterminated operation");
return ret;
};
}
function callback(store) {
all_ws(store, "pea");
@ -486,12 +556,11 @@
all_ws();
const tok = consume(ID, "interface");
if (tok) {
ret = interface_rest();
ret.type = "callback interface";
ret = interface_rest(false, store, "callback interface");
return ret;
}
const name = consume(ID) || error("No name for callback");
ret = { type: "callback", name: sanitize_name(name.value, "callback") };
ret = current = { type: "callback", name: sanitize_name(name.value, "callback") };
all_ws();
consume(OTHER, "=") || error("No assignment in callback");
all_ws();
@ -504,14 +573,14 @@
all_ws();
consume(OTHER, ";") || error("Unterminated callback");
return ret;
};
}
function attribute(store) {
all_ws(store, "pea");
const grabbed = [];
const ret = {
type: "attribute",
"static": false,
static: false,
stringifier: false,
inherit: false,
readonly: false
@ -519,7 +588,7 @@
const w = all_ws();
if (w) grabbed.push(w);
if (consume(ID, "inherit")) {
if (ret["static"] || ret.stringifier) error("Cannot have a static or stringifier inherit");
if (ret.static || ret.stringifier) error("Cannot have a static or stringifier inherit");
ret.inherit = true;
grabbed.push(last_token);
const w = all_ws();
@ -536,14 +605,14 @@
tokens = grabbed.concat(tokens);
}
return rest;
};
}
function attribute_rest(ret) {
if (!consume(ID, "attribute")) {
return;
}
all_ws();
ret.idlType = type_with_extended_attributes() || error("No type in attribute");
ret.idlType = type_with_extended_attributes("attribute-type") || error("No type in attribute");
if (ret.idlType.sequence) error("Attributes cannot accept sequence types");
if (ret.idlType.generic === "record") error("Attributes cannot accept record types");
all_ws();
@ -552,17 +621,17 @@
all_ws();
consume(OTHER, ";") || error("Unterminated attribute");
return ret;
};
}
function return_type() {
const typ = type();
const typ = type("return-type");
if (!typ) {
if (consume(ID, "void")) {
return "void";
} else error("No return type");
}
return typ;
};
}
function operation(store) {
all_ws(store, "pea");
@ -582,24 +651,9 @@
}
ret.idlType = return_type();
all_ws();
if (consume(ID, "iterator")) {
all_ws();
ret.type = "iterator";
if (consume(ID, "object")) {
ret.iteratorObject = "object";
} else if (consume(OTHER, "=")) {
all_ws();
var name = consume(ID) || error("No right hand side in iterator");
ret.iteratorObject = name.value;
}
all_ws();
consume(OTHER, ";") || error("Unterminated iterator");
return ret;
} else {
operation_rest(ret, store);
return ret;
}
};
operation_rest(ret, store);
return ret;
}
function static_member(store) {
all_ws(store, "pea");
@ -631,7 +685,7 @@
arr.push(name.value);
} else break;
}
};
}
function iterable_type() {
if (consume(ID, "iterable")) return "iterable";
@ -639,13 +693,13 @@
else if (consume(ID, "maplike")) return "maplike";
else if (consume(ID, "setlike")) return "setlike";
else return;
};
}
function readonly_iterable_type() {
if (consume(ID, "maplike")) return "maplike";
else if (consume(ID, "setlike")) return "setlike";
else return;
};
}
function iterable(store) {
all_ws(store, "pea");
@ -672,17 +726,14 @@
delete ret.readonly;
all_ws();
if (consume(OTHER, "<")) {
ret.idlType = type_with_extended_attributes() || error(`Error parsing ${ittype} declaration`);
ret.idlType = [type_with_extended_attributes()] || error(`Error parsing ${ittype} declaration`);
all_ws();
if (secondTypeAllowed) {
let type2 = null;
if (consume(OTHER, ",")) {
all_ws();
type2 = type_with_extended_attributes();
ret.idlType.push(type_with_extended_attributes());
all_ws();
}
if (type2)
ret.idlType = [ret.idlType, type2];
else if (secondTypeRequired)
error(`Missing second type argument in ${ittype} declaration`);
}
@ -693,16 +744,16 @@
error(`Error parsing ${ittype} declaration`);
return ret;
};
}
function interface_rest(isPartial, store) {
function interface_rest(isPartial, store, typeName = "interface") {
all_ws();
const name = consume(ID) || error("No name for interface");
const mems = [];
const ret = {
type: "interface",
const ret = current = {
type: typeName,
name: isPartial ? name.value : sanitize_name(name.value, "interface"),
partial: false,
partial: isPartial,
members: mems
};
if (!isPartial) ret.inheritance = inheritance() || null;
@ -733,7 +784,7 @@
mem.extAttrs = ea;
ret.members.push(mem);
}
};
}
function mixin_rest(isPartial, store) {
all_ws();
@ -741,10 +792,10 @@
all_ws();
const name = consume(ID) || error("No name for interface mixin");
const mems = [];
const ret = {
const ret = current = {
type: "interface mixin",
name: isPartial ? name.value : sanitize_name(name.value, "interface mixin"),
partial: false,
partial: isPartial,
members: mems
};
all_ws();
@ -787,7 +838,7 @@
all_ws();
const name = consume(ID) || error("No name for namespace");
const mems = [];
const ret = {
const ret = current = {
type: "namespace",
name: isPartial ? name.value : sanitize_name(name.value, "namespace"),
partial: isPartial,
@ -817,7 +868,7 @@
const grabbed = [];
const ret = {
type: "attribute",
"static": false,
static: false,
stringifier: false,
inherit: false,
readonly: false
@ -856,9 +907,8 @@
interface_(true, store) ||
namespace(true, store) ||
error("Partial doesn't apply to anything");
thing.partial = true;
return thing;
};
}
function dictionary(isPartial, store) {
all_ws(isPartial ? null : store, "pea");
@ -866,10 +916,10 @@
all_ws();
const name = consume(ID) || error("No name for dictionary");
const mems = [];
const ret = {
const ret = current = {
type: "dictionary",
name: isPartial ? name.value : sanitize_name(name.value, "dictionary"),
partial: false,
partial: isPartial,
members: mems
};
if (!isPartial) ret.inheritance = inheritance() || null;
@ -885,7 +935,7 @@
const ea = extended_attrs(store ? mems : null);
all_ws(store ? mems : null, "pea");
const required = consume(ID, "required");
const typ = type_with_extended_attributes() || error("No type for dictionary member");
const typ = type_with_extended_attributes("dictionary-type") || error("No type for dictionary member");
all_ws();
const name = consume(ID) || error("No name for dictionary member");
const dflt = default_();
@ -904,7 +954,7 @@
all_ws();
consume(OTHER, ";") || error("Unterminated dictionary member");
}
};
}
function enum_(store) {
all_ws(store, "pea");
@ -912,7 +962,7 @@
all_ws();
const name = consume(ID) || error("No name for enum");
const vals = [];
const ret = {
const ret = current = {
type: "enum",
name: sanitize_name(name.value, "enum"),
values: vals
@ -928,7 +978,7 @@
return ret;
}
const val = consume(STR) || error("Unexpected value in enum");
val.value = val.value.replace(/"/g, "");
val.value = val.value.slice(1, -1);
ret.values.push(val);
all_ws(store ? vals : null);
if (consume(OTHER, ",")) {
@ -939,7 +989,7 @@
saw_comma = false;
}
}
};
}
function typedef(store) {
all_ws(store, "pea");
@ -948,14 +998,15 @@
type: "typedef"
};
all_ws();
ret.idlType = type_with_extended_attributes() || error("No type in typedef");
ret.idlType = type_with_extended_attributes("typedef-type") || error("No type in typedef");
all_ws();
const name = consume(ID) || error("No name in typedef");
ret.name = sanitize_name(name.value, "typedef");
current = ret;
all_ws();
consume(OTHER, ";") || error("Unterminated typedef");
return ret;
};
}
function implements_(store) {
all_ws(store, "pea");
@ -978,7 +1029,7 @@
tokens.unshift(w);
tokens.unshift(target);
}
};
}
function includes(store) {
all_ws(store, "pea");
@ -1001,7 +1052,7 @@
tokens.unshift(w);
tokens.unshift(target);
}
};
}
function definition(store) {
return callback(store) ||
@ -1013,7 +1064,7 @@
implements_(store) ||
includes(store) ||
namespace(false, store);
};
}
function definitions(store) {
if (!tokens.length) return [];
@ -1029,11 +1080,11 @@
defs.push(def);
}
return defs;
};
}
const res = definitions(opt.ws);
if (tokens.length) error("Unrecognised tokens");
return res;
};
}
const obj = {
parse(str, opt) {

View file

@ -1,78 +1,71 @@
(function() {
"use strict";
var write = function(ast, opt) {
var curPea = "",
curTPea = "",
opt = opt || {},
noop = function(str) {
return str; },
optNames = "type".split(" "),
context = [];
for (var i = 0, n = optNames.length; i < n; i++) {
var o = optNames[i];
(() => {
function write(ast, opt = {}) {
let curPea = "";
let curTPea = "";
const noop = str => str;
const optNames = "type".split(" ");
const context = [];
for (const o of optNames) {
if (!opt[o]) opt[o] = noop;
}
var literal = function(it) {
function literal(it) {
return it.value;
};
var wsPea = function(it) {
function wsPea(it) {
curPea += it.value;
return "";
};
var wsTPea = function(it) {
function wsTPea(it) {
curTPea += it.value;
return "";
};
var lineComment = function(it) {
return "//" + it.value + "\n";
function lineComment(it) {
return `//${it.value}\n`;
};
var multilineComment = function(it) {
return "/*" + it.value + "*/";
function multilineComment(it) {
return `/*${it.value}*/`;
};
var type = function(it) {
function type(it) {
if (typeof it === "string") return opt.type(it); // XXX should maintain some context
if (it.union) return "(" + it.idlType.map(type).join(" or ") + ")";
var ret = "";
if (it.generic) ret += it.generic + "<";
else if (it.sequence) ret += "sequence<";
if (Array.isArray(it.idlType)) ret += it.idlType.map(type).join(", ");
else ret += type(it.idlType);
if (it.array || it.generic === 'Array') {
for (var i = 0, n = it.nullableArray.length; i < n; i++) {
var val = it.nullableArray[i];
if (val) ret += "?";
ret += "[]";
}
let ret = extended_attributes(it.extAttrs, curPea);
if (it.union) ret += `(${it.idlType.map(type).join(" or ")})`;
else {
if (it.generic) ret += `${it.generic}<`;
if (Array.isArray(it.idlType)) ret += it.idlType.map(type).join(", ");
else ret += type(it.idlType);
if (it.generic) ret += ">";
}
if (it.generic || it.sequence) ret += ">";
if (it.nullable) ret += "?";
return ret;
};
var const_value = function(it) {
var tp = it.type;
function const_value(it) {
const tp = it.type;
if (tp === "boolean") return it.value ? "true" : "false";
else if (tp === "null") return "null";
else if (tp === "Infinity") return (it.negative ? "-" : "") + "Infinity";
else if (tp === "NaN") return "NaN";
else if (tp === "number") return it.value;
else return '"' + it.value + '"';
else if (tp === "sequence") return "[]";
else return `"${it.value}"`;
};
var argument = function(arg, pea) {
var ret = extended_attributes(arg.extAttrs, pea);
function argument(arg, pea) {
let ret = extended_attributes(arg.extAttrs, pea);
if (arg.optional) ret += "optional ";
ret += type(arg.idlType);
if (arg.variadic) ret += "...";
ret += " " + arg.name;
if (arg["default"]) ret += " = " + const_value(arg["default"]);
ret += ` ${arg.name}`;
if (arg["default"]) ret += ` = ${const_value(arg["default"])}`;
return ret;
};
var args = function(its) {
var res = "",
pea = "";
for (var i = 0, n = its.length; i < n; i++) {
var arg = its[i];
function args(its) {
let res = "";
let pea = "";
for (let i = 0, n = its.length; i < n; i++) {
const arg = its[i];
if (arg.type === "ws") res += arg.value;
else if (arg.type === "ws-pea") pea += arg.value;
else {
@ -83,182 +76,198 @@
}
return res;
};
var make_ext_at = function(it) {
if (it["arguments"] === null) return it.name;
function make_ext_at(it) {
context.unshift(it);
var ret = it.name + "(" + (it["arguments"].length ? args(it["arguments"]) : "") + ")";
let ret = it.name;
if (it.rhs) {
if (it.rhs.type === "identifier-list") ret += `=(${it.rhs.value.join(',')})`;
else ret += `=${it.rhs.value}`;
}
if (it.arguments) ret += `(${it["arguments"].length ? args(it["arguments"]) : ""})`;
context.shift(); // XXX need to add more contexts, but not more than needed for ReSpec
return ret;
};
var extended_attributes = function(eats, pea) {
function extended_attributes(eats, pea) {
if (!eats || !eats.length) return "";
return "[" + eats.map(make_ext_at).join(", ") + "]" + pea;
return `[${eats.map(make_ext_at).join(", ")}]${pea}`;
};
var modifiers = "getter setter creator deleter legacycaller stringifier static".split(" ");
var operation = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
const modifiers = "getter setter creator deleter legacycaller stringifier static".split(" ");
function operation(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
if (it.stringifier && !it.idlType) return "stringifier;";
for (var i = 0, n = modifiers.length; i < n; i++) {
var mod = modifiers[i];
for (const mod of modifiers) {
if (it[mod]) ret += mod + " ";
}
ret += type(it.idlType) + " ";
if (it.name) ret += it.name;
ret += "(" + args(it["arguments"]) + ");";
ret += `(${args(it["arguments"])});`;
return ret;
};
var attribute = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function attribute(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
if (it["static"]) ret += "static ";
if (it.stringifier) ret += "stringifier ";
if (it.readonly) ret += "readonly ";
if (it.inherit) ret += "inherit ";
ret += "attribute " + type(it.idlType) + " " + it.name + ";";
ret += `attribute ${type(it.idlType)} ${it.name};`;
return ret;
};
var interface_ = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function interface_(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
if (it.partial) ret += "partial ";
ret += "interface " + it.name + " ";
if (it.inheritance) ret += ": " + it.inheritance + " ";
ret += "{" + iterate(it.members) + "};";
ret += `interface ${it.name} `;
if (it.inheritance) ret += `: ${it.inheritance} `;
ret += `{${iterate(it.members)}};`;
return ret;
};
var dictionary = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function interface_mixin(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
if (it.partial) ret += "partial ";
ret += "dictionary " + it.name + " ";
ret += "{" + iterate(it.members) + "};";
ret += `interface mixin ${it.name} `;
ret += `{${iterate(it.members)}};`;
return ret;
}
function namespace(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
if (it.partial) ret += "partial ";
ret += `namespace ${it.name} `;
ret += `{${iterate(it.members)}};`;
return ret;
}
function dictionary(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
if (it.partial) ret += "partial ";
ret += `dictionary ${it.name} `;
if (it.inheritance) ret += `: ${it.inheritance} `;
ret += `{${iterate(it.members)}};`;
return ret;
};
var field = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function field(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
if (it.required) ret += "required ";
ret += type(it.idlType) + " " + it.name;
if (it["default"]) ret += " = " + const_value(it["default"]);
ret += `${type(it.idlType)} ${it.name}`;
if (it["default"]) ret += ` = ${const_value(it["default"])}`;
ret += ";";
return ret;
};
var exception = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function const_(it) {
const ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
ret += "exception " + it.name + " ";
if (it.inheritance) ret += ": " + it.inheritance + " ";
ret += "{" + iterate(it.members) + "};";
return ret;
return `${ret}const ${type(it.idlType)}${it.nullable ? "?" : ""} ${it.name} = ${const_value(it.value)};`;
};
var const_ = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function typedef(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
return ret + "const " + type(it.idlType) + " " + it.name + " = " + const_value(it.value) + ";";
};
var typedef = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
ret += "typedef " + extended_attributes(it.typeExtAttrs, curTPea);
ret += `typedef ${extended_attributes(it.typeExtAttrs, curTPea)}`;
curTPea = "";
return ret + type(it.idlType) + " " + it.name + ";";
return `${ret}${type(it.idlType)} ${it.name};`;
};
var implements_ = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function implements_(it) {
const ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
return ret + it.target + " implements " + it["implements"] + ";";
return `${ret}${it.target} implements ${it["implements"]};`;
};
var callback = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function includes(it) {
const ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
return ret + "callback " + it.name + " = " + type(it.idlType) +
"(" + args(it["arguments"]) + ");";
return `${ret}${it.target} includes ${it.includes};`;
};
var enum_ = function(it) {
var ret = extended_attributes(it.extAttrs, curPea);
function callback(it) {
const ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
ret += "enum " + it.name + " {";
for (var i = 0, n = it.values.length; i < n; i++) {
var v = it.values[i];
if (typeof v === "string") ret += '"' + v + '"';
return `${ret}callback ${it.name} = ${type(it.idlType)}(${args(it["arguments"])});`;
};
function enum_(it) {
let ret = extended_attributes(it.extAttrs, curPea);
curPea = "";
ret += `enum ${it.name} {`;
for (const v of it.values) {
if (v.type === "string") ret += `"${v.value}"`;
else if (v.type === "ws") ret += v.value;
else if (v.type === ",") ret += ",";
}
return ret + "};";
};
var iterable = function(it) {
return "iterable<" + (it.idlType instanceof Array ? it.idlType.map(type).join(", ") : type(it.idlType)) + ">;";
function iterable(it) {
return `iterable<${Array.isArray(it.idlType) ? it.idlType.map(type).join(", ") : type(it.idlType)}>;`;
};
var legacyiterable = function(it) {
return "legacyiterable<" + (it.idlType instanceof Array ? it.idlType.map(type).join(", ") : type(it.idlType)) + ">;";
function legacyiterable(it) {
return `legacyiterable<${Array.isArray(it.idlType) ? it.idlType.map(type).join(", ") : type(it.idlType)}>;`;
};
var maplike = function(it) {
return (it.readonly ? "readonly " : "") + "maplike<" +
it.idlType.map(type).join(", ") + ">;";
function maplike(it) {
return `${it.readonly ? "readonly " : ""}maplike<${it.idlType.map(type).join(", ")}>;`;
};
var setlike = function(it) {
return (it.readonly ? "readonly " : "") + "setlike<" +
type(it.idlType) + ">;";
function setlike(it) {
return `${it.readonly ? "readonly " : ""}setlike<${type(it.idlType[0])}>;`;
};
var callbackInterface = function(it) {
return 'callback ' + interface_(it);
function callbackInterface(it) {
return `callback ${interface_(it)}`;
};
var table = {
const table = {
ws: literal,
"ws-pea": wsPea,
"ws-tpea": wsTPea,
"line-comment": lineComment,
"multiline-comment": multilineComment,
"interface": interface_,
operation: operation,
attribute: attribute,
dictionary: dictionary,
field: field,
exception: exception,
"const": const_,
typedef: typedef,
"implements": implements_,
callback: callback,
"enum": enum_,
iterable: iterable,
legacyiterable: legacyiterable,
maplike: maplike,
setlike: setlike,
interface: interface_,
"interface mixin": interface_mixin,
namespace,
operation,
attribute,
dictionary,
field,
const: const_,
typedef,
implements: implements_,
includes,
callback,
enum: enum_,
iterable,
legacyiterable,
maplike,
setlike,
"callback interface": callbackInterface
};
var dispatch = function(it) {
function dispatch(it) {
const dispatcher = table[it.type];
if (!dispatcher) {
throw new Error(`Type "${it.type}" is unsupported`)
}
return table[it.type](it);
};
var iterate = function(things) {
function iterate(things) {
if (!things) return;
var ret = "";
for (var i = 0, n = things.length; i < n; i++) ret += dispatch(things[i]);
let ret = "";
for (const thing of things) ret += dispatch(thing);
return ret;
};
return iterate(ast);
};
var obj = {
write: function(ast, opt) {
if (!opt) opt = {};
return write(ast, opt);
}
const obj = {
write
};
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = obj;
} else if (typeof define === 'function' && define.amd) {
define([], function() {
return obj;
});
define([], () => obj);
} else {
(self || window).WebIDL2Writer = obj;
}
}());
})();

View file

@ -1,25 +1,52 @@
{
"name": "webidl2",
"version": "4.2.0",
"version": "10.2.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/code-frame": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz",
"integrity": "sha512-eVXQSbu/RimU6OKcK2/gDJVTFcxXJI4sHbIqw2mhwMZeQ2as/8AhS9DGkEDoHMBBNJZ5B0US63lF56x+KDcxiA==",
"dev": true,
"requires": {
"@babel/highlight": "7.0.0-beta.40"
}
},
"@babel/highlight": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.40.tgz",
"integrity": "sha512-mOhhTrzieV6VO7odgzFGFapiwRK0ei8RZRhfzHhb6cpX3QM8XXuCLXWjN8qBB7JReDdUR80V3LFfFrGUYevhNg==",
"dev": true,
"requires": {
"chalk": "2.3.2",
"esutils": "2.0.2",
"js-tokens": "3.0.2"
}
},
"ansi-regex": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz",
"integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"ansi-styles": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz",
"integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=",
"dev": true
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "1.9.1"
}
},
"arr-diff": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
"integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
"dev": true
"dev": true,
"requires": {
"arr-flatten": "1.1.0"
}
},
"arr-flatten": {
"version": "1.1.0",
@ -40,34 +67,51 @@
"dev": true
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"dev": true
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
"braces": {
"version": "1.8.5",
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
"integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
"dev": true
"dev": true,
"requires": {
"expand-range": "1.8.2",
"preserve": "0.2.0",
"repeat-element": "1.1.2"
}
},
"browser-stdout": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz",
"integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=",
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
"dev": true
},
"chalk": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=",
"dev": true
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz",
"integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==",
"dev": true,
"requires": {
"ansi-styles": "3.2.1",
"escape-string-regexp": "1.0.5",
"supports-color": "5.3.0"
}
},
"color-convert": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
"integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=",
"dev": true
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz",
"integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
@ -76,9 +120,9 @@
"dev": true
},
"commander": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
"integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==",
"dev": true
},
"concat-map": {
@ -88,15 +132,24 @@
"dev": true
},
"debug": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz",
"integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=",
"dev": true
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"diff": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz",
"integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=",
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
},
"diff-match-patch": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz",
"integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg=",
"dev": true
},
"escape-string-regexp": {
@ -105,37 +158,52 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
"expand-brackets": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
"integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
"dev": true
"dev": true,
"requires": {
"is-posix-bracket": "0.1.1"
}
},
"expand-range": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
"dev": true
"dev": true,
"requires": {
"fill-range": "2.2.3"
}
},
"expect": {
"version": "21.2.1",
"resolved": "https://registry.npmjs.org/expect/-/expect-21.2.1.tgz",
"integrity": "sha512-orfQQqFRTX0jH7znRIGi8ZMR8kTNpXklTTz8+HGTpmTKZo3Occ6JNB5FXMb8cRuiiC/GyDqsr30zUa66ACYlYw==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/expect/-/expect-22.4.0.tgz",
"integrity": "sha512-Fiy862jT3qc70hwIHwwCBNISmaqBrfWKKrtqyMJ6iwZr+6KXtcnHojZFtd63TPRvRl8EQTJ+YXYy2lK6/6u+Hw==",
"dev": true,
"dependencies": {
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"dev": true
}
"requires": {
"ansi-styles": "3.2.1",
"jest-diff": "22.4.0",
"jest-get-type": "22.1.0",
"jest-matcher-utils": "22.4.0",
"jest-message-util": "22.4.0",
"jest-regex-util": "22.1.0"
}
},
"extglob": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
"integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
"dev": true
"dev": true,
"requires": {
"is-extglob": "1.0.0"
}
},
"filename-regex": {
"version": "2.0.1",
@ -147,7 +215,14 @@
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz",
"integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=",
"dev": true
"dev": true,
"requires": {
"is-number": "2.1.0",
"isobject": "2.1.0",
"randomatic": "1.1.7",
"repeat-element": "1.1.2",
"repeat-string": "1.6.1"
}
},
"for-in": {
"version": "1.0.2",
@ -159,7 +234,10 @@
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz",
"integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
"dev": true
"dev": true,
"requires": {
"for-in": "1.0.2"
}
},
"fs.realpath": {
"version": "1.0.0",
@ -168,52 +246,65 @@
"dev": true
},
"glob": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz",
"integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=",
"dev": true
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"glob-base": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
"integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
"dev": true
"dev": true,
"requires": {
"glob-parent": "2.0.0",
"is-glob": "2.0.1"
}
},
"glob-parent": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
"integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
"dev": true
},
"graceful-readlink": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
"dev": true
"dev": true,
"requires": {
"is-glob": "2.0.1"
}
},
"growl": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz",
"integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=",
"dev": true
},
"has-ansi": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=",
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz",
"integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==",
"dev": true
},
"has-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
"integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"he": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true
"dev": true,
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
"version": "2.0.3",
@ -222,9 +313,9 @@
"dev": true
},
"is-buffer": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
"integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
"dev": true
},
"is-dotfile": {
@ -237,7 +328,10 @@
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
"integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
"dev": true
"dev": true,
"requires": {
"is-primitive": "2.0.0"
}
},
"is-extendable": {
"version": "0.1.1",
@ -255,13 +349,19 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
"integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
"dev": true
"dev": true,
"requires": {
"is-extglob": "1.0.0"
}
},
"is-number": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
"integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
"dev": true
"dev": true,
"requires": {
"kind-of": "3.2.2"
}
},
"is-posix-bracket": {
"version": "0.1.1",
@ -285,199 +385,113 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
"integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
"dev": true
"dev": true,
"requires": {
"isarray": "1.0.0"
}
},
"jest-diff": {
"version": "21.2.1",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-21.2.1.tgz",
"integrity": "sha512-E5fu6r7PvvPr5qAWE1RaUwIh/k6Zx/3OOkZ4rk5dBJkEWRrUuSgbMt2EO8IUTPTd6DOqU3LW6uTIwX5FRvXoFA==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-22.4.0.tgz",
"integrity": "sha512-+/t20WmnkOkB8MOaGaPziI8zWKxquMvYw4Ub+wOzi7AUhmpFXz43buWSxVoZo4J5RnCozpGbX3/FssjJ5KV9Nw==",
"dev": true,
"dependencies": {
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"dev": true
},
"chalk": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
"integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
"dev": true
},
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
"dev": true
},
"supports-color": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
"integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
"dev": true
}
"requires": {
"chalk": "2.3.2",
"diff": "3.5.0",
"jest-get-type": "22.1.0",
"pretty-format": "22.4.0"
}
},
"jest-get-type": {
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-21.2.0.tgz",
"integrity": "sha512-y2fFw3C+D0yjNSDp7ab1kcd6NUYfy3waPTlD8yWkAtiocJdBRQqNoRqVfMNxgj+IjT0V5cBIHJO0z9vuSSZ43Q==",
"version": "22.1.0",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.1.0.tgz",
"integrity": "sha512-nD97IVOlNP6fjIN5i7j5XRH+hFsHL7VlauBbzRvueaaUe70uohrkz7pL/N8lx/IAwZRTJ//wOdVgh85OgM7g3w==",
"dev": true
},
"jest-matcher-utils": {
"version": "21.2.1",
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-21.2.1.tgz",
"integrity": "sha512-kn56My+sekD43dwQPrXBl9Zn9tAqwoy25xxe7/iY4u+mG8P3ALj5IK7MLHZ4Mi3xW7uWVCjGY8cm4PqgbsqMCg==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-22.4.0.tgz",
"integrity": "sha512-03m3issxUXpWMwDYTfmL8hRNewUB0yCRTeXPm+eq058rZxLHD9f5NtSSO98CWHqe4UyISIxd9Ao9iDVjHWd2qg==",
"dev": true,
"dependencies": {
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"dev": true
},
"chalk": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
"integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
"dev": true
},
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
"dev": true
},
"supports-color": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
"integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
"dev": true
}
"requires": {
"chalk": "2.3.2",
"jest-get-type": "22.1.0",
"pretty-format": "22.4.0"
}
},
"jest-message-util": {
"version": "21.2.1",
"resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-21.2.1.tgz",
"integrity": "sha512-EbC1X2n0t9IdeMECJn2BOg7buOGivCvVNjqKMXTzQOu7uIfLml+keUfCALDh8o4rbtndIeyGU8/BKfoTr/LVDQ==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-22.4.0.tgz",
"integrity": "sha512-eyCJB0T3hrlpFF2FqQoIB093OulP+1qvATQmD3IOgJgMGqPL6eYw8TbC5P/VCWPqKhGL51xvjIIhow5eZ2wHFw==",
"dev": true,
"dependencies": {
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"dev": true
},
"chalk": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
"integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
"dev": true
},
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
"dev": true
},
"supports-color": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
"integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
"dev": true
}
"requires": {
"@babel/code-frame": "7.0.0-beta.40",
"chalk": "2.3.2",
"micromatch": "2.3.11",
"slash": "1.0.0",
"stack-utils": "1.0.1"
}
},
"jest-regex-util": {
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-21.2.0.tgz",
"integrity": "sha512-BKQ1F83EQy0d9Jen/mcVX7D+lUt2tthhK/2gDWRgLDJRNOdRgSp1iVqFxP8EN1ARuypvDflRfPzYT8fQnoBQFQ==",
"version": "22.1.0",
"resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-22.1.0.tgz",
"integrity": "sha512-on0LqVS6Xeh69sw3d1RukVnur+lVOl3zkmb0Q54FHj9wHoq6dbtWqb3TSlnVUyx36hqjJhjgs/QLqs07Bzu72Q==",
"dev": true
},
"json3": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz",
"integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=",
"js-tokens": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
"dev": true
},
"jsondiffpatch": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/jsondiffpatch/-/jsondiffpatch-0.2.4.tgz",
"integrity": "sha1-1LbFOz/H2htLkcHCrsi5MrdRHVw=",
"dev": true
"version": "0.3.5",
"resolved": "https://registry.npmjs.org/jsondiffpatch/-/jsondiffpatch-0.3.5.tgz",
"integrity": "sha512-v7eaGLDMCHXH+fsIaZhptEUJmS8EJpunq7IM4cc4vIT/kSRAkaZ6ZF4ebiNcyUelL0znbvj6o2B5Gh9v7Og0BQ==",
"dev": true,
"requires": {
"chalk": "2.3.2",
"diff-match-patch": "1.0.0"
}
},
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true
},
"lodash._baseassign": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz",
"integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=",
"dev": true
},
"lodash._basecopy": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz",
"integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=",
"dev": true
},
"lodash._basecreate": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz",
"integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=",
"dev": true
},
"lodash._getnative": {
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz",
"integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=",
"dev": true
},
"lodash._isiterateecall": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz",
"integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=",
"dev": true
},
"lodash.create": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz",
"integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=",
"dev": true
},
"lodash.isarguments": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
"integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=",
"dev": true
},
"lodash.isarray": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz",
"integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=",
"dev": true
},
"lodash.keys": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz",
"integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=",
"dev": true
"dev": true,
"requires": {
"is-buffer": "1.1.6"
}
},
"micromatch": {
"version": "2.3.11",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
"integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
"dev": true
"dev": true,
"requires": {
"arr-diff": "2.0.0",
"array-unique": "0.2.1",
"braces": "1.8.5",
"expand-brackets": "0.1.5",
"extglob": "0.3.2",
"filename-regex": "2.0.1",
"is-extglob": "1.0.0",
"is-glob": "2.0.1",
"kind-of": "3.2.2",
"normalize-path": "2.1.1",
"object.omit": "2.0.1",
"parse-glob": "3.0.4",
"regex-cache": "0.4.4"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true
"dev": true,
"requires": {
"brace-expansion": "1.1.11"
}
},
"minimist": {
"version": "0.0.8",
@ -489,51 +503,91 @@
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true
"dev": true,
"requires": {
"minimist": "0.0.8"
}
},
"mocha": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-3.4.1.tgz",
"integrity": "sha1-o4ArSqOBk0yss43nDPdxYh2o+a8=",
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.4.tgz",
"integrity": "sha512-nMOpAPFosU1B4Ix1jdhx5e3q7XO55ic5a8cgYvW27CequcEY+BabS0kUVL1Cw1V5PuVHZWeNRWFLmEPexo79VA==",
"dev": true,
"requires": {
"browser-stdout": "1.3.1",
"commander": "2.11.0",
"debug": "3.1.0",
"diff": "3.5.0",
"escape-string-regexp": "1.0.5",
"glob": "7.1.2",
"growl": "1.10.3",
"he": "1.1.1",
"mkdirp": "0.5.1",
"supports-color": "4.4.0"
},
"dependencies": {
"supports-color": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz",
"integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=",
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
"dev": true
},
"supports-color": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
"integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
"dev": true,
"requires": {
"has-flag": "2.0.0"
}
}
}
},
"ms": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz",
"integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
"normalize-path": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
"integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
"dev": true
"dev": true,
"requires": {
"remove-trailing-separator": "1.1.0"
}
},
"object.omit": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
"integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
"dev": true
"dev": true,
"requires": {
"for-own": "0.1.5",
"is-extendable": "0.1.1"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true
"dev": true,
"requires": {
"wrappy": "1.0.2"
}
},
"parse-glob": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
"integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
"dev": true
"dev": true,
"requires": {
"glob-base": "0.3.0",
"is-dotfile": "1.0.3",
"is-extglob": "1.0.0",
"is-glob": "2.0.1"
}
},
"path-is-absolute": {
"version": "1.0.1",
@ -548,23 +602,13 @@
"dev": true
},
"pretty-format": {
"version": "21.2.1",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-21.2.1.tgz",
"integrity": "sha512-ZdWPGYAnYfcVP8yKA3zFjCn8s4/17TeYH28MXuC8vTp0o21eXjbFGcOAXZEaDaOFJjc3h2qa7HQNHNshhvoh2A==",
"version": "22.4.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-22.4.0.tgz",
"integrity": "sha512-pvCxP2iODIIk9adXlo4S3GRj0BrJiil68kByAa1PrgG97c1tClh9dLMgp3Z6cHFZrclaABt0UH8PIhwHuFLqYA==",
"dev": true,
"dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"dev": true
}
"requires": {
"ansi-regex": "3.0.0",
"ansi-styles": "3.2.1"
}
},
"randomatic": {
@ -572,18 +616,28 @@
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz",
"integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==",
"dev": true,
"requires": {
"is-number": "3.0.0",
"kind-of": "4.0.0"
},
"dependencies": {
"is-number": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
"integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
"dev": true,
"requires": {
"kind-of": "3.2.2"
},
"dependencies": {
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true
"dev": true,
"requires": {
"is-buffer": "1.1.6"
}
}
}
},
@ -591,7 +645,10 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
"integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
"dev": true
"dev": true,
"requires": {
"is-buffer": "1.1.6"
}
}
}
},
@ -599,7 +656,10 @@
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
"integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==",
"dev": true
"dev": true,
"requires": {
"is-equal-shallow": "0.1.3"
}
},
"remove-trailing-separator": {
"version": "1.1.0",
@ -625,17 +685,20 @@
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
"dev": true
},
"strip-ansi": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=",
"stack-utils": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz",
"integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=",
"dev": true
},
"supports-color": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz",
"integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=",
"dev": true
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz",
"integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==",
"dev": true,
"requires": {
"has-flag": "3.0.0"
}
},
"wrappy": {
"version": "1.0.2",

View file

@ -1,22 +1,24 @@
{
"name": "webidl2",
"description": "A WebIDL Parser",
"version": "8.1.0",
"version": "10.2.1",
"contributors": [
"Robin Berjon <robin@berjon.com> (https://berjon.com)",
"Marcos Caceres <marcos@marcosc.com> (https://marcosc.com)",
"Kagami Sascha Rosylight <saschaplas@outlook.com>"
"Kagami Sascha Rosylight <saschaplas@outlook.com>",
"Timothy Gu <timothygu99@gmail.com>"
],
"license": "W3C",
"dependencies": {},
"devDependencies": {
"expect": "21.2.1",
"jsondiffpatch": "0.2.5",
"mocha": "4.0.1"
"expect": "22.4.0",
"jsondiffpatch": "0.3.5",
"mocha": "5.0.4"
},
"scripts": {
"test": "mocha"
"test": "mocha",
"acquire": "node test/util/acquire.js"
},
"repository": "git://github.com/darobin/webidl2.js",
"repository": "git://github.com/w3c/webidl2.js",
"main": "index"
}

View file

@ -4,37 +4,17 @@
"use strict";
const wp = require("../lib/webidl2");
const expect = require("expect");
const pth = require("path");
const { collect } = require("./util/collect");
const fs = require("fs");
const expect = require("expect");
describe("Parses all of the invalid IDLs to check that they blow up correctly", () => {
const dir = pth.join(__dirname, "invalid/idl");
const skip = {};
const idls = fs.readdirSync(dir)
.filter(it => (/\.w?idl$/).test(it) && !skip[it])
.map(it => pth.join(dir, it));
const errors = idls.map(it => pth.join(__dirname, "invalid", "json", pth.basename(it).replace(/\.w?idl/, ".json")));
for (let i = 0, n = idls.length; i < n; i++) {
const idl = idls[i];
const err = JSON.parse(fs.readFileSync(errors[i], "utf8"));
it(`should produce the right error for ${idl}`, () => {
let error;
try {
var ast = wp.parse(fs.readFileSync(idl, "utf8"));
console.log(JSON.stringify(ast, null, 4));
}
catch (e) {
error = e;
}
finally {
expect(error).toBeTruthy();
expect(error.message).toEqual(err.message);
expect(error.line).toEqual(err.line);
}
for (const test of collect("invalid", { expectError: true })) {
it(`should produce the right error for ${test.path}`, () => {
const err = test.readJSON();
expect(test.error).toBeTruthy();
expect(test.error.message).toEqual(err.message);
expect(test.error.line).toEqual(err.line);
});
}
});

View file

@ -0,0 +1,7 @@
callback interface NoSemicolon {
attribute boolean noSemiColon;
}
enum YouNeedOne {
"really"
}

View file

@ -0,0 +1,7 @@
partial interface NoSemicolon {
attribute boolean noSemiColon;
}
enum YouNeedOne {
"really"
}

View file

@ -0,0 +1,2 @@
// This is a comment.
/ This is not.

View file

@ -1,4 +1,4 @@
{
"message": "No name in attribute",
"message": "Got an error during or right after parsing `interface LotteryResults`: No name in attribute",
"line": 5
}
}

View file

@ -1,4 +1,4 @@
{
"message": "Invalid operation",
"message": "Got an error during or right after parsing `interface NumberQuadrupler`: Invalid operation",
"line": 6
}

View file

@ -1,4 +1,4 @@
{
"message": "Required member must not have a default"
"message": "Got an error during or right after parsing `dictionary Dict`: Required member must not have a default"
, "line": 4
}

View file

@ -1,4 +1,4 @@
{
"message": "The name \"Test\" of type \"typedef\" is already seen",
"message": "Got an error during or right after parsing `typedef Test`: The name \"Test\" of type \"typedef\" is already seen",
"line": 3
}
}

View file

@ -1,4 +1,4 @@
{
"message": "Unexpected value in enum"
"message": "Got an error during or right after parsing `enum foo`: Unexpected value in enum"
, "line": 1
}

View file

@ -1,4 +1,4 @@
{
"message": "Unrecognised tokens",
"message": "Got an error before parsing any named definition: Unrecognised tokens",
"line": 4
}

View file

@ -0,0 +1,4 @@
{
"message": "Got an error during or right after parsing `interface SessionManager`: Invalid operation",
"line": 5
}

View file

@ -1,4 +1,4 @@
{
"message": "Missing second type argument in maplike declaration",
"message": "Got an error during or right after parsing `interface MapLikeOneType`: Missing second type argument in maplike declaration",
"line": 2
}
}

View file

@ -1,4 +1,4 @@
{
"message": "Unrecognised tokens"
"message": "Got an error before parsing any named definition: Unrecognised tokens"
, "line": 2
}

View file

@ -0,0 +1,4 @@
{
"message": "Got an error during or right after parsing `callback interface NoSemicolon`: Missing semicolon after interface",
"line": 5
}

View file

@ -0,0 +1,4 @@
{
"message": "Got an error during or right after parsing `partial interface NoSemicolon`: Missing semicolon after interface",
"line": 5
}

View file

@ -1,4 +1,4 @@
{
"message": "Type any cannot be made nullable"
"message": "Got an error during or right after parsing `interface NonNullable`: Type any cannot be made nullable"
, "line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "Can't nullable more than once"
"message": "Got an error during or right after parsing `interface NonNullable`: Can't nullable more than once"
, "line": 4
}

View file

@ -1,4 +1,4 @@
{
"message": "Promise type cannot have extended attribute",
"message": "Got an error during or right after parsing `interface Foo`: Promise type cannot have extended attribute",
"line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "Unterminated attribute"
"message": "Got an error during or right after parsing `interface Person`: Unterminated attribute"
, "line": 5
}

View file

@ -1,4 +1,4 @@
{
"message": "Invalid operation",
"message": "Got an error during or right after parsing `interface ReadonlyIterable`: Invalid operation",
"line": 2
}
}

View file

@ -1,4 +1,4 @@
{
"message": "Record key cannot have extended attribute",
"message": "Got an error during or right after parsing `interface Foo`: Record key cannot have extended attribute",
"line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "Record key must be DOMString, USVString, or ByteString",
"message": "Got an error during or right after parsing `interface Foo`: Record key must be DOMString, USVString, or ByteString",
"line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "No name in typedef"
"message": "Got an error before parsing any named definition: No name in typedef"
, "line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "Attributes cannot accept sequence types"
"message": "Got an error during or right after parsing `interface sequenceAsAttribute`: Attributes cannot accept sequence types"
, "line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "Unterminated setlike declaration",
"message": "Got an error during or right after parsing `interface SetLikeTwoTypes`: Unterminated setlike declaration",
"line": 2
}
}

View file

@ -1,4 +1,4 @@
{
"message": "Invalid operation",
"message": "Got an error during or right after parsing `interface OrderedMap`: Invalid operation",
"line": 3
}

View file

@ -1,4 +1,4 @@
{
"message": "Invalid operation"
"message": "Got an error during or right after parsing `interface Dictionary`: Invalid operation"
, "line": 6
}

View file

@ -0,0 +1,4 @@
{
"message": "Got an error before parsing any named definition: Unrecognised tokens"
, "line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "No value for const"
"message": "Got an error during or right after parsing `interface Util`: No value for const"
, "line": 2
}

View file

@ -1,4 +1,4 @@
{
"message": "Invalid operation"
"message": "Got an error during or right after parsing `interface Widget`: Invalid operation"
, "line": 14
}
}

View file

@ -1,34 +1,14 @@
"use strict";
const wp = require("../lib/webidl2");
const { collect } = require("./util/collect");
const expect = require("expect");
const pth = require("path");
const fs = require("fs");
const jdp = require("jsondiffpatch");
const debug = true;
describe("Parses all of the IDLs to produce the correct ASTs", () => {
const dir = pth.join(__dirname, "syntax/idl");
const skip = {}; // use if we have a broken test
const idls = fs.readdirSync(dir)
.filter(it => (/\.widl$/).test(it) && !skip[it])
.map(it => pth.join(dir, it));
const jsons = idls.map(it => pth.join(__dirname, "syntax/json", pth.basename(it).replace(".widl", ".json")));
for (let i = 0, n = idls.length; i < n; i++) {
const idl = idls[i];
const json = jsons[i];
it(`should produce the same AST for ${idl}`, () => {
for (const test of collect("syntax")) {
it(`should produce the same AST for ${test.path}`, () => {
try {
const optFile = pth.join(__dirname, "syntax/opt", pth.basename(json));
let opt = undefined;
if (fs.existsSync(optFile))
opt = JSON.parse(fs.readFileSync(optFile, "utf8"));
const diff = jdp.diff(JSON.parse(fs.readFileSync(json, "utf8")),
wp.parse(fs.readFileSync(idl, "utf8").replace(/\r\n/g, "\n"), opt));
if (diff && debug) console.log(JSON.stringify(diff, null, 4));
expect(diff).toBe(undefined);
expect(test.diff()).toBeFalsy();
}
catch (e) {
console.log(e.toString());

View file

@ -20,4 +20,10 @@ interface Circle {
attribute double cx;
attribute double cy;
readonly attribute double circumference;
};
};
// Extracted from https://heycam.github.io/webidl/#idl-annotated-types on 2017-12-15
[Exposed=Window]
interface I {
attribute [XAttr] (long or Node) attrib;
};

View file

@ -12,6 +12,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -30,6 +31,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -43,6 +45,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -62,6 +65,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -82,6 +86,7 @@
}
],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -24,4 +25,4 @@
"inheritance": null,
"extAttrs": []
}
]
]

View file

@ -3,6 +3,7 @@
"type": "callback",
"name": "AsyncOperationCallback",
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -15,6 +16,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -39,6 +41,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -52,6 +55,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -71,6 +75,7 @@
"type": "callback",
"name": "SortCallback",
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -83,6 +88,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -96,6 +102,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -7,7 +7,10 @@
{
"type": "const",
"nullable": false,
"idlType": "boolean",
"idlType": {
"type": "const-type",
"idlType": "boolean"
},
"name": "DEBUG",
"value": {
"type": "boolean",
@ -18,7 +21,10 @@
{
"type": "const",
"nullable": false,
"idlType": "short",
"idlType": {
"type": "const-type",
"idlType": "short"
},
"name": "negative",
"value": {
"type": "number",
@ -29,7 +35,10 @@
{
"type": "const",
"nullable": false,
"idlType": "octet",
"idlType": {
"type": "const-type",
"idlType": "octet"
},
"name": "LF",
"value": {
"type": "number",
@ -40,7 +49,10 @@
{
"type": "const",
"nullable": false,
"idlType": "unsigned long",
"idlType": {
"type": "const-type",
"idlType": "unsigned long"
},
"name": "BIT_MASK",
"value": {
"type": "number",
@ -51,7 +63,10 @@
{
"type": "const",
"nullable": false,
"idlType": "float",
"idlType": {
"type": "const-type",
"idlType": "float"
},
"name": "AVOGADRO",
"value": {
"type": "number",
@ -62,7 +77,10 @@
{
"type": "const",
"nullable": false,
"idlType": "unrestricted float",
"idlType": {
"type": "const-type",
"idlType": "unrestricted float"
},
"name": "sobig",
"value": {
"type": "Infinity",
@ -73,7 +91,10 @@
{
"type": "const",
"nullable": false,
"idlType": "unrestricted double",
"idlType": {
"type": "const-type",
"idlType": "unrestricted double"
},
"name": "minusonedividedbyzero",
"value": {
"type": "Infinity",
@ -84,7 +105,10 @@
{
"type": "const",
"nullable": false,
"idlType": "short",
"idlType": {
"type": "const-type",
"idlType": "short"
},
"name": "notanumber",
"value": {
"type": "NaN"
@ -95,4 +119,4 @@
"inheritance": null,
"extAttrs": []
}
]
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -43,6 +45,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -59,6 +62,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -85,6 +89,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -9,6 +9,7 @@
"name": "fillPattern",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -26,6 +27,7 @@
"name": "strokePattern",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -42,6 +44,7 @@
"name": "position",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -64,6 +67,7 @@
"name": "hydrometry",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -76,4 +80,4 @@
"inheritance": "PaintOptions",
"extAttrs": []
}
]
]

View file

@ -9,6 +9,7 @@
"name": "fillPattern",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -26,6 +27,7 @@
"name": "strokePattern",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -42,6 +44,7 @@
"name": "position",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -55,11 +58,13 @@
"name": "seq",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": true,
"generic": "sequence",
"nullable": false,
"union": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -78,6 +83,7 @@
"name": "reqSeq",
"required": true,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -100,6 +106,7 @@
"name": "h",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -113,6 +120,7 @@
"name": "d",
"required": false,
"idlType": {
"type": "dictionary-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -124,4 +132,4 @@
],
"extAttrs": []
}
]
]

View file

@ -7,4 +7,4 @@
"inheritance": null,
"extAttrs": []
}
]
]

View file

@ -7,4 +7,4 @@
"inheritance": null,
"extAttrs": []
}
]
]

View file

@ -3,9 +3,18 @@
"type": "enum",
"name": "MealType",
"values": [
{ "type": "string", "value": "rice" },
{ "type": "string", "value": "noodles" },
{ "type": "string", "value": "other" }
{
"type": "string",
"value": "rice"
},
{
"type": "string",
"value": "noodles"
},
{
"type": "string",
"value": "other"
}
],
"extAttrs": []
},
@ -21,6 +30,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -37,6 +47,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -54,6 +65,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -67,6 +79,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -80,6 +93,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -99,9 +113,18 @@
"type": "enum",
"name": "AltMealType",
"values": [
{ "type": "string", "value": "rice" },
{ "type": "string", "value": "noodles" },
{ "type": "string", "value": "other" }
{
"type": "string",
"value": "rice"
},
{
"type": "string",
"value": "noodles"
},
{
"type": "string",
"value": "other"
}
],
"extAttrs": []
}

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -28,6 +29,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +43,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -60,6 +63,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -73,6 +77,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -86,6 +91,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -113,6 +119,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -130,6 +137,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -143,6 +151,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -162,6 +171,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -175,6 +185,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -188,6 +199,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -207,6 +219,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -220,6 +233,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -239,6 +253,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -252,6 +267,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -265,6 +281,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -30,139 +30,205 @@
]
},
{
"type": "interface",
"name": "IdInterface",
"partial": false,
"members": [],
"inheritance": null,
"extAttrs": [
{
"name": "IntAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": {
"type": "integer",
"value": "0"
}
},
{
"name": "FloatAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": {
"type": "float",
"value": "3.14"
}
},
{
"name": "StringAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": {
"type": "string",
"value": "\"abc\""
}
}
]
"type": "interface",
"name": "IdInterface",
"partial": false,
"members": [],
"inheritance": null,
"extAttrs": [
{
"name": "IntAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": {
"type": "integer",
"value": "0"
}
},
{
"name": "FloatAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": {
"type": "float",
"value": "3.14"
}
},
{
"name": "StringAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": {
"type": "string",
"value": "\"abc\""
}
}
]
},
{
"type": "interface",
"name": "Circle",
"partial": false,
"members": [
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "r",
"extAttrs": []
},
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "cx",
"extAttrs": []
},
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "cy",
"extAttrs": []
},
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": true,
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "circumference",
"extAttrs": []
}
],
"inheritance": null,
"extAttrs": [
{
"name": "Constructor",
"arguments": null,
"type": "extended-attribute",
"rhs": null
},
{
"name": "Constructor",
"arguments": [
"type": "interface",
"name": "Circle",
"partial": false,
"members": [
{
"optional": false,
"variadic": false,
"extAttrs": [],
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "radius"
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "r",
"extAttrs": []
},
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "cx",
"extAttrs": []
},
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "cy",
"extAttrs": []
},
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "circumference",
"extAttrs": []
}
],
"type": "extended-attribute",
"rhs": null
}
]
],
"inheritance": null,
"extAttrs": [
{
"name": "Constructor",
"arguments": null,
"type": "extended-attribute",
"rhs": null
},
{
"name": "Constructor",
"arguments": [
{
"optional": false,
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "double"
},
"name": "radius"
}
],
"type": "extended-attribute",
"rhs": null
}
]
},
{
"type": "interface",
"name": "I",
"partial": false,
"members": [
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": true,
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "Node"
}
],
"extAttrs": [
{
"name": "XAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": null
}
]
},
"name": "attrib",
"extAttrs": []
}
],
"inheritance": null,
"extAttrs": [
{
"name": "Exposed",
"arguments": null,
"type": "extended-attribute",
"rhs": {
"type": "identifier",
"value": "Window"
}
}
]
}
]

View file

@ -12,21 +12,25 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": "Promise",
"nullable": false,
"union": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": "ResponsePromise",
"nullable": false,
"union": false,
"idlType": {
"type": "return-type",
"sequence": true,
"generic": "sequence",
"nullable": false,
"union": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -47,11 +51,13 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": "Promise",
"nullable": false,
"union": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -79,11 +85,13 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": "Promise",
"nullable": false,
"union": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -103,11 +111,13 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": "Promise",
"nullable": false,
"union": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -136,11 +146,13 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": "ResponsePromise",
"nullable": false,
"union": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -28,6 +29,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +43,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -60,6 +63,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -73,6 +77,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -86,6 +91,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -2,6 +2,7 @@
{
"type": "typedef",
"idlType": {
"type": "typedef-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -24,6 +25,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -37,6 +39,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -56,6 +59,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -69,6 +73,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -96,6 +101,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -112,6 +118,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -138,6 +145,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -151,6 +159,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -37,6 +38,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -50,6 +52,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -63,6 +66,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -76,6 +80,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -28,6 +29,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +43,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -60,6 +63,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -73,6 +77,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -86,6 +91,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -105,6 +111,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -118,6 +125,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -137,6 +145,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -150,6 +159,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -169,6 +179,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -182,6 +193,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -195,6 +207,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -214,6 +227,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -227,6 +241,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -36,6 +37,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -52,6 +54,7 @@
"inherit": true,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -65,4 +68,4 @@
"inheritance": "Animal",
"extAttrs": []
}
]
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -36,6 +37,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -61,6 +63,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -74,4 +77,4 @@
"inheritance": "Animal",
"extAttrs": []
}
]
]

View file

@ -6,13 +6,16 @@
"members": [
{
"type": "iterable",
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
},
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
}
],
"extAttrs": []
}
],
@ -28,6 +31,7 @@
"type": "iterable",
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -35,6 +39,7 @@
"idlType": "short"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": true,
@ -55,21 +60,24 @@
"members": [
{
"type": "iterable",
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long",
"extAttrs": [
{
"name": "XAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": null
}
]
},
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long",
"extAttrs": [
{
"name": "XAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": null
}
]
}
],
"extAttrs": []
}
],
@ -77,4 +85,3 @@
"extAttrs": []
}
]

View file

@ -6,13 +6,16 @@
"members": [
{
"type": "legacyiterable",
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
},
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
}
],
"extAttrs": []
}
],
@ -20,4 +23,3 @@
"extAttrs": []
}
]

View file

@ -8,6 +8,7 @@
"type": "maplike",
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -15,6 +16,7 @@
"idlType": "long"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -38,6 +40,7 @@
"type": "maplike",
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -45,6 +48,7 @@
"idlType": "long"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -68,6 +72,7 @@
"type": "maplike",
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -83,6 +88,7 @@
]
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -106,4 +112,3 @@
"extAttrs": []
}
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -47,6 +48,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -23,6 +23,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -40,4 +41,4 @@
}
]
}
]
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -28,6 +29,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +43,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -54,6 +57,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -73,6 +77,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -86,6 +91,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -99,6 +105,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -12,6 +12,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -25,6 +26,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -7,7 +7,10 @@
{
"type": "const",
"nullable": true,
"idlType": "boolean",
"idlType": {
"type": "const-type",
"idlType": "boolean"
},
"name": "ARE_WE_THERE_YET",
"value": {
"type": "boolean",
@ -31,6 +34,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -44,4 +48,4 @@
"inheritance": null,
"extAttrs": []
}
]
]

View file

@ -28,6 +28,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +42,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -60,6 +62,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -73,6 +76,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": true,

View file

@ -12,6 +12,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -25,6 +26,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -38,6 +40,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -51,6 +54,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -64,6 +68,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -28,6 +28,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +42,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -60,6 +62,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -73,6 +76,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -101,6 +105,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -114,6 +119,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -133,6 +139,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -153,6 +160,7 @@
}
],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -166,6 +174,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -179,6 +188,7 @@
"variadic": true,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -198,6 +208,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -216,6 +227,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -229,6 +241,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -242,6 +255,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -255,6 +269,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -268,6 +283,7 @@
"variadic": true,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -28,6 +29,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +43,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -36,6 +37,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -48,4 +50,4 @@
],
"extAttrs": []
}
]
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -43,6 +45,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -59,6 +62,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -75,6 +79,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -91,6 +96,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -107,6 +113,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -123,6 +130,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -139,6 +147,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -155,6 +164,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -171,6 +181,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -187,6 +198,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -203,6 +215,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -219,6 +232,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -235,6 +249,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -251,6 +266,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -267,6 +283,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -280,4 +297,4 @@
"inheritance": null,
"extAttrs": []
}
]
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -37,6 +38,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -50,4 +52,4 @@
"inheritance": null,
"extAttrs": []
}
]
]

View file

@ -12,6 +12,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -25,17 +26,20 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": true,
"generic": "sequence",
"nullable": false,
"union": false,
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": "record",
"nullable": false,
"union": false,
"idlType": [
{
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -43,6 +47,7 @@
"idlType": "ByteString"
},
{
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -65,12 +70,14 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": "record",
"nullable": false,
"union": false,
"idlType": [
{
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -78,12 +85,14 @@
"idlType": "DOMString"
},
{
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": true,
"union": true,
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -91,6 +100,7 @@
"idlType": "float"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
@ -113,6 +123,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -134,12 +145,14 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": "record",
"nullable": false,
"union": false,
"idlType": [
{
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -147,6 +160,7 @@
"idlType": "USVString"
},
{
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -176,12 +190,14 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": "record",
"nullable": false,
"union": false,
"idlType": [
{
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -189,6 +205,7 @@
"idlType": "DOMString"
},
{
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -53,6 +55,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -71,6 +74,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -84,6 +88,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -103,6 +108,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -116,6 +122,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -129,6 +136,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -35,6 +36,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -12,6 +12,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -25,11 +26,13 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": true,
"generic": "sequence",
"nullable": false,
"union": false,
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -50,11 +53,13 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": true,
"generic": "sequence",
"nullable": false,
"union": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -75,7 +80,6 @@
"name": "Foo",
"partial": false,
"members": [
{
"type": "operation",
"getter": false,
@ -84,6 +88,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -98,7 +103,6 @@
"inheritance": null,
"extAttrs": []
},
{
"type": "interface",
"name": "I",
@ -112,6 +116,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -125,11 +130,13 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": true,
"generic": "sequence",
"nullable": false,
"union": false,
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -6,13 +6,16 @@
"members": [
{
"type": "setlike",
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
},
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
}
],
"readonly": false,
"extAttrs": []
}
@ -27,13 +30,16 @@
"members": [
{
"type": "setlike",
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
},
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long"
}
],
"readonly": true,
"extAttrs": []
}
@ -48,21 +54,24 @@
"members": [
{
"type": "setlike",
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long",
"extAttrs": [
{
"name": "XAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": null
}
]
},
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long",
"extAttrs": [
{
"name": "XAttr",
"arguments": null,
"type": "extended-attribute",
"rhs": null
}
]
}
],
"readonly": false,
"extAttrs": []
}
@ -71,4 +80,3 @@
"extAttrs": []
}
]

View file

@ -19,6 +19,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -35,6 +36,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -51,6 +53,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -67,6 +70,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -84,6 +88,7 @@
"static": true,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -97,6 +102,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -110,6 +116,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -123,6 +130,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": true,
@ -43,6 +45,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -60,6 +63,7 @@
"static": false,
"stringifier": true,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -12,6 +12,7 @@
"static": false,
"stringifier": true,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -44,6 +46,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -67,6 +70,7 @@
}
],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -44,6 +46,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -67,6 +70,7 @@
}
],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -1,49 +1,48 @@
[
{
"type" : "typedef",
"idlType" : {
"nullable" : false,
"generic" : null,
"union" : true,
"idlType" : [
{
"union" : false,
"generic" : null,
"nullable" : false,
"array" : false,
"sequence" : false,
"idlType" : "ImageData"
},
{
"generic" : null,
"union" : false,
"nullable" : false,
"array" : false,
"idlType" : "HTMLImageElement",
"sequence" : false
},
{
"array" : false,
"sequence" : false,
"idlType" : "HTMLCanvasElement",
"generic" : null,
"union" : false,
"nullable" : false
},
{
"union" : false,
"generic" : null,
"nullable" : false,
"array" : false,
"sequence" : false,
"idlType" : "HTMLVideoElement"
}
],
"sequence" : false,
"array" : false
},
"name" : "TexImageSource",
"extAttrs" : [],
"typeExtAttrs" : []
}
{
"type": "typedef",
"idlType": {
"type": "typedef-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": true,
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "ImageData"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "HTMLImageElement"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "HTMLCanvasElement"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "HTMLVideoElement"
}
]
},
"name": "TexImageSource",
"extAttrs": []
}
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -27,6 +28,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -43,11 +45,13 @@
{
"type": "typedef",
"idlType": {
"type": "typedef-type",
"sequence": true,
"generic": "sequence",
"nullable": false,
"union": false,
"idlType": {
"type": "typedef-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -70,6 +74,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -86,6 +91,7 @@
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -111,6 +117,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -128,6 +135,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -141,6 +149,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -160,6 +169,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -173,6 +183,7 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -191,6 +202,7 @@
{
"type": "typedef",
"idlType": {
"type": "typedef-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -12,6 +12,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -25,11 +26,13 @@
"variadic": false,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": true,
"generic": "sequence",
"nullable": true,
"union": false,
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": true,

View file

@ -1,118 +1,129 @@
[
{
"partial": false,
"members": [
{
"idlType": {
"idlType": [
{
"union": false,
"sequence": false,
"generic": null,
"idlType": "float",
"nullable": false
},
{
"idlType": [
{
"type": "interface",
"name": "Union",
"partial": false,
"members": [
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": true,
"idlType": [
{
"nullable": false,
"idlType": "Date",
"sequence": false,
"generic": null,
"union": false
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "float"
},
{
"nullable": false,
"idlType": "Event",
"generic": null,
"sequence": false,
"union": false
}
],
"nullable": false,
"sequence": false,
"generic": null,
"union": true
},
{
"generic": null,
"sequence": false,
"idlType": [
{
"union": false,
"sequence": false,
"generic": null,
"nullable": false,
"idlType": "Node"
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": true,
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "Date"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "Event"
}
]
},
{
"nullable": false,
"idlType": "DOMString",
"sequence": false,
"generic": null,
"union": false
"type": null,
"sequence": false,
"generic": null,
"nullable": true,
"union": true,
"idlType": [
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "Node"
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "DOMString"
}
]
}
],
"nullable": true,
"union": true
}
],
"nullable": false,
"generic": null,
"sequence": false,
"union": true
]
},
"name": "test",
"extAttrs": []
},
"name": "test",
"inherit": false,
"type": "attribute",
"extAttrs": [],
"readonly": false,
"stringifier": false,
"static": false
},
{
"readonly": false,
"extAttrs": [],
"stringifier": false,
"static": false,
"name": "test2",
"idlType": {
"nullable": false,
"idlType": [
{
"extAttrs": [
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": false,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
"union": true,
"idlType": [
{
"name": "EnforceRange",
"arguments": null,
"type": "extended-attribute",
"rhs": null
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "long",
"extAttrs": [
{
"name": "EnforceRange",
"arguments": null,
"type": "extended-attribute",
"rhs": null
}
]
},
{
"type": null,
"sequence": false,
"generic": null,
"nullable": false,
"union": false,
"idlType": "Date"
}
],
"nullable": false,
"idlType": "long",
"generic": null,
"sequence": false,
"union": false
},
{
"union": false,
"sequence": false,
"generic": null,
"idlType": "Date",
"nullable": false
}
],
"generic": null,
"sequence": false,
"union": true
},
"inherit": false,
"type": "attribute"
}
],
"inheritance": null,
"name": "Union",
"extAttrs": [],
"type": "interface"
}
]
},
"name": "test2",
"extAttrs": []
}
],
"inheritance": null,
"extAttrs": []
}
]

View file

@ -11,6 +11,7 @@
"inherit": false,
"readonly": true,
"idlType": {
"type": "attribute-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -28,6 +29,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -41,6 +43,7 @@
"variadic": true,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -60,6 +63,7 @@
"static": false,
"stringifier": false,
"idlType": {
"type": "return-type",
"sequence": false,
"generic": null,
"nullable": false,
@ -73,6 +77,7 @@
"variadic": true,
"extAttrs": [],
"idlType": {
"type": "argument-type",
"sequence": false,
"generic": null,
"nullable": false,

View file

@ -0,0 +1,8 @@
"use strict";
const { collect } = require("./collect");
const fs = require("fs");
for (const test of collect("syntax")) {
fs.writeFileSync(test.jsonPath, `${JSON.stringify(test.ast, null, 4)}\n`)
}

View file

@ -0,0 +1,59 @@
"use strict";
const wp = require("../../lib/webidl2");
const pth = require("path");
const fs = require("fs");
const jdp = require("jsondiffpatch");
/**
* Collects test items from the specified directory
* @param {string} base
*/
function* collect(base, { expectError } = {}) {
base = pth.join(__dirname, "..", base);
const dir = pth.join(base, "idl");
const idls = fs.readdirSync(dir)
.filter(it => (/\.widl$/).test(it))
.map(it => pth.join(dir, it));
for (const path of idls) {
const optFile = pth.join(base, "opt", pth.basename(path)).replace(".widl", ".json");
let opt;
if (fs.existsSync(optFile))
opt = JSON.parse(fs.readFileSync(optFile, "utf8"));
try {
const ast = wp.parse(fs.readFileSync(path, "utf8").replace(/\r\n/g, "\n"), opt);
yield new TestItem({ ast, path, opt });
}
catch (error) {
if (expectError) {
yield new TestItem({ path, error });
}
else {
throw error;
}
}
}
};
class TestItem {
constructor({ ast, path, error, opt }) {
this.ast = ast;
this.path = path;
this.error = error;
this.opt = opt;
this.jsonPath = pth.join(pth.dirname(path), "../json", pth.basename(path).replace(".widl", ".json"));
}
readJSON() {
return JSON.parse(fs.readFileSync(this.jsonPath, "utf8"));
}
diff(target = this.readJSON()) {
return jdp.diff(target, this.ast);
}
}
module.exports.collect = collect;

View file

@ -0,0 +1,23 @@
"use strict";
const { collect } = require("./util/collect");
const wp = require("../lib/webidl2");
const writer = require("../lib/writer");
const expect = require("expect");
const debug = true;
describe("Rewrite and parses all of the IDLs to produce the same ASTs", () => {
for (const test of collect("syntax")) {
it(`should produce the same AST for ${test.path}`, () => {
try {
const diff = test.diff(wp.parse(writer.write(test.ast), test.opt));
if (diff && debug) console.log(JSON.stringify(diff, null, 4));
expect(diff).toBe(undefined);
}
catch (e) {
console.log(e.toString());
throw e;
}
});
}
});