diff --git a/lib/productions/argument.js b/lib/productions/argument.js index dd6f00af..45cff88b 100644 --- a/lib/productions/argument.js +++ b/lib/productions/argument.js @@ -14,7 +14,14 @@ import { dictionaryIncludesRequiredField, } from "../validators/helpers.js"; +/** @import {Type} from "./type.js" */ + export class Argument extends Base { + /** @type {Type} */ + idlType; + /** @type {Default | null} */ + default; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/array-base.js b/lib/productions/array-base.js index 18304a00..05119005 100644 --- a/lib/productions/array-base.js +++ b/lib/productions/array-base.js @@ -1,4 +1,12 @@ +/** @import {Token} from "../tokeniser.js" */ + export class ArrayBase extends Array { + /** @type {Record} */ + tokens; + /** @type {Token[]} */ + source; + parent; + constructor({ source, tokens }) { super(); Object.defineProperties(this, { diff --git a/lib/productions/attribute.js b/lib/productions/attribute.js index 0c203a0b..d50ddafe 100644 --- a/lib/productions/attribute.js +++ b/lib/productions/attribute.js @@ -10,7 +10,12 @@ import { autoParenter, } from "./helpers.js"; +/** @import {Type} from "./type.js" */ + export class Attribute extends Base { + /** @type {Type} */ + idlType; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser * @param {object} [options] diff --git a/lib/productions/base.js b/lib/productions/base.js index c3dc73c5..c7e357ff 100644 --- a/lib/productions/base.js +++ b/lib/productions/base.js @@ -1,4 +1,20 @@ +/** @import {ExtendedAttributes} from "./extended-attributes.js" */ +/** @import {Token} from "../tokeniser.js" */ +/** @import {Definitions} from "../validator.js" */ +/** @import {Writer} from "../writer.js" */ + export class Base { + /** @type {Record} */ + tokens; + /** @type {Token[]} */ + source; + /** @type {ExtendedAttributes | undefined} */ + extAttrs; + /** @type {this} */ + this; + /** @type {*} */ + parent; + /** * @param {object} initializer * @param {Base["source"]} initializer.source @@ -6,13 +22,27 @@ export class Base { */ constructor({ source, tokens }) { Object.defineProperties(this, { - source: { value: source }, - tokens: { value: tokens, writable: true }, - parent: { value: null, writable: true }, - this: { value: this }, // useful when escaping from proxy + source: { value: source, enumerable: false }, + tokens: { value: tokens, writable: true, enumerable: false }, + parent: { value: null, writable: true, enumerable: false }, + this: { value: this, enumerable: false }, // useful when escaping from proxy }); } + /** + * @param {Definitions} defs + * @returns {IterableIterator} + */ + // eslint-disable-next-line no-unused-vars + *validate(defs) {} + + /** + * @param {Writer} w + * @returns {*} + */ + // eslint-disable-next-line no-unused-vars + write(w) {} + toJSON() { const json = { type: undefined, name: undefined, inheritance: undefined }; let proto = this; @@ -20,7 +50,6 @@ export class Base { const descMap = Object.getOwnPropertyDescriptors(proto); for (const [key, value] of Object.entries(descMap)) { if (value.enumerable || value.get) { - // @ts-ignore - allow indexing here json[key] = this[key]; } } diff --git a/lib/productions/callback-interface.js b/lib/productions/callback-interface.js index d5bd34dd..a96149db 100644 --- a/lib/productions/callback-interface.js +++ b/lib/productions/callback-interface.js @@ -1,4 +1,4 @@ -import { Container } from "./container.js"; +import { Container, parseContainer } from "./container.js"; import { Operation } from "./operation.js"; import { Constant } from "./constant.js"; @@ -15,7 +15,7 @@ export class CallbackInterface extends Container { if (!tokens.base) { return; } - return Container.parse( + return parseContainer( tokeniser, new CallbackInterface({ source: tokeniser.source, tokens }), { diff --git a/lib/productions/callback.js b/lib/productions/callback.js index 316a19f1..75779f66 100644 --- a/lib/productions/callback.js +++ b/lib/productions/callback.js @@ -7,7 +7,15 @@ import { } from "./helpers.js"; import { validationError } from "../error.js"; +/** @import {Type} from "./type.js" */ +/** @import {Argument} from "./argument.js" */ + export class CallbackFunction extends Base { + /** @type {Type} */ + idlType; + /** @type {Argument[]} */ + arguments; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/constant.js b/lib/productions/constant.js index 9fd90146..e93d8a2e 100644 --- a/lib/productions/constant.js +++ b/lib/productions/constant.js @@ -9,6 +9,9 @@ import { } from "./helpers.js"; export class Constant extends Base { + /** @type {Type} */ + idlType; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/constructor.js b/lib/productions/constructor.js index 654c0bd1..4f4d1f93 100644 --- a/lib/productions/constructor.js +++ b/lib/productions/constructor.js @@ -1,7 +1,12 @@ import { Base } from "./base.js"; import { argument_list, autoParenter } from "./helpers.js"; +/** @import {Argument} from "./argument.js" */ + export class Constructor extends Base { + /** @type {Argument[]} */ + arguments; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/container.js b/lib/productions/container.js index 95bba91c..59ff92b4 100644 --- a/lib/productions/container.js +++ b/lib/productions/container.js @@ -2,8 +2,10 @@ import { Base } from "./base.js"; import { ExtendedAttributes } from "./extended-attributes.js"; import { unescape, autoParenter } from "./helpers.js"; +/** @import {Tokeniser} from "../tokeniser.js" */ + /** - * @param {import("../tokeniser.js").Tokeniser} tokeniser + * @param {Tokeniser} tokeniser */ function inheritance(tokeniser) { const colon = tokeniser.consume(":"); @@ -19,7 +21,7 @@ function inheritance(tokeniser) { /** * Parser callback. * @callback ParserCallback - * @param {import("../tokeniser.js").Tokeniser} tokeniser + * @param {Tokeniser} tokeniser * @param {...*} args */ @@ -30,45 +32,11 @@ function inheritance(tokeniser) { */ export class Container extends Base { - /** - * @param {import("../tokeniser.js").Tokeniser} tokeniser - * @param {*} instance TODO: This should be {T extends Container}, but see https://github.com/microsoft/TypeScript/issues/4628 - * @param {*} args - */ - static parse(tokeniser, instance, { inheritable, allowedMembers }) { - const { tokens, type } = instance; - tokens.name = - tokeniser.consumeKind("identifier") || - tokeniser.error(`Missing name in ${type}`); - tokeniser.current = instance; - instance = autoParenter(instance); - if (inheritable) { - Object.assign(tokens, inheritance(tokeniser)); - } - tokens.open = tokeniser.consume("{") || tokeniser.error(`Bodyless ${type}`); - instance.members = []; - while (true) { - tokens.close = tokeniser.consume("}"); - if (tokens.close) { - tokens.termination = - tokeniser.consume(";") || - tokeniser.error(`Missing semicolon after ${type}`); - return instance.this; - } - const ea = ExtendedAttributes.parse(tokeniser); - let mem; - for (const [parser, ...args] of allowedMembers) { - mem = autoParenter(parser(tokeniser, ...args)); - if (mem) { - break; - } - } - if (!mem) { - tokeniser.error("Unknown member"); - } - mem.extAttrs = ea; - instance.members.push(mem.this); - } + /** @type {any[]} */ + members; + + get type() { + return ""; } get partial() { @@ -125,3 +93,50 @@ export class Container extends Base { ); } } + +/** + * @param {Tokeniser} tokeniser + * @param {Container} instance + * @param {object} args + * @param {boolean} [args.inheritable] + * @param {AllowedMember[]} [args.allowedMembers] + */ +export function parseContainer( + tokeniser, + instance, + { inheritable, allowedMembers }, +) { + const { tokens, type } = instance; + tokens.name = + tokeniser.consumeKind("identifier") || + tokeniser.error(`Missing name in ${type}`); + tokeniser.current = instance; + instance = autoParenter(instance); + if (inheritable) { + Object.assign(tokens, inheritance(tokeniser)); + } + tokens.open = tokeniser.consume("{") || tokeniser.error(`Bodyless ${type}`); + instance.members = []; + while (true) { + tokens.close = tokeniser.consume("}"); + if (tokens.close) { + tokens.termination = + tokeniser.consume(";") || + tokeniser.error(`Missing semicolon after ${type}`); + return instance.this; + } + const ea = ExtendedAttributes.parse(tokeniser); + let mem; + for (const [parser, ...args] of allowedMembers) { + mem = autoParenter(parser(tokeniser, ...args)); + if (mem) { + break; + } + } + if (!mem) { + tokeniser.error("Unknown member"); + } + mem.extAttrs = ea; + instance.members.push(mem.this); + } +} diff --git a/lib/productions/default.js b/lib/productions/default.js index ae5adf52..2acd3816 100644 --- a/lib/productions/default.js +++ b/lib/productions/default.js @@ -1,7 +1,12 @@ import { Base } from "./base.js"; import { const_data, const_value } from "./helpers.js"; +/** @import {Token} from "../tokeniser.js" */ + export class Default extends Base { + /** @type {Token[]} */ + expression; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/dictionary.js b/lib/productions/dictionary.js index f1faef4b..1b4896c9 100644 --- a/lib/productions/dictionary.js +++ b/lib/productions/dictionary.js @@ -1,4 +1,4 @@ -import { Container } from "./container.js"; +import { Container, parseContainer } from "./container.js"; import { Field } from "./field.js"; export class Dictionary extends Container { @@ -14,7 +14,7 @@ export class Dictionary extends Container { if (!tokens.base) { return; } - return Container.parse( + return parseContainer( tokeniser, new Dictionary({ source: tokeniser.source, tokens }), { diff --git a/lib/productions/enum.js b/lib/productions/enum.js index c581c3c3..429b8624 100644 --- a/lib/productions/enum.js +++ b/lib/productions/enum.js @@ -35,6 +35,9 @@ export class EnumValue extends WrappedToken { } export class Enum extends Base { + /** @type {EnumValue[]} */ + values; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/extended-attributes.js b/lib/productions/extended-attributes.js index a0fbaf66..a996f278 100644 --- a/lib/productions/extended-attributes.js +++ b/lib/productions/extended-attributes.js @@ -50,7 +50,12 @@ function extAttrListItems(tokeniser) { ); } +/** @import {Argument} from "./argument.js" */ + export class ExtendedAttributeParameters extends Base { + /** @type {WrappedToken[] | Argument[]} */ + list; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ @@ -121,6 +126,9 @@ export class ExtendedAttributeParameters extends Base { } export class SimpleExtendedAttribute extends Base { + /** @type {ExtendedAttributeParameters} */ + params; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ @@ -138,7 +146,7 @@ export class SimpleExtendedAttribute extends Base { constructor({ source, tokens, params }) { super({ source, tokens }); params.parent = this; - Object.defineProperty(this, "params", { value: params }); + Object.defineProperty(this, "params", { value: params, enumerable: false }); } get type() { diff --git a/lib/productions/field.js b/lib/productions/field.js index 1cd44ed7..7353c2c3 100644 --- a/lib/productions/field.js +++ b/lib/productions/field.js @@ -7,7 +7,14 @@ import { import { ExtendedAttributes } from "./extended-attributes.js"; import { Default } from "./default.js"; +/** @import {Type} from "./type.js" */ + export class Field extends Base { + /** @type {Type} */ + idlType; + /** @type {Default} */ + default; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/index.js b/lib/productions/index.js index 4ea3dc22..3db2d05a 100644 --- a/lib/productions/index.js +++ b/lib/productions/index.js @@ -3,7 +3,7 @@ export { Attribute } from "./attribute.js"; export { Base } from "./base.js"; export { Constant } from "./constant.js"; export { Constructor } from "./constructor.js"; -export { Container } from "./container.js"; +export { Container, parseContainer } from "./container.js"; export { Default } from "./default.js"; export { ExtendedAttributes, diff --git a/lib/productions/interface.js b/lib/productions/interface.js index e196cede..c568e8dc 100644 --- a/lib/productions/interface.js +++ b/lib/productions/interface.js @@ -1,4 +1,4 @@ -import { Container } from "./container.js"; +import { Container, parseContainer } from "./container.js"; import { Attribute } from "./attribute.js"; import { Operation } from "./operation.js"; import { Constant } from "./constant.js"; @@ -41,7 +41,7 @@ export class Interface extends Container { */ static parse(tokeniser, base, { extMembers = [], partial = null } = {}) { const tokens = { partial, base }; - return Container.parse( + return parseContainer( tokeniser, new Interface({ source: tokeniser.source, tokens }), { diff --git a/lib/productions/iterable.js b/lib/productions/iterable.js index 22041800..946c7c6f 100644 --- a/lib/productions/iterable.js +++ b/lib/productions/iterable.js @@ -6,7 +6,15 @@ import { argument_list, } from "./helpers.js"; +/** @import {Type} from "./type.js" */ +/** @import {Argument} from "./argument.js" */ + export class IterableLike extends Base { + /** @type {Type[]} */ + idlType; + /** @type {Argument[]} */ + arguments; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/productions/mixin.js b/lib/productions/mixin.js index f4ed7ca6..594b9b71 100644 --- a/lib/productions/mixin.js +++ b/lib/productions/mixin.js @@ -1,4 +1,4 @@ -import { Container } from "./container.js"; +import { Container, parseContainer } from "./container.js"; import { Constant } from "./constant.js"; import { Attribute } from "./attribute.js"; import { Operation } from "./operation.js"; @@ -18,7 +18,7 @@ export class Mixin extends Container { if (!tokens.mixin) { return; } - return Container.parse( + return parseContainer( tokeniser, new Mixin({ source: tokeniser.source, tokens }), { diff --git a/lib/productions/namespace.js b/lib/productions/namespace.js index acbce430..1c63be9f 100644 --- a/lib/productions/namespace.js +++ b/lib/productions/namespace.js @@ -1,4 +1,4 @@ -import { Container } from "./container.js"; +import { Container, parseContainer } from "./container.js"; import { Attribute } from "./attribute.js"; import { Operation } from "./operation.js"; import { validationError } from "../error.js"; @@ -18,7 +18,7 @@ export class Namespace extends Container { if (!tokens.base) { return; } - return Container.parse( + return parseContainer( tokeniser, new Namespace({ source: tokeniser.source, tokens }), { diff --git a/lib/productions/operation.js b/lib/productions/operation.js index bec24a00..c9cf1fa5 100644 --- a/lib/productions/operation.js +++ b/lib/productions/operation.js @@ -7,7 +7,15 @@ import { } from "./helpers.js"; import { validationError } from "../error.js"; +/** @import {Type} from "./type.js" */ +/** @import {Argument} from "./argument.js" */ + export class Operation extends Base { + /** @type {Type} */ + idlType; + /** @type {Argument[]} */ + arguments; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser * @param {object} [options] diff --git a/lib/productions/type.js b/lib/productions/type.js index 393743d0..3d382550 100644 --- a/lib/productions/type.js +++ b/lib/productions/type.js @@ -155,6 +155,15 @@ function union_type(tokeniser, type) { } export class Type extends Base { + /** + * TODO: This kind of type check should ultimately be replaced by exposed constructors. + * See https://github.com/w3c/webidl2.js/issues/537 and https://github.com/w3c/webidl2.js/issues/297. + */ + /** @type {string | null} */ + type; + /** @type {Type[]} */ + subtype; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser * @param {string} typeName @@ -165,7 +174,11 @@ export class Type extends Base { constructor({ source, tokens }) { super({ source, tokens }); - Object.defineProperty(this, "subtype", { value: [], writable: true }); + Object.defineProperty(this, "subtype", { + value: [], + writable: true, + enumerable: false, + }); this.extAttrs = new ExtendedAttributes({ source, tokens: {} }); } diff --git a/lib/productions/typedef.js b/lib/productions/typedef.js index 031898f7..00d620fa 100644 --- a/lib/productions/typedef.js +++ b/lib/productions/typedef.js @@ -5,7 +5,12 @@ import { autoParenter, } from "./helpers.js"; +/** @import {Type} from "./type.js" */ + export class Typedef extends Base { + /** @type {Type} */ + idlType; + /** * @param {import("../tokeniser.js").Tokeniser} tokeniser */ diff --git a/lib/supplement.d.ts b/lib/supplement.d.ts deleted file mode 100644 index 52c70254..00000000 --- a/lib/supplement.d.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { ExtendedAttributes } from "./productions/extended-attributes.js"; -import { Type } from "./productions/type.js"; -import { Default } from "./productions/default.js"; -import { Token } from "./tokeniser.js"; -import { Argument } from "./productions/argument.js"; -import { WrappedToken } from "./productions/token.js"; -import { Base } from "./productions/base.js"; -import { Definitions } from "./validator.js"; -import { Writer } from "./writer.js"; - -declare module "./tokeniser.js" { - interface Tokeniser { - current: any; - // TODO: This somehow causes fatal error on typescript - // source: Token[] & { name?: string }; - } -} - -declare module "./productions/argument.js" { - interface Argument { - idlType: Type; - default: Default | null; - } -} - -declare module "./productions/attribute.js" { - interface Attribute { - idlType: Type; - default: Default | null; - } -} - -declare module "./productions/attribute.js" { - interface Attribute { - idlType: Type; - default: Default | null; - } -} - -declare module "./productions/callback.js" { - interface CallbackFunction { - idlType: Type; - arguments: Argument[]; - } -} - -declare module "./productions/constant.js" { - interface Constant { - idlType: Type; - } -} - - -declare module "./productions/constructor.js" { - interface Constructor { - arguments: Argument[]; - } -} - -declare module "./productions/container.js" { - interface TypedBase extends Base { - type: string - } - interface Container { - type: string; - members: RootType[]; - } -} - -declare module "./productions/default.js" { - interface Default { - expression: Token[]; - } -} - -declare module "./productions/enum.js" { - interface Enum { - values: EnumValue[]; - } -} - -declare module "./productions/field.js" { - interface Field { - idlType: Type; - default: Default | null; - } -} - -declare module "./productions/iterable.js" { - interface IterableLike { - idlType: Type[]; - arguments: Argument[]; - } -} - -declare module "./productions/operation.js" { - interface Operation { - idlType: Type; - arguments: Argument[]; - } -} - -declare module "./productions/typedef.js" { - interface Typedef { - idlType: Type; - } -} - -declare module "./productions/extended-attributes.js" { - interface ExtendedAttributeParameters { - list: WrappedToken[] | Argument[]; - } - interface SimpleExtendedAttribute { - params: ExtendedAttributeParameters; - } -} - -declare module "./productions/base.js" { - interface Base { - tokens: Record; - source: Token[]; - extAttrs: ExtendedAttributes | undefined; - this: this; - parent?: any; - - validate?(defs: Definitions): IterableIterator; - write(w: Writer): any; - } -} - -declare module "./productions/array-base.js" { - interface ArrayBase { - tokens: Record; - source: Token[]; - parent?: any; - } -} - -declare module "./productions/type.js" { - interface Type { - /** - * TODO: This kind of type check should ultimately be replaced by exposed constructors. - * See https://github.com/w3c/webidl2.js/issues/537 and https://github.com/w3c/webidl2.js/issues/297. - */ - type: string | null; - subtype: Type[]; - } -} - -declare global { - export type ArrayItemType = T extends Array ? X : null; -} diff --git a/lib/tokeniser.js b/lib/tokeniser.js index a934c52a..77a404a7 100644 --- a/lib/tokeniser.js +++ b/lib/tokeniser.js @@ -1,6 +1,8 @@ import { syntaxError } from "./error.js"; import { unescape } from "./productions/helpers.js"; +/** @import {Base} from "./productions/base.js" */ + // These regular expressions use the sticky flag so they will only match at // the current location (ie. the offset of lastIndex). const tokenRe = { @@ -122,7 +124,7 @@ const reserved = [ ]; /** - * @typedef {ArrayItemType>} Token + * @typedef {ReturnType[number]} Token * @param {string} str */ function tokenise(str) { @@ -231,6 +233,11 @@ function tokenise(str) { } export class Tokeniser { + /** @type {Base} */ + current; + /** @type {Token[] & { name?: string }} */ + source; + /** * @param {string} idl */ diff --git a/test/syntax/baseline/allowany.json b/test/syntax/baseline/allowany.json index 0dadf272..a418e3f0 100644 --- a/test/syntax/baseline/allowany.json +++ b/test/syntax/baseline/allowany.json @@ -3,10 +3,12 @@ "type": "interface", "name": "B", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "g", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -16,12 +18,12 @@ "idlType": "undefined" }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "g", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -48,12 +50,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "g", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -87,11 +89,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/argument-constructor.json b/test/syntax/baseline/argument-constructor.json index 39473b58..a145955f 100644 --- a/test/syntax/baseline/argument-constructor.json +++ b/test/syntax/baseline/argument-constructor.json @@ -3,10 +3,22 @@ "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "operation", "name": "foo", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -33,21 +45,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/argument-extattrs.json b/test/syntax/baseline/argument-extattrs.json index 9df419ef..25652906 100644 --- a/test/syntax/baseline/argument-extattrs.json +++ b/test/syntax/baseline/argument-extattrs.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "foo", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -47,11 +49,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/async-iterable.json b/test/syntax/baseline/async-iterable.json index ab43a645..9d2e66fb 100644 --- a/test/syntax/baseline/async-iterable.json +++ b/test/syntax/baseline/async-iterable.json @@ -3,9 +3,11 @@ "type": "interface", "name": "AsyncIterable", "inheritance": null, + "extAttrs": [], "members": [ { "type": "async_iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -25,21 +27,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "AsyncIterableWithExtAttr", "inheritance": null, + "extAttrs": [], "members": [ { "type": "async_iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -73,21 +75,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "AsyncIterableWithNoParam", "inheritance": null, + "extAttrs": [], "members": [ { "type": "async_iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -107,21 +109,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "AsyncIterableWithParam", "inheritance": null, + "extAttrs": [], "members": [ { "type": "async_iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -158,21 +160,21 @@ "variadic": false } ], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "AsyncValueIterable", "inheritance": null, + "extAttrs": [], "members": [ { "type": "async_iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -184,21 +186,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "AsyncValueIterableWithNoParam", "inheritance": null, + "extAttrs": [], "members": [ { "type": "async_iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -210,21 +212,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "AsyncValueIterableWithParams", "inheritance": null, + "extAttrs": [], "members": [ { "type": "async_iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -269,12 +271,10 @@ "variadic": false } ], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/async-name.json b/test/syntax/baseline/async-name.json index 128fc32c..edd1c4c1 100644 --- a/test/syntax/baseline/async-name.json +++ b/test/syntax/baseline/async-name.json @@ -3,10 +3,22 @@ "type": "interface", "name": "Async", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "attribute", "name": "async", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +27,13 @@ "union": false, "idlType": "boolean" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "operation", "name": "asyncOp", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -48,21 +60,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/async-sequence.json b/test/syntax/baseline/async-sequence.json index 6978e1fd..a9a47267 100644 --- a/test/syntax/baseline/async-sequence.json +++ b/test/syntax/baseline/async-sequence.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Canvas", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "drawPolygonAsync", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -51,21 +53,21 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "I", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "f1", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -117,11 +119,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/attributes.json b/test/syntax/baseline/attributes.json index 5b863957..8a732ea6 100644 --- a/test/syntax/baseline/attributes.json +++ b/test/syntax/baseline/attributes.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Person", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "age", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "unsigned short" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "required", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,12 +32,10 @@ "union": false, "idlType": "any" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/bigint.json b/test/syntax/baseline/bigint.json index 3c86d493..18358d48 100644 --- a/test/syntax/baseline/bigint.json +++ b/test/syntax/baseline/bigint.json @@ -3,10 +3,22 @@ "type": "interface", "name": "Interface", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "attribute", "name": "bigint", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +27,13 @@ "union": false, "idlType": "bigint" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "operation", "name": "getBig", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -31,12 +43,12 @@ "idlType": "bigint" }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "setBig", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -63,27 +75,16 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { "type": "dictionary", "name": "Dictionary", "inheritance": null, + "extAttrs": [], "members": [ { "type": "field", @@ -116,12 +117,12 @@ "required": true } ], - "extAttrs": [], "partial": false }, { "type": "typedef", "name": "allowed", + "extAttrs": [], "idlType": { "type": "typedef-type", "extAttrs": [], @@ -146,8 +147,7 @@ "idlType": "short" } ] - }, - "extAttrs": [] + } }, { "type": "eof", diff --git a/test/syntax/baseline/buffersource.json b/test/syntax/baseline/buffersource.json index ed5382e9..a014c495 100644 --- a/test/syntax/baseline/buffersource.json +++ b/test/syntax/baseline/buffersource.json @@ -3,10 +3,22 @@ "type": "interface", "name": "Buffer", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -33,12 +45,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -65,12 +77,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -97,12 +109,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -129,12 +141,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -161,12 +173,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -193,12 +205,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -225,12 +237,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -257,12 +269,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -289,12 +301,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -321,12 +333,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -353,12 +365,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -385,12 +397,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "add", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -417,12 +429,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "addAny", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -449,12 +461,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "addBuffer", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -481,12 +493,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "addView", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -513,21 +525,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/callback.json b/test/syntax/baseline/callback.json index 519be46b..c2239fc2 100644 --- a/test/syntax/baseline/callback.json +++ b/test/syntax/baseline/callback.json @@ -2,6 +2,7 @@ { "type": "callback", "name": "AsyncOperationCallback", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -27,17 +28,18 @@ "optional": false, "variadic": false } - ], - "extAttrs": [] + ] }, { "type": "callback interface", "name": "EventHandler", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "eventOccurred", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -64,16 +66,15 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { "type": "callback", "name": "SortCallback", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -115,8 +116,7 @@ "optional": false, "variadic": false } - ], - "extAttrs": [] + ] }, { "type": "eof", diff --git a/test/syntax/baseline/constants.json b/test/syntax/baseline/constants.json index 937c5c35..faf34f8e 100644 --- a/test/syntax/baseline/constants.json +++ b/test/syntax/baseline/constants.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Util", "inheritance": null, + "extAttrs": [], "members": [ { "type": "const", "name": "DEBUG", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -15,7 +17,6 @@ "union": false, "idlType": "boolean" }, - "extAttrs": [], "value": { "type": "boolean", "value": false @@ -24,6 +25,7 @@ { "type": "const", "name": "negative", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -32,7 +34,6 @@ "union": false, "idlType": "short" }, - "extAttrs": [], "value": { "type": "number", "value": "-1" @@ -41,6 +42,7 @@ { "type": "const", "name": "LF", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -49,7 +51,6 @@ "union": false, "idlType": "octet" }, - "extAttrs": [], "value": { "type": "number", "value": "10" @@ -58,6 +59,7 @@ { "type": "const", "name": "BIT_MASK", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -66,7 +68,6 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "value": { "type": "number", "value": "0x0000fc00" @@ -75,6 +76,7 @@ { "type": "const", "name": "AVOGADRO", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -83,7 +85,6 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "value": { "type": "number", "value": "6.022e23" @@ -92,6 +93,7 @@ { "type": "const", "name": "sobig", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -100,7 +102,6 @@ "union": false, "idlType": "unrestricted float" }, - "extAttrs": [], "value": { "type": "Infinity", "negative": false @@ -109,6 +110,7 @@ { "type": "const", "name": "minusonedividedbyzero", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -117,7 +119,6 @@ "union": false, "idlType": "unrestricted double" }, - "extAttrs": [], "value": { "type": "Infinity", "negative": true @@ -126,6 +127,7 @@ { "type": "const", "name": "notanumber", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -134,7 +136,6 @@ "union": false, "idlType": "short" }, - "extAttrs": [], "value": { "type": "NaN" } @@ -142,6 +143,7 @@ { "type": "const", "name": "const", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -150,14 +152,12 @@ "union": false, "idlType": "boolean" }, - "extAttrs": [], "value": { "type": "boolean", "value": true } } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/constructor.json b/test/syntax/baseline/constructor.json index e18fecc2..ca180dde 100644 --- a/test/syntax/baseline/constructor.json +++ b/test/syntax/baseline/constructor.json @@ -3,14 +3,16 @@ "type": "interface", "name": "Circle", "inheritance": null, + "extAttrs": [], "members": [ { "type": "constructor", - "arguments": [], - "extAttrs": [] + "extAttrs": [], + "arguments": [] }, { "type": "constructor", + "extAttrs": [], "arguments": [ { "type": "argument", @@ -28,11 +30,11 @@ "optional": false, "variadic": false } - ], - "extAttrs": [] + ] }, { "type": "constructor", + "extAttrs": [], "arguments": [ { "type": "argument", @@ -48,16 +50,25 @@ }, "default": { "type": "string", + "expression": [ + { + "type": "string", + "value": "\"\"", + "trivia": " ", + "line": 5, + "index": 19 + } + ], "value": "" }, "optional": true, "variadic": false } - ], - "extAttrs": [] + ] }, { "type": "constructor", + "extAttrs": [], "arguments": [ { "type": "argument", @@ -84,11 +95,11 @@ "optional": false, "variadic": false } - ], - "extAttrs": [] + ] }, { "type": "constructor", + "extAttrs": [], "arguments": [ { "type": "argument", @@ -123,12 +134,12 @@ "optional": false, "variadic": false } - ], - "extAttrs": [] + ] }, { "type": "attribute", "name": "r", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -137,13 +148,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "cx", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -152,13 +163,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "cy", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -167,13 +178,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "circumference", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -182,12 +193,10 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/default.json b/test/syntax/baseline/default.json index 896056a5..580de0a6 100644 --- a/test/syntax/baseline/default.json +++ b/test/syntax/baseline/default.json @@ -3,6 +3,7 @@ "type": "dictionary", "name": "LookupOptions", "inheritance": null, + "extAttrs": [], "members": [ { "type": "field", @@ -18,22 +19,42 @@ }, "default": { "type": "boolean", + "expression": [ + { + "type": "inline", + "value": "false", + "trivia": " ", + "line": 5, + "index": 6 + } + ], "value": false }, "required": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "AddressBook", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "operation", "name": "hasAddressForName", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -72,27 +93,31 @@ "idlType": "LookupOptions" }, "default": { - "type": "dictionary" + "type": "dictionary", + "expression": [ + { + "type": "inline", + "value": "{", + "trivia": " ", + "line": 10, + "index": 28 + }, + { + "type": "inline", + "value": "}", + "trivia": "", + "line": 10, + "index": 29 + } + ] }, "optional": true, "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/dictionary-inherits.json b/test/syntax/baseline/dictionary-inherits.json index 8973a240..a19ae029 100644 --- a/test/syntax/baseline/dictionary-inherits.json +++ b/test/syntax/baseline/dictionary-inherits.json @@ -3,6 +3,7 @@ "type": "dictionary", "name": "PaintOptions", "inheritance": null, + "extAttrs": [], "members": [ { "type": "field", @@ -18,6 +19,15 @@ }, "default": { "type": "string", + "expression": [ + { + "type": "string", + "value": "\"black\"", + "trivia": " ", + "line": 2, + "index": 7 + } + ], "value": "black" }, "required": false @@ -35,7 +45,16 @@ "idlType": "DOMString" }, "default": { - "type": "null" + "type": "null", + "expression": [ + { + "type": "inline", + "value": "null", + "trivia": " ", + "line": 3, + "index": 13 + } + ] }, "required": false }, @@ -55,13 +74,13 @@ "required": false } ], - "extAttrs": [], "partial": false }, { "type": "dictionary", "name": "WetPaintOptions", "inheritance": "PaintOptions", + "extAttrs": [], "members": [ { "type": "field", @@ -79,7 +98,6 @@ "required": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/dictionary.json b/test/syntax/baseline/dictionary.json index 94e6c994..bd36a60b 100644 --- a/test/syntax/baseline/dictionary.json +++ b/test/syntax/baseline/dictionary.json @@ -3,6 +3,7 @@ "type": "dictionary", "name": "PaintOptions", "inheritance": null, + "extAttrs": [], "members": [ { "type": "field", @@ -18,6 +19,15 @@ }, "default": { "type": "string", + "expression": [ + { + "type": "string", + "value": "\"black\"", + "trivia": " ", + "line": 3, + "index": 7 + } + ], "value": "black" }, "required": false @@ -35,7 +45,16 @@ "idlType": "DOMString" }, "default": { - "type": "null" + "type": "null", + "expression": [ + { + "type": "inline", + "value": "null", + "trivia": " ", + "line": 4, + "index": 13 + } + ] }, "required": false }, @@ -77,6 +96,22 @@ }, "default": { "type": "sequence", + "expression": [ + { + "type": "inline", + "value": "[", + "trivia": " ", + "line": 7, + "index": 24 + }, + { + "type": "inline", + "value": "]", + "trivia": "", + "line": 7, + "index": 25 + } + ], "value": [] }, "required": false @@ -109,18 +144,34 @@ "idlType": "Dictionary" }, "default": { - "type": "dictionary" + "type": "dictionary", + "expression": [ + { + "type": "inline", + "value": "{", + "trivia": " ", + "line": 10, + "index": 34 + }, + { + "type": "inline", + "value": "}", + "trivia": "", + "line": 10, + "index": 35 + } + ] }, "required": false } ], - "extAttrs": [], "partial": false }, { "type": "dictionary", "name": "A", "inheritance": null, + "extAttrs": [], "members": [ { "type": "field", @@ -153,7 +204,6 @@ "required": false } ], - "extAttrs": [], "partial": true }, { diff --git a/test/syntax/baseline/documentation-dos.json b/test/syntax/baseline/documentation-dos.json index 70670029..55783d38 100644 --- a/test/syntax/baseline/documentation-dos.json +++ b/test/syntax/baseline/documentation-dos.json @@ -3,8 +3,8 @@ "type": "interface", "name": "Documentation", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { diff --git a/test/syntax/baseline/documentation.json b/test/syntax/baseline/documentation.json index 70670029..55783d38 100644 --- a/test/syntax/baseline/documentation.json +++ b/test/syntax/baseline/documentation.json @@ -3,8 +3,8 @@ "type": "interface", "name": "Documentation", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { diff --git a/test/syntax/baseline/enum.json b/test/syntax/baseline/enum.json index 8d1fae28..fef97847 100644 --- a/test/syntax/baseline/enum.json +++ b/test/syntax/baseline/enum.json @@ -2,6 +2,7 @@ { "type": "enum", "name": "MealType", + "extAttrs": [], "values": [ { "type": "enum-value", @@ -15,17 +16,18 @@ "type": "enum-value", "value": "other" } - ], - "extAttrs": [] + ] }, { "type": "interface", "name": "Meal", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "type", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -34,13 +36,13 @@ "union": false, "idlType": "MealType" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "size", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -49,13 +51,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "operation", "name": "initialize", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -98,16 +100,15 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { "type": "enum", "name": "AltMealType", + "extAttrs": [], "values": [ { "type": "enum-value", @@ -121,8 +122,7 @@ "type": "enum-value", "value": "other" } - ], - "extAttrs": [] + ] }, { "type": "eof", diff --git a/test/syntax/baseline/equivalent-decl.json b/test/syntax/baseline/equivalent-decl.json index 6dfb8239..3db8a19b 100644 --- a/test/syntax/baseline/equivalent-decl.json +++ b/test/syntax/baseline/equivalent-decl.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Dictionary", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "propertyCount", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "getProperty", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -48,12 +50,12 @@ "variadic": false } ], - "extAttrs": [], "special": "getter" }, { "type": "operation", "name": "setProperty", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -96,21 +98,21 @@ "variadic": false } ], - "extAttrs": [], "special": "setter" } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "Dictionary2", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "propertyCount", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -119,13 +121,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "getProperty", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -152,12 +154,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "setProperty", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -200,12 +202,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -232,12 +234,12 @@ "variadic": false } ], - "extAttrs": [], "special": "getter" }, { "type": "operation", "name": "", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -280,11 +282,9 @@ "variadic": false } ], - "extAttrs": [], "special": "setter" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/escaped-name.json b/test/syntax/baseline/escaped-name.json index e44c4af3..ff1f883a 100644 --- a/test/syntax/baseline/escaped-name.json +++ b/test/syntax/baseline/escaped-name.json @@ -3,8 +3,8 @@ "type": "interface", "name": "Iroha", "inheritance": "Magic", - "members": [], "extAttrs": [], + "members": [], "partial": false }, { diff --git a/test/syntax/baseline/escaped-type.json b/test/syntax/baseline/escaped-type.json index f65bc433..83c36e3d 100644 --- a/test/syntax/baseline/escaped-type.json +++ b/test/syntax/baseline/escaped-type.json @@ -2,6 +2,7 @@ { "type": "typedef", "name": "EscapedType", + "extAttrs": [], "idlType": { "type": "typedef-type", "extAttrs": [], @@ -9,12 +10,12 @@ "nullable": false, "union": false, "idlType": "Type" - }, - "extAttrs": [] + } }, { "type": "typedef", "name": "EscapedSequence", + "extAttrs": [], "idlType": { "type": "typedef-type", "extAttrs": [], @@ -31,8 +32,7 @@ "idlType": "Type" } ] - }, - "extAttrs": [] + } }, { "type": "eof", diff --git a/test/syntax/baseline/exposed-asterisk.json b/test/syntax/baseline/exposed-asterisk.json index 8e5608fe..7e12c1d1 100644 --- a/test/syntax/baseline/exposed-asterisk.json +++ b/test/syntax/baseline/exposed-asterisk.json @@ -3,7 +3,6 @@ "type": "interface", "name": "X", "inheritance": null, - "members": [], "extAttrs": [ { "type": "extended-attribute", @@ -15,6 +14,7 @@ "arguments": [] } ], + "members": [], "partial": false }, { diff --git a/test/syntax/baseline/extended-attributes.json b/test/syntax/baseline/extended-attributes.json index b7a74f7f..2ee45865 100644 --- a/test/syntax/baseline/extended-attributes.json +++ b/test/syntax/baseline/extended-attributes.json @@ -3,7 +3,6 @@ "type": "interface", "name": "ServiceWorkerGlobalScope", "inheritance": "WorkerGlobalScope", - "members": [], "extAttrs": [ { "type": "extended-attribute", @@ -31,13 +30,13 @@ "arguments": [] } ], + "members": [], "partial": false }, { "type": "interface", "name": "IdInterface", "inheritance": null, - "members": [], "extAttrs": [ { "type": "extended-attribute", @@ -105,16 +104,49 @@ "arguments": [] } ], + "members": [], "partial": false }, { "type": "interface", "name": "Circle", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Constructor", + "rhs": null, + "arguments": [] + }, + { + "type": "extended-attribute", + "name": "Constructor", + "rhs": null, + "arguments": [ + { + "type": "argument", + "name": "radius", + "extAttrs": [], + "idlType": { + "type": "argument-type", + "extAttrs": [], + "generic": "", + "nullable": false, + "union": false, + "idlType": "double" + }, + "default": null, + "optional": false, + "variadic": false + } + ] + } + ], "members": [ { "type": "attribute", "name": "r", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -123,13 +155,13 @@ "union": false, "idlType": "double" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "cx", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -138,13 +170,13 @@ "union": false, "idlType": "double" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "cy", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -153,13 +185,13 @@ "union": false, "idlType": "double" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "circumference", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -168,52 +200,32 @@ "union": false, "idlType": "double" }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Constructor", - "rhs": null, - "arguments": [] - }, - { - "type": "extended-attribute", - "name": "Constructor", - "rhs": null, - "arguments": [ - { - "type": "argument", - "name": "radius", - "extAttrs": [], - "idlType": { - "type": "argument-type", - "extAttrs": [], - "generic": "", - "nullable": false, - "union": false, - "idlType": "double" - }, - "default": null, - "optional": false, - "variadic": false - } - ] - } - ], "partial": false }, { "type": "interface", "name": "I", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "attribute", "name": "attrib", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [ @@ -246,22 +258,10 @@ } ] }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/generic.json b/test/syntax/baseline/generic.json index 3f28bdf4..7a447c54 100644 --- a/test/syntax/baseline/generic.json +++ b/test/syntax/baseline/generic.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "bar", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -43,12 +45,12 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "attribute", "name": "baz", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -66,13 +68,13 @@ } ] }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "attribute", "name": "frozen", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -90,13 +92,13 @@ } ] }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "attribute", "name": "observable", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -114,22 +116,22 @@ } ] }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "ServiceWorkerClients", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "getServiced", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -148,12 +150,12 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "reloadAll", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -172,21 +174,21 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "FetchEvent", "inheritance": "Event", + "extAttrs": [], "members": [ { "type": "operation", "name": "default", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -205,11 +207,9 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/getter-setter.json b/test/syntax/baseline/getter-setter.json index dfb1d20d..3849111d 100644 --- a/test/syntax/baseline/getter-setter.json +++ b/test/syntax/baseline/getter-setter.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Dictionary", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "propertyCount", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -48,12 +50,12 @@ "variadic": false } ], - "extAttrs": [], "special": "getter" }, { "type": "operation", "name": "", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -96,11 +98,9 @@ "variadic": false } ], - "extAttrs": [], "special": "setter" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/identifier-hyphen.json b/test/syntax/baseline/identifier-hyphen.json index f54b3b9d..5666e845 100644 --- a/test/syntax/baseline/identifier-hyphen.json +++ b/test/syntax/baseline/identifier-hyphen.json @@ -3,10 +3,19 @@ "type": "interface", "name": "CSSStyleDeclaration", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "-will-change", + "extAttrs": [ + { + "type": "extended-attribute", + "name": "CEReactions", + "rhs": null, + "arguments": [] + } + ], "idlType": { "type": "attribute-type", "extAttrs": [ @@ -25,19 +34,10 @@ "union": false, "idlType": "CSSOMString" }, - "extAttrs": [ - { - "type": "extended-attribute", - "name": "CEReactions", - "rhs": null, - "arguments": [] - } - ], "special": "", "readonly": false } ], - "extAttrs": [], "partial": true }, { diff --git a/test/syntax/baseline/identifier-qualified-names.json b/test/syntax/baseline/identifier-qualified-names.json index e5a2e0a0..bf10b4fb 100644 --- a/test/syntax/baseline/identifier-qualified-names.json +++ b/test/syntax/baseline/identifier-qualified-names.json @@ -2,6 +2,7 @@ { "type": "typedef", "name": "number", + "extAttrs": [], "idlType": { "type": "typedef-type", "extAttrs": [], @@ -9,17 +10,18 @@ "nullable": false, "union": false, "idlType": "float" - }, - "extAttrs": [] + } }, { "type": "interface", "name": "System", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "createObject", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -46,12 +48,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -78,21 +80,21 @@ "variadic": false } ], - "extAttrs": [], "special": "getter" } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "TextField", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "const", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -101,13 +103,13 @@ "union": false, "idlType": "boolean" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "value", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -116,22 +118,22 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "FooEventTarget", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "addEventListener", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -158,11 +160,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/includes-name.json b/test/syntax/baseline/includes-name.json index b9c341fb..507724fb 100644 --- a/test/syntax/baseline/includes-name.json +++ b/test/syntax/baseline/includes-name.json @@ -3,10 +3,22 @@ "type": "interface", "name": "Includes", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "operation", "name": "includes", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -16,21 +28,9 @@ "idlType": "undefined" }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/indexed-properties.json b/test/syntax/baseline/indexed-properties.json index f6f25cf4..d1d7138c 100644 --- a/test/syntax/baseline/indexed-properties.json +++ b/test/syntax/baseline/indexed-properties.json @@ -3,10 +3,12 @@ "type": "interface", "name": "OrderedMap", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "size", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "getByIndex", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -48,12 +50,12 @@ "variadic": false } ], - "extAttrs": [], "special": "getter" }, { "type": "operation", "name": "setByIndex", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -96,12 +98,12 @@ "variadic": false } ], - "extAttrs": [], "special": "setter" }, { "type": "operation", "name": "removeByIndex", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -128,12 +130,12 @@ "variadic": false } ], - "extAttrs": [], "special": "deleter" }, { "type": "operation", "name": "get", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -160,12 +162,12 @@ "variadic": false } ], - "extAttrs": [], "special": "getter" }, { "type": "operation", "name": "set", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -208,12 +210,12 @@ "variadic": false } ], - "extAttrs": [], "special": "setter" }, { "type": "operation", "name": "remove", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -240,11 +242,9 @@ "variadic": false } ], - "extAttrs": [], "special": "deleter" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/inherits-getter.json b/test/syntax/baseline/inherits-getter.json index 4b92e529..48e8414f 100644 --- a/test/syntax/baseline/inherits-getter.json +++ b/test/syntax/baseline/inherits-getter.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Animal", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "name", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,22 +17,22 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "Person", "inheritance": "Animal", + "extAttrs": [], "members": [ { "type": "attribute", "name": "age", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -39,13 +41,13 @@ "union": false, "idlType": "unsigned short" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "attribute", "name": "name", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -54,12 +56,10 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "inherit", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/interface-inherits.json b/test/syntax/baseline/interface-inherits.json index 7c48000e..3e6b8366 100644 --- a/test/syntax/baseline/interface-inherits.json +++ b/test/syntax/baseline/interface-inherits.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Animal", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "name", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,22 +17,22 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "Human", "inheritance": "Animal", + "extAttrs": [], "members": [ { "type": "attribute", "name": "pet", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -39,22 +41,22 @@ "union": false, "idlType": "Dog" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "Dog", "inheritance": "Animal", + "extAttrs": [], "members": [ { "type": "attribute", "name": "owner", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -63,12 +65,10 @@ "union": false, "idlType": "Human" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/iterable.json b/test/syntax/baseline/iterable.json index 429adfea..b1372c4c 100644 --- a/test/syntax/baseline/iterable.json +++ b/test/syntax/baseline/iterable.json @@ -3,9 +3,11 @@ "type": "interface", "name": "IterableOne", "inheritance": null, + "extAttrs": [], "members": [ { "type": "iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -17,21 +19,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "IterableTwo", "inheritance": null, + "extAttrs": [], "members": [ { "type": "iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -51,21 +53,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "IterableThree", "inheritance": null, + "extAttrs": [], "members": [ { "type": "iterable", + "extAttrs": [], "idlType": [ { "type": null, @@ -84,12 +86,10 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/maplike.json b/test/syntax/baseline/maplike.json index 995ca8b3..7b6b6914 100644 --- a/test/syntax/baseline/maplike.json +++ b/test/syntax/baseline/maplike.json @@ -3,9 +3,11 @@ "type": "interface", "name": "MapLike", "inheritance": null, + "extAttrs": [], "members": [ { "type": "maplike", + "extAttrs": [], "idlType": [ { "type": null, @@ -25,21 +27,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "ReadOnlyMapLike", "inheritance": null, + "extAttrs": [], "members": [ { "type": "maplike", + "extAttrs": [], "idlType": [ { "type": null, @@ -59,21 +61,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": true, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "I", "inheritance": null, + "extAttrs": [], "members": [ { "type": "maplike", + "extAttrs": [], "idlType": [ { "type": null, @@ -107,12 +109,10 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/mixin.json b/test/syntax/baseline/mixin.json index 9ab5ffe1..24fc349e 100644 --- a/test/syntax/baseline/mixin.json +++ b/test/syntax/baseline/mixin.json @@ -3,10 +3,12 @@ "type": "interface mixin", "name": "GlobalCrypto", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "crypto", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,12 +17,10 @@ "union": false, "idlType": "Crypto" }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [], "partial": false }, { @@ -39,10 +39,12 @@ "type": "interface mixin", "name": "WindowOrWorkerGlobalScope", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "crypto", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -51,20 +53,18 @@ "union": false, "idlType": "Crypto" }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [], "partial": true }, { "type": "interface mixin", "name": "LocalCrypto", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { diff --git a/test/syntax/baseline/namedconstructor.json b/test/syntax/baseline/namedconstructor.json index 0f52c1db..ab23fe15 100644 --- a/test/syntax/baseline/namedconstructor.json +++ b/test/syntax/baseline/namedconstructor.json @@ -3,7 +3,6 @@ "type": "interface", "name": "HTMLAudioElement", "inheritance": "HTMLMediaElement", - "members": [], "extAttrs": [ { "type": "extended-attribute", @@ -41,6 +40,7 @@ ] } ], + "members": [], "partial": false }, { diff --git a/test/syntax/baseline/namespace.json b/test/syntax/baseline/namespace.json index 6a586d24..8d5e3d54 100644 --- a/test/syntax/baseline/namespace.json +++ b/test/syntax/baseline/namespace.json @@ -3,10 +3,12 @@ "type": "namespace", "name": "VectorUtils", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "unit", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "Vector" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "dotProduct", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -64,12 +66,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "crossProduct", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -112,12 +114,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "const", "name": "CONST", + "extAttrs": [], "idlType": { "type": "const-type", "extAttrs": [], @@ -126,30 +128,28 @@ "union": false, "idlType": "short" }, - "extAttrs": [], "value": { "type": "number", "value": "3" } } ], - "extAttrs": [], "partial": false }, { "type": "namespace", "name": "SomeNamespace", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": true }, { "type": "namespace", "name": "ScalarUtils", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { diff --git a/test/syntax/baseline/nointerfaceobject.json b/test/syntax/baseline/nointerfaceobject.json index c6414638..c4eea454 100644 --- a/test/syntax/baseline/nointerfaceobject.json +++ b/test/syntax/baseline/nointerfaceobject.json @@ -3,10 +3,19 @@ "type": "interface", "name": "Query", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "NoInterfaceObject", + "rhs": null, + "arguments": [] + } + ], "members": [ { "type": "operation", "name": "lookupEntry", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -33,18 +42,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "NoInterfaceObject", - "rhs": null, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/nullable.json b/test/syntax/baseline/nullable.json index dcd94e1c..15256625 100644 --- a/test/syntax/baseline/nullable.json +++ b/test/syntax/baseline/nullable.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Node", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "namespaceURI", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,12 +17,10 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/nullableobjects.json b/test/syntax/baseline/nullableobjects.json index c6f404ab..4b0a2ff3 100644 --- a/test/syntax/baseline/nullableobjects.json +++ b/test/syntax/baseline/nullableobjects.json @@ -3,26 +3,28 @@ "type": "interface", "name": "A", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { "type": "interface", "name": "B", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { "type": "interface", "name": "C", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -49,12 +51,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -81,11 +83,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/obsolete-keywords.json b/test/syntax/baseline/obsolete-keywords.json index 0e033602..7ee34fcb 100644 --- a/test/syntax/baseline/obsolete-keywords.json +++ b/test/syntax/baseline/obsolete-keywords.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Keywords", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "implements", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -16,12 +18,12 @@ "idlType": "undefined" }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "legacyiterable", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -31,11 +33,9 @@ "idlType": "undefined" }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/operation-optional-arg.json b/test/syntax/baseline/operation-optional-arg.json index 5a9e3aa0..15c17201 100644 --- a/test/syntax/baseline/operation-optional-arg.json +++ b/test/syntax/baseline/operation-optional-arg.json @@ -3,10 +3,12 @@ "type": "interface", "name": "ColorCreator", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "createColor", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -78,17 +80,24 @@ }, "default": { "type": "number", + "expression": [ + { + "type": "decimal", + "value": "3.5", + "trivia": " ", + "line": 3, + "index": 19 + } + ], "value": "3.5" }, "optional": true, "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/overloading.json b/test/syntax/baseline/overloading.json index e8748556..84f4aef3 100644 --- a/test/syntax/baseline/overloading.json +++ b/test/syntax/baseline/overloading.json @@ -3,26 +3,28 @@ "type": "interface", "name": "A", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { "type": "interface", "name": "B", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { "type": "interface", "name": "C", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -49,12 +51,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -81,21 +83,21 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "D", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -122,12 +124,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -193,12 +195,12 @@ "variadic": true } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -208,12 +210,12 @@ "idlType": "undefined" }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "f", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -288,11 +290,9 @@ "variadic": true } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/overridebuiltins.json b/test/syntax/baseline/overridebuiltins.json index 8910a091..33257ec9 100644 --- a/test/syntax/baseline/overridebuiltins.json +++ b/test/syntax/baseline/overridebuiltins.json @@ -3,10 +3,19 @@ "type": "interface", "name": "StringMap2", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "OverrideBuiltins", + "rhs": null, + "arguments": [] + } + ], "members": [ { "type": "attribute", "name": "length", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +24,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "lookup", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -48,18 +57,9 @@ "variadic": false } ], - "extAttrs": [], "special": "getter" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "OverrideBuiltins", - "rhs": null, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/partial-interface.json b/test/syntax/baseline/partial-interface.json index af8a701b..32377f3b 100644 --- a/test/syntax/baseline/partial-interface.json +++ b/test/syntax/baseline/partial-interface.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "bar", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,22 +17,22 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "quux", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -39,12 +41,10 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": true }, { diff --git a/test/syntax/baseline/primitives.json b/test/syntax/baseline/primitives.json index a61b4ac7..77a866dc 100644 --- a/test/syntax/baseline/primitives.json +++ b/test/syntax/baseline/primitives.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Primitives", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "truth", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "boolean" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "character", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,13 +32,13 @@ "union": false, "idlType": "byte" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "value", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -45,13 +47,13 @@ "union": false, "idlType": "octet" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "number", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -60,13 +62,13 @@ "union": false, "idlType": "short" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "positive", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -75,13 +77,13 @@ "union": false, "idlType": "unsigned short" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "big", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -90,13 +92,13 @@ "union": false, "idlType": "long" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "bigpositive", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -105,13 +107,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "bigbig", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -120,13 +122,13 @@ "union": false, "idlType": "long long" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "bigbigpositive", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -135,13 +137,13 @@ "union": false, "idlType": "unsigned long long" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "real", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -150,13 +152,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "bigreal", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -165,13 +167,13 @@ "union": false, "idlType": "double" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "realwithinfinity", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -180,13 +182,13 @@ "union": false, "idlType": "unrestricted float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "bigrealwithinfinity", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -195,13 +197,13 @@ "union": false, "idlType": "unrestricted double" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "string", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -210,13 +212,13 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "bytes", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -225,13 +227,13 @@ "union": false, "idlType": "ByteString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "date", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -240,13 +242,13 @@ "union": false, "idlType": "Date" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "regexp", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -255,12 +257,10 @@ "union": false, "idlType": "RegExp" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/promise-void.json b/test/syntax/baseline/promise-void.json index 075b9c92..4df42b45 100644 --- a/test/syntax/baseline/promise-void.json +++ b/test/syntax/baseline/promise-void.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Cat", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "meow", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -24,12 +26,10 @@ } ] }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/prototyperoot.json b/test/syntax/baseline/prototyperoot.json index 0967b13c..08ec4430 100644 --- a/test/syntax/baseline/prototyperoot.json +++ b/test/syntax/baseline/prototyperoot.json @@ -3,10 +3,19 @@ "type": "interface", "name": "Node", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "PrototypeRoot", + "rhs": null, + "arguments": [] + } + ], "members": [ { "type": "attribute", "name": "nodeType", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,19 +24,10 @@ "union": false, "idlType": "unsigned short" }, - "extAttrs": [], "special": "", "readonly": true } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "PrototypeRoot", - "rhs": null, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/putforwards.json b/test/syntax/baseline/putforwards.json index a40e3997..376ab6ba 100644 --- a/test/syntax/baseline/putforwards.json +++ b/test/syntax/baseline/putforwards.json @@ -3,18 +3,11 @@ "type": "interface", "name": "Person", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "name", - "idlType": { - "type": "attribute-type", - "extAttrs": [], - "generic": "", - "nullable": false, - "union": false, - "idlType": "Name" - }, "extAttrs": [ { "type": "extended-attribute", @@ -26,12 +19,21 @@ "arguments": [] } ], + "idlType": { + "type": "attribute-type", + "extAttrs": [], + "generic": "", + "nullable": false, + "union": false, + "idlType": "Name" + }, "special": "", "readonly": true }, { "type": "attribute", "name": "age", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -40,12 +42,10 @@ "union": false, "idlType": "unsigned short" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/record.json b/test/syntax/baseline/record.json index 061d30ce..2cf5ace6 100644 --- a/test/syntax/baseline/record.json +++ b/test/syntax/baseline/record.json @@ -3,10 +3,53 @@ "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Constructor", + "rhs": null, + "arguments": [ + { + "type": "argument", + "name": "init", + "extAttrs": [], + "idlType": { + "type": "argument-type", + "extAttrs": [], + "generic": "record", + "nullable": false, + "union": false, + "idlType": [ + { + "type": "argument-type", + "extAttrs": [], + "generic": "", + "nullable": false, + "union": false, + "idlType": "USVString" + }, + { + "type": "argument-type", + "extAttrs": [], + "generic": "", + "nullable": false, + "union": false, + "idlType": "USVString" + } + ] + }, + "default": null, + "optional": false, + "variadic": false + } + ] + } + ], "members": [ { "type": "operation", "name": "foo", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -59,12 +102,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "bar", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -108,62 +151,21 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Constructor", - "rhs": null, - "arguments": [ - { - "type": "argument", - "name": "init", - "extAttrs": [], - "idlType": { - "type": "argument-type", - "extAttrs": [], - "generic": "record", - "nullable": false, - "union": false, - "idlType": [ - { - "type": "argument-type", - "extAttrs": [], - "generic": "", - "nullable": false, - "union": false, - "idlType": "USVString" - }, - { - "type": "argument-type", - "extAttrs": [], - "generic": "", - "nullable": false, - "union": false, - "idlType": "USVString" - } - ] - }, - "default": null, - "optional": false, - "variadic": false - } - ] - } - ], "partial": false }, { "type": "interface", "name": "Bar", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "bar", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -197,11 +199,9 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/reflector-interface.json b/test/syntax/baseline/reflector-interface.json index 7f7544d9..f1765dca 100644 --- a/test/syntax/baseline/reflector-interface.json +++ b/test/syntax/baseline/reflector-interface.json @@ -3,18 +3,11 @@ "type": "interface mixin", "name": "Reflector", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "toggle", - "idlType": { - "type": "attribute-type", - "extAttrs": [], - "generic": "", - "nullable": false, - "union": false, - "idlType": "DOMString" - }, "extAttrs": [ { "type": "extended-attribute", @@ -32,12 +25,6 @@ "arguments": [] } ], - "special": "", - "readonly": false - }, - { - "type": "attribute", - "name": "quarter", "idlType": { "type": "attribute-type", "extAttrs": [], @@ -46,6 +33,12 @@ "union": false, "idlType": "DOMString" }, + "special": "", + "readonly": false + }, + { + "type": "attribute", + "name": "quarter", "extAttrs": [ { "type": "extended-attribute", @@ -73,20 +66,20 @@ "arguments": [] } ], - "special": "", - "readonly": false - }, - { - "type": "attribute", - "name": "span", "idlType": { "type": "attribute-type", "extAttrs": [], "generic": "", "nullable": false, "union": false, - "idlType": "unsigned long" + "idlType": "DOMString" }, + "special": "", + "readonly": false + }, + { + "type": "attribute", + "name": "span", "extAttrs": [ { "type": "extended-attribute", @@ -111,11 +104,18 @@ "arguments": [] } ], + "idlType": { + "type": "attribute-type", + "extAttrs": [], + "generic": "", + "nullable": false, + "union": false, + "idlType": "unsigned long" + }, "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/reg-operations.json b/test/syntax/baseline/reg-operations.json index 4439d995..d381660f 100644 --- a/test/syntax/baseline/reg-operations.json +++ b/test/syntax/baseline/reg-operations.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Dimensions", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "width", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "height", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,22 +32,22 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "Button", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "isMouseOver", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -55,12 +57,12 @@ "idlType": "boolean" }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "setDimensions", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -87,12 +89,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "setDimensions", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -135,11 +137,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/replaceable.json b/test/syntax/baseline/replaceable.json index e35edb87..6357cd3c 100644 --- a/test/syntax/baseline/replaceable.json +++ b/test/syntax/baseline/replaceable.json @@ -3,18 +3,11 @@ "type": "interface", "name": "Counter", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "value", - "idlType": { - "type": "attribute-type", - "extAttrs": [], - "generic": "", - "nullable": false, - "union": false, - "idlType": "unsigned long" - }, "extAttrs": [ { "type": "extended-attribute", @@ -23,12 +16,21 @@ "arguments": [] } ], + "idlType": { + "type": "attribute-type", + "extAttrs": [], + "generic": "", + "nullable": false, + "union": false, + "idlType": "unsigned long" + }, "special": "", "readonly": true }, { "type": "operation", "name": "increment", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -38,11 +40,9 @@ "idlType": "undefined" }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/sequence.json b/test/syntax/baseline/sequence.json index be1185ea..3c1e0c3c 100644 --- a/test/syntax/baseline/sequence.json +++ b/test/syntax/baseline/sequence.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Canvas", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "drawPolygon", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -42,12 +44,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "getInflectionPoints", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -66,21 +68,21 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "I", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "f1", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -123,11 +125,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/setlike.json b/test/syntax/baseline/setlike.json index 9388573d..a64bdb27 100644 --- a/test/syntax/baseline/setlike.json +++ b/test/syntax/baseline/setlike.json @@ -3,9 +3,11 @@ "type": "interface", "name": "SetLike", "inheritance": null, + "extAttrs": [], "members": [ { "type": "setlike", + "extAttrs": [], "idlType": [ { "type": null, @@ -17,21 +19,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "ReadOnlySetLike", "inheritance": null, + "extAttrs": [], "members": [ { "type": "setlike", + "extAttrs": [], "idlType": [ { "type": null, @@ -43,21 +45,21 @@ } ], "arguments": [], - "extAttrs": [], "readonly": true, "async": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "SetLikeExt", "inheritance": null, + "extAttrs": [], "members": [ { "type": "setlike", + "extAttrs": [], "idlType": [ { "type": null, @@ -76,12 +78,10 @@ } ], "arguments": [], - "extAttrs": [], "readonly": false, "async": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/sharedarraybuffer.json b/test/syntax/baseline/sharedarraybuffer.json index 1bd00f5b..d6342d6a 100644 --- a/test/syntax/baseline/sharedarraybuffer.json +++ b/test/syntax/baseline/sharedarraybuffer.json @@ -3,10 +3,22 @@ "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "operation", "name": "foo", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -33,12 +45,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "foo", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -65,21 +77,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/static.json b/test/syntax/baseline/static.json index f6eef467..d6dd369f 100644 --- a/test/syntax/baseline/static.json +++ b/test/syntax/baseline/static.json @@ -3,18 +3,20 @@ "type": "interface", "name": "Point", "inheritance": null, - "members": [], "extAttrs": [], + "members": [], "partial": false }, { "type": "interface", "name": "Circle", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "cx", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -23,13 +25,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "cy", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -38,13 +40,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "radius", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -53,13 +55,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "triangulationCount", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -68,13 +70,13 @@ "union": false, "idlType": "long" }, - "extAttrs": [], "special": "static", "readonly": true }, { "type": "operation", "name": "triangulate", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -133,11 +135,9 @@ "variadic": false } ], - "extAttrs": [], "special": "static" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/stringifier-attribute.json b/test/syntax/baseline/stringifier-attribute.json index 54c651d1..bd0502cb 100644 --- a/test/syntax/baseline/stringifier-attribute.json +++ b/test/syntax/baseline/stringifier-attribute.json @@ -3,10 +3,19 @@ "type": "interface", "name": "Student", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Constructor", + "rhs": null, + "arguments": [] + } + ], "members": [ { "type": "attribute", "name": "id", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +24,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "name", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,19 +39,10 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "stringifier", "readonly": false } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Constructor", - "rhs": null, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/stringifier-custom.json b/test/syntax/baseline/stringifier-custom.json index 0f0bcc41..71fdd124 100644 --- a/test/syntax/baseline/stringifier-custom.json +++ b/test/syntax/baseline/stringifier-custom.json @@ -3,10 +3,19 @@ "type": "interface", "name": "Student", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Constructor", + "rhs": null, + "arguments": [] + } + ], "members": [ { "type": "attribute", "name": "id", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +24,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "familyName", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,13 +39,13 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "givenName", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -45,13 +54,13 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "operation", "name": "", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -61,18 +70,9 @@ "idlType": "DOMString" }, "arguments": [], - "extAttrs": [], "special": "stringifier" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Constructor", - "rhs": null, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/stringifier.json b/test/syntax/baseline/stringifier.json index ef8b80f3..805550bd 100644 --- a/test/syntax/baseline/stringifier.json +++ b/test/syntax/baseline/stringifier.json @@ -3,10 +3,12 @@ "type": "interface", "name": "A", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -16,27 +18,25 @@ "idlType": "DOMString" }, "arguments": [], - "extAttrs": [], "special": "stringifier" } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "B", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "", - "arguments": [], "extAttrs": [], + "arguments": [], "special": "stringifier" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/treatasnull.json b/test/syntax/baseline/treatasnull.json index 2cce456f..ebf873ab 100644 --- a/test/syntax/baseline/treatasnull.json +++ b/test/syntax/baseline/treatasnull.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Dog", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "name", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "owner", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,13 +32,13 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "operation", "name": "isMemberOfBreed", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -73,11 +75,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/treatasundefined.json b/test/syntax/baseline/treatasundefined.json index 47ccc6b7..de4abded 100644 --- a/test/syntax/baseline/treatasundefined.json +++ b/test/syntax/baseline/treatasundefined.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Cat", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "name", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "owner", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,13 +32,13 @@ "union": false, "idlType": "DOMString" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "operation", "name": "isMemberOfBreed", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -73,11 +75,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/typedef-union.json b/test/syntax/baseline/typedef-union.json index f5432a59..e7506b73 100644 --- a/test/syntax/baseline/typedef-union.json +++ b/test/syntax/baseline/typedef-union.json @@ -2,6 +2,7 @@ { "type": "typedef", "name": "TexImageSource", + "extAttrs": [], "idlType": { "type": "typedef-type", "extAttrs": [], @@ -42,8 +43,7 @@ "idlType": "HTMLVideoElement" } ] - }, - "extAttrs": [] + } }, { "type": "eof", diff --git a/test/syntax/baseline/typedef.json b/test/syntax/baseline/typedef.json index a441cb5c..70f5b547 100644 --- a/test/syntax/baseline/typedef.json +++ b/test/syntax/baseline/typedef.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Point", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "x", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "y", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -30,17 +32,16 @@ "union": false, "idlType": "float" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { "type": "typedef", "name": "PointSequence", + "extAttrs": [], "idlType": { "type": "typedef-type", "extAttrs": [], @@ -57,17 +58,18 @@ "idlType": "Point" } ] - }, - "extAttrs": [] + } }, { "type": "interface", "name": "Rect", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "topleft", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -76,13 +78,13 @@ "union": false, "idlType": "Point" }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "bottomright", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -91,22 +93,22 @@ "union": false, "idlType": "Point" }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { "type": "interface", "name": "Widget", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "bounds", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -115,13 +117,13 @@ "union": false, "idlType": "Rect" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "pointWithinBounds", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -148,12 +150,12 @@ "variadic": false } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "allPointsWithinBounds", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -180,16 +182,15 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { "type": "typedef", "name": "value", + "extAttrs": [], "idlType": { "type": "typedef-type", "extAttrs": [ @@ -204,8 +205,7 @@ "nullable": false, "union": false, "idlType": "octet" - }, - "extAttrs": [] + } }, { "type": "eof", diff --git a/test/syntax/baseline/typesuffixes.json b/test/syntax/baseline/typesuffixes.json index 3d8991c2..2c3235d1 100644 --- a/test/syntax/baseline/typesuffixes.json +++ b/test/syntax/baseline/typesuffixes.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Suffixes", "inheritance": null, + "extAttrs": [], "members": [ { "type": "operation", "name": "test", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -42,11 +44,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/undefined.json b/test/syntax/baseline/undefined.json index 1377cbe8..b1d94653 100644 --- a/test/syntax/baseline/undefined.json +++ b/test/syntax/baseline/undefined.json @@ -3,10 +3,22 @@ "type": "interface", "name": "Foo", "inheritance": null, + "extAttrs": [ + { + "type": "extended-attribute", + "name": "Exposed", + "rhs": { + "type": "identifier", + "value": "Window" + }, + "arguments": [] + } + ], "members": [ { "type": "operation", "name": "foo", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -16,12 +28,12 @@ "idlType": "undefined" }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "bar", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -57,12 +69,12 @@ ] }, "arguments": [], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "baz", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -89,21 +101,9 @@ "variadic": false } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [ - { - "type": "extended-attribute", - "name": "Exposed", - "rhs": { - "type": "identifier", - "value": "Window" - }, - "arguments": [] - } - ], "partial": false }, { diff --git a/test/syntax/baseline/uniontype.json b/test/syntax/baseline/uniontype.json index bd78ffff..9749667d 100644 --- a/test/syntax/baseline/uniontype.json +++ b/test/syntax/baseline/uniontype.json @@ -3,10 +3,12 @@ "type": "interface", "name": "Union", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "test", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -74,13 +76,13 @@ } ] }, - "extAttrs": [], "special": "", "readonly": false }, { "type": "attribute", "name": "test2", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -113,12 +115,10 @@ } ] }, - "extAttrs": [], "special": "", "readonly": false } ], - "extAttrs": [], "partial": false }, { diff --git a/test/syntax/baseline/variadic-operations.json b/test/syntax/baseline/variadic-operations.json index 4df78240..e0fedb60 100644 --- a/test/syntax/baseline/variadic-operations.json +++ b/test/syntax/baseline/variadic-operations.json @@ -3,10 +3,12 @@ "type": "interface", "name": "IntegerSet", "inheritance": null, + "extAttrs": [], "members": [ { "type": "attribute", "name": "cardinality", + "extAttrs": [], "idlType": { "type": "attribute-type", "extAttrs": [], @@ -15,13 +17,13 @@ "union": false, "idlType": "unsigned long" }, - "extAttrs": [], "special": "", "readonly": true }, { "type": "operation", "name": "union", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -48,12 +50,12 @@ "variadic": true } ], - "extAttrs": [], "special": "" }, { "type": "operation", "name": "intersection", + "extAttrs": [], "idlType": { "type": "return-type", "extAttrs": [], @@ -80,11 +82,9 @@ "variadic": true } ], - "extAttrs": [], "special": "" } ], - "extAttrs": [], "partial": false }, {