Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

webidl2

w3c14.5kW3C24.4.1TypeScript support: included

A WebIDL Parser

readme

webidl2.js

NPM version Known Vulnerabilities Financial Contributors on Open Collective

Purpose

This is a parser for Web IDL, a language to specify web APIs in interoperable way. This library supports both Node.js and the browser environment.

Try the online checker here.

Installation

Just the usual. For Node:

npm install webidl2

In the browser without module support:

<script src='./webidl2/dist/webidl2.js'></script>

Documentation

WebIDL2 provides two functions: parse and write.

  • parse: Converts a WebIDL string into a syntax tree.
  • write: Converts a syntax tree into a WebIDL string. Useful for programmatic code modification.

In Node, that happens with:

const { parse, write, validate } = require("webidl2");
const tree = parse("string of WebIDL");
const text = write(tree);
const validation = validate(tree);

In the browser:

<script>
  const tree = WebIDL2.parse("string of WebIDL");
  const text = WebIDL2.write(tree);
  const validation = WebIDL2.validate(tree);
</script>

<!-- Or when module is supported -->
<script type="module">
  import { parse, write, validate } from "./webidl2/index.js";
  const tree = parse("string of WebIDL");
  const text = write(tree);
  const validation = validate(tree);
</script>

parse() optionally takes an option bag with the following fields:

  • concrete: Boolean indicating whether the result should include EOF node or not.
  • productions: An array with custom production functions. See Custom productions for more information.
  • sourceName: The source name, typically a filename. Errors and validation objects can indicate their origin if you pass a value.

write() optionally takes a "templates" object, whose properties are functions that process input in different ways (depending on what is needed for output). Every property is optional. Each property is documented below:

var result = WebIDL2.write(tree, {
  templates: {
    /**
     * A function that receives syntax strings plus anything the templates returned.
     * The items are guaranteed to be ordered.
     * The returned value may be again passed to any template functions,
     * or it may also be the final return value of `write()`.
     * @param {any[]} items
     */
    wrap: items => items.join(""),
    /**
     * @param {string} t A trivia string, which includes whitespaces and comments.
     */
    trivia: t => t,
    /**
     * The identifier for a container type. For example, the `Foo` part of `interface Foo {};`.
     * @param {string} escaped The escaped raw name of the definition.
     * @param data The definition with the name
     * @param parent The parent of the definition, undefined if absent
     */
    name: (escaped, { data, parent }) => escaped,
    /**
     * Called for each type referece, e.g. `Window`, `DOMString`, or `unsigned long`.
     * @param escaped The referenced name. Typically string, but may also be the return
     *            value of `wrap()` if the name contains whitespace.
     * @param unescaped Unescaped reference.
     */
    reference: (escaped, unescaped) => escaped,
    /**
     * Called for each generic-form syntax, e.g. `sequence`, `Promise`, or `maplike`.
     * @param {string} name The keyword for syntax
     */
    generic: name => name,
    /**
     * Called for each nameless members, e.g. `stringifier` for `stringifier;` and `constructor` for `constructor();`
     * @param {string} name The keyword for syntax
     */
    nameless: (keyword, { data, parent }) => keyword,
    /**
     * Called only once for each types, e.g. `Document`, `Promise<DOMString>`, or `sequence<long>`.
     * @param type The `wrap()`ed result of references and syntatic bracket strings.
     */
    type: type => type,
    /**
     * Receives the return value of `reference()`. String if it's absent.
     */
    inheritance: inh => inh,
    /**
     * Called for each IDL type definition, e.g. an interface, an operation, or a typedef.
     * @param content The wrapped value of everything the definition contains.
     * @param data The original definition object
     * @param parent The parent of the definition, undefined if absent
     */
    definition: (content, { data, parent }) => content,
    /**
     * Called for each extended attribute annotation.
     * @param content The wrapped value of everything the annotation contains.
     */
    extendedAttribute: content => content,
    /**
     * The `Foo` part of `[Foo=Whatever]`.
     * @param ref The name of the referenced extended attribute name.
     */
    extendedAttributeReference: ref => ref
  }
});

"Wrapped value" here will all be raw strings when the wrap() callback is absent.

validate() receives an AST or an array of AST, and returns semantic errors as an array of objects. Their fields are same as errors have, with one addition:

  • level: "error" or "warning".
const validations = validate(tree);
for (const validation of validations) {
  console.log(validation.message);
}
// Validation error on line X: ...
// Validation error on line Y: ...

The validator function may provide an autofix function that modifies AST. You can optionally call it to skip manual fixes, but make sure you review the result.

const validations = validate(tree);
for (const validation of validations) {
  if (validation.autofix) {
    validation.autofix();
  }
}
write(tree); // magic!

Errors

When there is a syntax error in the WebIDL, it throws an exception object with the following properties:

  • message: the error message with its context. Below is what it looks like.
     Syntax error at line 1 in callback-noparen.webidl, since `callback YourCall`:
     callback YourCall = undefined;
                                  ^ Callback lacks parentheses for arguments
  • bareMessage: the error message without any context description like below.
     Callback lacks parentheses for arguments
  • line: the line at which the error occurred.
  • sourceName: the source name you passed to parse().
  • level: "error" by default, can be "warning" for some validations for e.g. potential future deprecations.
  • ruleName: Only for validations. Currently the followings are supported:
    • attr-invalid-type: Attributes cannot have sequences, records, nor dictionaries.
    • dict-arg-default: Optional dictionary type arguments must have a default value of {}.
    • dict-arg-optional: Dictionary type arguments must be optional if the type does not include a required field.
    • no-nullable-dict-arg: Dictionary arguments cannot be nullable.
    • no-nullable-union-dict: Nullable unions cannot include a dictionary type.
    • constructor-member: Constructors must use newer constructor() syntax.
    • no-duplicate: Types cannot have identical names.
    • require-exposed: Interfaces must explicitly expose themselves to specific contexts by [Exposed].
    • incomplete-op: Regular or static operations must have both a return type and an identifier.
    • no-cross-overload: Overloading must be done within a single interface or namespace.
    • no-constructible-global: Interfaces with [Global] cannot have constructors.
    • renamed-legacy: Legacy extended attributes must use their new names.
    • replace-void: void type is replaced by undefined type.
    • migrate-allowshared: [AllowShared] BufferSource is replaced by AllowSharedBufferSource.
  • input: a short peek at the text at the point where the error happened
  • tokens: the five tokens at the point of error, as understood by the tokeniser (this is the same content as input, but seen from the tokeniser's point of view)

The exception also has a toString() method that hopefully should produce a decent error message.

AST (Abstract Syntax Tree)

The parse() method returns a tree object representing the parse tree of the IDL. Comment and white space are not represented in the AST.

The root of this object is always an array of definitions (where definitions are any of interfaces, dictionaries, callbacks, etc. — anything that can occur at the root of the IDL).

IDL Type

This structure is used in many other places (operation return types, argument types, etc.). It captures a WebIDL type with a number of options. Types look like this and are typically attached to a field called idlType:

{
  "type": "attribute-type",
  "generic": "",
  "idlType": "unsigned short",
  "nullable": false,
  "union": false,
  "extAttrs": [...]
}

Where the fields are as follows:

  • type: String indicating where this type is used. Can be null if not applicable.
  • generic: String indicating the generic type (e.g. "Promise", "sequence").
  • idlType: String indicating the type name, or array of subtypes if the type is generic or a union.
  • nullable: true if the type is nullable.
  • union: Boolean indicating whether this is a union type or not.
  • extAttrs: An array of extended attributes.

Interface

Interfaces look like this:

{
  "type": "interface",
  "name": "Animal",
  "partial": false,
  "members": [...],
  "inheritance": null,
  "extAttrs": [...]
}, {
  "type": "interface",
  "name": "Human",
  "partial": false,
  "members": [...],
  "inheritance": "Animal",
  "extAttrs": [...]
}

The fields are as follows:

  • type: Always "interface".
  • name: The name of the interface.
  • partial: true if the type is a partial interface.
  • members: An array of interface members (attributes, operations, etc.). Empty if there are none.
  • inheritance: The name of an interface this one inherits from, null otherwise.
  • extAttrs: An array of extended attributes.

Interface mixins

Interfaces mixins look like this:

{
  "type": "interface mixin",
  "name": "Animal",
  "inheritance": null,
  "partial": false,
  "members": [...],
  "extAttrs": [...]
}, {
  "type": "interface mixin",
  "name": "Human",
  "inheritance": null,
  "partial": false,
  "members": [...],
  "extAttrs": [...]
}

The fields are as follows:

  • type: Always "interface mixin".
  • name: The name of the interface mixin.
  • inheritance: Always null.
  • partial: `true if the type is a partial interface mixin.
  • members: An array of interface members (attributes, operations, etc.). Empty if there are none.
  • extAttrs: An array of extended attributes.

Namespace

Namespaces look like this:

{
  "type": "namespace",
  "name": "console",
  "inheritance": null,
  "partial": false,
  "members": [...],
  "extAttrs": [...]
}

The fields are as follows:

  • type: Always "namespace".
  • name: The name of the namespace.
  • inheritance: Always null.
  • partial: `true if the type is a partial namespace.
  • members: An array of namespace members (attributes, constants, and operations). Empty if there are none.
  • extAttrs: An array of extended attributes.

Callback Interfaces

These are captured by the same structure as Interfaces except that their type field is "callback interface".

Callback

A callback looks like this:

{
  "type": "callback",
  "name": "AsyncOperationCallback",
  "idlType": {
    "type": "return-type",
    "generic": "",
    "nullable": false,
    "union": false,
    "idlType": "undefined",
    "extAttrs": []
  },
  "arguments": [...],
  "extAttrs": []
}

The fields are as follows:

  • type: Always "callback".
  • name: The name of the callback.
  • idlType: An IDL Type describing what the callback returns.
  • arguments: A list of arguments, as in function paramters.
  • extAttrs: An array of extended attributes.

Dictionary

A dictionary looks like this:

{
  "type": "dictionary",
  "name": "PaintOptions",
  "partial": false,
  "members": [{
    "type": "field",
    "name": "fillPattern",
    "required": false,
    "idlType": {
      "type": "dictionary-type",
      "generic": "",
      "nullable": true
      "union": false,
      "idlType": "DOMString",
      "extAttrs": []
    },
    "extAttrs": [],
    "default": {
      "type": "string",
      "value": "black"
    }
  }],
  "inheritance": null,
  "extAttrs": []
}

The fields are as follows:

  • type: Always "dictionary".
  • name: The dictionary name.
  • partial: true if the type is a partial dictionary.
  • members: An array of members (see below).
  • inheritance: An object indicating which dictionary is being inherited from, null otherwise.
  • extAttrs: An array of extended attributes.

All the members are fields as follows:

  • type: Always "field".
  • name: The name of the field.
  • required: true if the field is required.
  • idlType: An IDL Type describing what field's type.
  • extAttrs: An array of extended attributes.
  • default: A default value, or null if there is none.

Enum

An enum looks like this:

{
  "type": "enum",
  "name": "MealType",
  "values": [
    {
      "type": "enum-value",
      "value": "rice"
    },
    {
      "type": "enum-value",
      "value": "noodles"
    },
    {
      "type": "enum-value",
      "value": "other"
    }
  ]
  "extAttrs": []
}

The fields are as follows:

  • type: Always "enum".
  • name: The enum's name.
  • values: An array of values. The type of value is "enum-value".
  • extAttrs: An array of extended attributes.

Typedef

A typedef looks like this:

{
  "type": "typedef",
  "idlType": {
    "type": "typedef-type",
    "generic": "sequence",
    "nullable": false,
    "union": false,
    "idlType": [
      {
        "type": "typedef-type",
        "generic": "",
        "nullable": false,
        "union": false,
        "idlType": "Point",
        "extAttrs": [...]
      }
    ],
    "extAttrs": [...]
  },
  "name": "PointSequence",
  "extAttrs": []
}

The fields are as follows:

  • type: Always "typedef".
  • name: The typedef's name.
  • idlType: An IDL Type describing what typedef's type.
  • extAttrs: An array of extended attributes.

Includes

An includes definition looks like this:

{
  "type": "includes",
  "target": "Node",
  "includes": "EventTarget",
  "extAttrs": []
}

The fields are as follows:

  • type: Always "includes".
  • target: The interface that includes an interface mixin.
  • includes: The interface mixin that is being included by the target.
  • extAttrs: An array of extended attributes.

Operation Member

An operation looks like this:

{
  "type": "operation",
  "special": "",
  "idlType": {
    "type": "return-type",
    "generic": "",
    "nullable": false,
    "union": false,
    "idlType": "undefined",
    "extAttrs": []
  },
  "name": "intersection",
  "arguments": [{
    "default": null,
    "optional": false,
    "variadic": true,
    "extAttrs": [],
    "idlType": {
      "type": "argument-type",
      "generic": "",
      "nullable": false,
      "union": false,
      "idlType": "long",
      "extAttrs": [...]
    },
    "name": "ints"
  }],
  "extAttrs": [],
  "parent": { ... }
}

The fields are as follows:

  • type: Always "operation".
  • special: One of "getter", "setter", "deleter", "static", "stringifier", or "".
  • idlType: An IDL Type of what the operation returns, if exists.
  • name: The name of the operation if exists.
  • arguments: An array of arguments for the operation.
  • extAttrs: An array of extended attributes.
  • parent: The container of this type as an Object.

Constructor Operation Member

A constructor operation member looks like this:

{
  "type": "constructor",
  "arguments": [{
    "default": null,
    "optional": false,
    "variadic": true,
    "extAttrs": [],
    "idlType": {
      "type": "argument-type",
      "generic": "",
      "nullable": false,
      "union": false,
      "idlType": "long",
      "extAttrs": [...]
    },
    "name": "ints"
  }],
  "extAttrs": [],
  "parent": { ... }
}

The fields are as follows:

  • type: Always "constructor".
  • arguments: An array of arguments for the constructor operation.
  • extAttrs: An array of extended attributes.
  • parent: The container of this type as an Object.

Attribute Member

An attribute member looks like this:

{
  "type": "attribute",
  "special": "",
  "readonly": false,
  "idlType": {
    "type": "attribute-type",
    "generic": "",
    "nullable": false,
    "union": false,
    "idlType": "any",
    "extAttrs": [...]
  },
  "name": "regexp",
  "extAttrs": [],
  "parent": { ... }
}

The fields are as follows:

  • type: Always "attribute".
  • name: The attribute's name.
  • special: One of "static", "stringifier", "inherit", or "".
  • readonly: true if the attribute is read-only.
  • idlType: An IDL Type for the attribute.
  • extAttrs: An array of extended attributes.
  • parent: The container of this type as an Object.

Constant Member

A constant member looks like this:

{
  "type": "const",
  "idlType": {
    "type": "const-type",
    "generic": "",
    "nullable": false,
    "union": false,
    "idlType": "boolean",
    "extAttrs": []
  },
  "name": "DEBUG",
  "value": {
    "type": "boolean",
    "value": false
  },
  "extAttrs": [],
  "parent": { ... }
}

The fields are as follows:

  • type: Always "const".
  • idlType: An IDL Type of the constant that represents a simple type, the type name.
  • name: The name of the constant.
  • value: The constant value as described by Const Values
  • extAttrs: An array of extended attributes.
  • parent: The container of this type as an Object.

Arguments

The arguments (e.g. for an operation) look like this:

{
  "arguments": [{
    "type": "argument",
    "default": null,
    "optional": false,
    "variadic": true
    "extAttrs": []
    "idlType": {
      "type": "argument-type",
      "generic": "",
      "nullable": false,
      "union": false,
      "idlType": "float",
      "extAttrs": [...]
    },
    "name": "ints",
    "parent": { ... }
  }]
}

The fields are as follows:

  • default: A default value, or null if there is none.
  • optional: true if the argument is optional.
  • variadic: true if the argument is variadic.
  • idlType: An IDL Type describing the type of the argument.
  • name: The argument's name.
  • extAttrs: An array of extended attributes.
  • parent: The container of this type as an Object.

Extended Attributes

Extended attribute container look like this:

{
  "extAttrs": [{
    "name": "PutForwards",
    "arguments": [...],
    "type": "extended-attribute",
    "rhs": {
      "type": "identifier",
      "value": "foo"
    },
    "parent": { ... }
  }]
}

The fields are as follows:

  • items: An array of extended attributes.

Extended attributes look like this:

  • name: The extended attribute's name.
  • arguments: An array of arguments, if the extended attribute has a signature (e.g. [Foo()]) or if its right-hand side does (e.g. [LegacyFactoryFunction=Name(DOMString blah)]).
  • type: Always "extended-attribute".
  • rhs: If there is a right-hand side, this will capture its type and value. The type can be one of the following:
    • "identifier"
    • "identifier-list"
    • "string"
    • "string-list"
    • "decimal"
    • "decimal-list"
    • "integer"
    • "integer-list"
    • "*"
  • parent: The container of this type as an Object.

Default and Const Values

Dictionary fields and operation arguments can take default values, and constants take values, all of which have the following fields:

  • type: One of "string", "number", "boolean", "null", "Infinity", "NaN", "sequence" or "dictionary".

For "boolean", "string", "number", and "sequence":

  • value: The value of the given type. For string and number types, the value is given as a string. For booleans, the possible values are true and false. For sequence, the only possible value is [].

For "Infinity":

  • negative: Boolean indicating whether this is negative Infinity or not.

iterable<>, async iterable<>, maplike<>, and setlike<> declarations

These appear as members of interfaces that look like this:

{
  "type": "maplike", // or "iterable" / "setlike"
  "idlType": /* One or two types */ ,
  "readonly": false, // only for maplike and setlike
  "async": false, // iterable can be async
  "arguments": [], // only for async iterable
  "extAttrs": [],
  "parent": { ... }
}

The fields are as follows:

  • type: Always one of "iterable", "maplike" or "setlike".
  • idlType: An array with one or more IDL Types representing the declared type arguments.
  • readonly: true if the maplike or setlike is declared as read only.
  • async: true if the type is async iterable.
  • arguments: An array of arguments if exists, empty otherwise. Currently only async iterable supports the syntax.
  • extAttrs: An array of extended attributes.
  • parent: The container of this type as an Object.

End of file

{
  "type": "eof",
  "value": ""
}

This type only appears as the last item of parser results, only if options.concrete is true. This is needed for the writer to keep any comments or whitespaces at the end of file.

The fields are as follows:

  • type: Always "eof"
  • value: Always an empty string.

Testing

Running

The test runs with mocha and expect.js. Normally, running npm test in the root directory should be enough once you're set up.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

changelog

Changelog

v23.11.0 (2020-02-21)

Full Changelog

Closed issues:

  • More permissive extended attributes grammar #455

Merged pull requests:

v23.10.1 (2019-10-15)

Full Changelog

Merged pull requests:

v23.10.0 (2019-10-14)

Full Changelog

Implemented enhancements:

  • Validate optionality of dictionary arguments #407

Closed issues:

  • any is not a keyword #436
  • Add greenkeeper support #433
  • Disallow Promise types inside unions #430
  • Base#toJSON fails when global Object is substituted #426
  • augument parser for mozilla IDL files #418
  • \[Global\] and constructor\(\) can't coexist #337
  • parse() throws error on valid ReflectOnly Blink extended attributes #256
  • BufferRelatedType shouldn't be read as identifiers #251
  • parent of things #85

Merged pull requests:

v23.9.0 (2019-09-30)

Full Changelog

Closed issues:

  • Export error constructor #220

Merged pull requests:

  • fix(webpack.config): keep class names intact #429 (TG1999)
  • feat: expose WebIDLParseError #428 (TG1999)
  • fix(autofix): propely detect special op indentation #424 (saschanaz)

v23.8.3 (2019-09-24)

Full Changelog

Closed issues:

  • Support opt-out for validations #413

Merged pull requests:

v23.8.2 (2019-09-15)

Full Changelog

Closed issues:

Merged pull requests:

  • fix(productions/interface): whitespace cleanup after autofix #412 (saschanaz)

v23.8.1 (2019-09-07)

Full Changelog

Closed issues:

  • Incorrect "Trailing comma in arguments list" when parsing HTML's IDL #402

Merged pull requests:

  • fix(productions/interface): put constructor on the top position #411 (saschanaz)
  • refactor(validator): reduce parameter count #410 (saschanaz)
  • docs(README): describe constructor operations #409 (saschanaz)

v23.8.0 (2019-09-02)

Full Changelog

Merged pull requests:

  • feat(validator): recommend constructor operations #405 (saschanaz)
  • Allow "constructor" as an argument name #404 (Ms2ger)

v23.7.0 (2019-09-02)

Full Changelog

Closed issues:

  • Consider using GitHub Actions #373
  • Reserved identifiers must be prevented #230

Merged pull requests:

v23.6.0 (2019-08-28)

Full Changelog

Closed issues:

  • also mozilla webidl: Attributes cannot accept sequence types #392
  • WebIDLParseError: namespace Missing return type #390
  • Add quickfix feature? #349

Merged pull requests:

v23.5.1 (2019-08-21)

Full Changelog

Merged pull requests:

v23.5.0 (2019-08-21)

Full Changelog

Merged pull requests:

v23.4.1 (2019-08-14)

Full Changelog

Merged pull requests:

v23.4.0 (2019-08-12)

Full Changelog

Closed issues:

Merged pull requests:

v23.3.0 (2019-07-24)

Full Changelog

Closed issues:

  • Add severity field for validations #372
  • Adding \[NoInterfaceObject\] must suppress \[Exposed\] requirement #370
  • Validating Constructors as argument-types #363

Merged pull requests:

  • feat(validation): warn about NoInterfaceObject #374 (saschanaz)
  • fix: suppress Exposed requirement when NoInterfaceObject #371 (saschanaz)
  • fix: allow legacyiterable and implements to be identifiers #369 (saschanaz)
  • docs(productions/default): add dictionary #368 (saschanaz)
  • Add test case for default-initialized example #367 (lukebjerring)

v23.2.2 (2019-07-14)

Full Changelog

v23.2.1 (2019-07-13)

Full Changelog

Closed issues:

  • Maximum call stack size exceeded #361

Merged pull requests:

v23.2.0 (2019-07-13)

Full Changelog

Merged pull requests:

  • feat: require dictionary arguments not to be nullable #360 (saschanaz)
  • fix: require dictionary default value only when optional #359 (saschanaz)

v23.1.0 (2019-07-12)

Full Changelog

Merged pull requests:

v23.0.0 (2019-07-11)

Full Changelog

Merged pull requests:

v22.3.0 (2019-07-11)

Full Changelog

Merged pull requests:

v22.2.0 (2019-07-10)

Full Changelog

Closed issues:

  • Check existence of [Exposed] in validator #342
  • Breaking change from #201 not noted as such in changelog #319

Merged pull requests:

  • refactor(lib/validator): modularize checkInterfaceMemberDuplication #353 (saschanaz)
  • feat(validation): support batch validation #352 (saschanaz)
  • chore(test): change .widl to .webidl #351 (saschanaz)
  • feat(validation): require [Exposed] #350 (saschanaz)
  • chore(package): add build commands #348 (saschanaz)
  • refactor(lib/webidl2): modularize container types #346 (saschanaz)
  • fix(callback-interface): apply member type restriction #345 (saschanaz)
  • feat(productions/operation): require default value for dictionary arguments #344 (saschanaz)
  • refactor(lib/webidl2): modularize callback+iterable #343 (saschanaz)
  • refactor(lib/webidl2): modularize const/field/typedef #341 (saschanaz)
  • refactor(lib/webidl2): modularize attributes/operations #340 (saschanaz)

v22.1.0 (2019-07-02)

Full Changelog

Closed issues:

  • Hard to upgrade to the latest version #328

Merged pull requests:

v22.0.0 (2019-06-03)

Full Changelog

Closed issues:

Merged pull requests:

  • BREAKING CHANGE: emit eof only if options.concrete=true #333 (saschanaz)

v21.1.1 (2019-06-02)

Full Changelog

Merged pull requests:

  • fix(lib/webidl2): inherited attributes cannot be readonly #332 (saschanaz)

v21.1.0 (2019-05-28)

Full Changelog

Merged pull requests:

  • docs(lib/webidl2): document eof #331 (saschanaz)
  • feat(lib/writer): provide context for reference() #330 (saschanaz)
  • Remove trailing whitespace in lib/productions/helpers.js #329 (foolip)

v21.0.0 (2019-05-17)

Full Changelog

Closed issues:

  • Unable to parse CSSOM IDL (extended attribute on optional argument) #320

Merged pull requests:

  • BREAKING CHANGE: merge operation body to the parent object #326 (saschanaz)
  • docs(lib/webidl2): represent extAttrs as an array #325 (saschanaz)
  • BREAKING CHANGE: restore extAttrs as array #324 (saschanaz)
  • BREAKING CHANGE: restore inheritance as a string #323 (saschanaz)
  • BREAKING CHANGE(lib/webidl2): allow argument-wise extended attributes #322 (saschanaz)
  • Fix JS error on productions/default.js bracket errors #321 (kainino0x)

v20.0.1 (2019-05-01)

Full Changelog

Closed issues:

  • Is this the reference parser implementation for the latest webidl spec? #316

Merged pull requests:

v20.0.0 (2019-04-30)

Full Changelog

Merged pull requests:

v19.0.1 (2019-04-19)

Full Changelog

Merged pull requests:

  • fix(lib/writer): call ts.trivia with actual string #309 (saschanaz)

v19.0.0 (2019-04-18)

Full Changelog

Closed issues:

  • Keyword float and type float is ambiguous #302
  • Docs: Trivia object not well defined #225
  • Meta - conforming Web IDL validator #138

Merged pull requests:

v18.0.1 (2019-03-22)

Full Changelog

v18.0.0 (2019-03-22)

Full Changelog

Closed issues:

  • Argument cannot have double extended attributes #191
  • Rename idlType.idlType #136

Merged pull requests:

v17.0.2 (2019-02-15)

Full Changelog

Closed issues:

  • Point GitHub Pages at the master branch so the checker can be used online #259

Merged pull requests:

  • fix(lib/webidl2): allow a preceding hyphen for identifiers #261 (saschanaz)
  • fix(checker): avoid using innerText #260 (saschanaz)
  • fix(lib/webidl2): restore enum value string form in error #258 (saschanaz)
  • Lowercase the example namespace "Console" #257 (foolip)

v17.0.1 (2018-12-11)

Full Changelog

Closed issues:

  • idlTypes should unescape type name #252
  • Union type must not allow any type #250
  • Include statements do not unescape type names #249

Merged pull requests:

v17.0.0 (2018-12-08)

Full Changelog

Closed issues:

  • Arguments shouldn't get its own extended attributes #246
  • Modify writer to be ReSpec compatible #210

Merged pull requests:

  • BREAKING CHANGE: remove .extAttrs from arguments #248 (saschanaz)

v16.1.0 (2018-12-02)

Full Changelog

Closed issues:

  • Emit preceding tokens for error messages #180

Merged pull requests:

v16.0.0 (2018-11-24)

Full Changelog

Implemented enhancements:

Closed issues:

  • Revise README document about testing #164
  • document white space #97
  • types of types #93

Merged pull requests:

v15.0.0 (2018-10-11)

Full Changelog

Fixed bugs:

  • Some leading underscores are no longer removed #228

Closed issues:

  • Enum value type should be "enum-value" not "string" #231
  • [ExtendedAttribute=null] no longer parses #227
  • Promise<void> doesn't parse #226
  • Extended attributes parser is too permissive #222
  • Update changelog #215
  • Remove implements statement support #98

Merged pull requests:

v14.0.1 (2018-06-20)

Full Changelog

Merged pull requests:

v14.0.0 (2018-06-19)

Full Changelog

Closed issues:

  • Use ESLint (with Travis) #167
  • Support full whitespace conservation #125

Merged pull requests:

v13.0.3 (2018-06-04)

Full Changelog

Merged pull requests:

v13.0.2 (2018-05-30)

Full Changelog

Closed issues:

  • Issue with parsing attribute identifiers #181

Merged pull requests:

v13.0.1 (2018-05-30)

Full Changelog

Closed issues:

  • No opening bracket after sequence #178

Merged pull requests:

v13.0.0 (2018-05-29)

Full Changelog

Fixed bugs:

  • Trailing comma in arguments list with valid IDL #169
  • Error parsing generic type with Promise<void> #168

Closed issues:

  • Do we want idlType.sequence? #174
  • Spaced three-dot shouldn't recognized as a variadic mark #162

Merged pull requests:

v12.1.4 (2018-05-23)

Full Changelog

Merged pull requests:

  • fix: prevent readwrite attributes on namespaces #165 (saschanaz)

v12.1.3 (2018-05-20)

Full Changelog

Merged pull requests:

v12.1.2 (2018-05-17)

Full Changelog

v12.1.1 (2018-05-17)

Full Changelog

Closed issues:

  • Request: tag releases #159
  • Remove test/* things from npm #158

Merged pull requests:

v12.1.0 (2018-05-16)

Full Changelog

Closed issues:

  • Named terminal symbols cannot be identifiers #156

Merged pull requests:

v12.0.0 (2018-05-11)

Full Changelog

Closed issues:

  • Reduce release size #152
  • Keep supporting allowNestedTypedefs or not? #104

Merged pull requests:

v11.0.0 (2018-05-10)

Full Changelog

Merged pull requests:

v10.3.3 (2018-05-07)

Full Changelog

Merged pull requests:

v10.3.2 (2018-04-16)

Full Changelog

Merged pull requests:

v10.3.1 (2018-03-17)

Full Changelog

Merged pull requests:

v10.3.0 (2018-03-17)

Full Changelog

Merged pull requests:

v10.2.1 (2018-03-09)

Full Changelog

Merged pull requests:

v10.2.0 (2018-01-30)

Full Changelog

Merged pull requests:

v10.1.0 (2018-01-19)

Full Changelog

Closed issues:

  • Support raises and setraises #128
  • Support legacycaller #127
  • Improve "No semicolon after enum" message #119

Merged pull requests:

  • Let error messages include the current definition name #129 (saschanaz)

v10.0.0 (2017-12-20)

Full Changelog

Closed issues:

  • Always return an array for idlType, etc. #113
  • Maintain writer.js or not? #109

Merged pull requests:

v9.0.0 (2017-11-30)

Full Changelog

Closed issues:

  • Code quality #116
  • Unable to parse HTMLAllCollection interface #114
  • Add support for mixin syntax #112
  • Whitespace issues #111

Merged pull requests:

v8.1.0 (2017-11-03)

Full Changelog

Closed issues:

  • Extended Attributes rhs should always be there #96

Merged pull requests:

v8.0.1 (2017-11-03)

Full Changelog

Fixed bugs:

  • Comment order parsing bug #107

v8.0.0 (2017-11-03)

Full Changelog

Closed issues:

  • Remove creators support #100
  • Add mixin support #92

Merged pull requests:

v7.0.0 (2017-10-27)

Full Changelog

Closed issues:

  • Type conversion on default values is destructive #94
  • extended attribute structure missing type #89

Merged pull requests:

  • BREAKING CHANGE: argument + default types should be string #95 (marcoscaceres)

v6.1.0 (2017-10-23)

Full Changelog

Merged pull requests:

v6.0.1 (2017-10-18)

Full Changelog

Closed issues:

  • Enum values should be objects #86

Merged pull requests:

v6.0.0 (2017-10-17)

Full Changelog

Merged pull requests:

v5.0.0 (2017-10-17)

Full Changelog

Closed issues:

  • Unable to parse annotated types in generics #83
  • Drop support for Node 4, move to 6 LTS #82

Merged pull requests:

v4.2.0 (2017-10-16)

Full Changelog

Closed issues:

  • Remove legacy caller support #78
  • Should report error for using duplicate names #77

Merged pull requests:

v4.1.0 (2017-07-04)

Full Changelog

Closed issues:

  • Parsing error for annonated inner types of generic types #71

Merged pull requests:

  • Support TypeWithExtendedAttributes on generics #75 (saschanaz)

v4.0.0 (2017-06-27)

Full Changelog

Closed issues:

  • Remove serializer-related productions #73
  • Records don't seem to be working right #72
  • Document namespace member output #59

Merged pull requests:

v3.0.2 (2017-05-29)

Full Changelog

Closed issues:

  • Whitespace issues #64

Merged pull requests:

v3.0.1 (2017-05-18)

Full Changelog

Closed issues:

  • Is array syntax dead? #66
  • Remove exceptions support #65

Merged pull requests:

  • Fix whitespace error on parsing extended attributes #68 (saschanaz)
  • Remove deprecated IDL arrays and exceptions #67 (saschanaz)

v2.4.0 (2017-04-12)

Full Changelog

Closed issues:

  • Add support for Annotated Types #60
  • Question: Convert WebIDL -> Javascript #56
  • Get Robin to give us push permissions on npm #54
  • Add support for records #53
  • module not supported? #52
  • Add support for namespaces #51
  • Export is not AMD compatible #48
  • Can't represent large constants #21

Merged pull requests:

v2.1.0 (2016-08-12)

Full Changelog

Closed issues:

  • Exception when parsing test/syntax/idl/typedef.widl #46
  • Wrong jsondiffpatch location #42
  • 'npm install' fails on building microtime #40
  • Can't represent union types in typedefs #38
  • tokenise() assumes a specific property enumeration order #27
  • Add support for iterable<>, maplike<>, setlike<> declarations #24
  • WebIDL2 fails to parse attribute Promise\<DOMString\>\[\] baz #19
  • Support for ExtendedAttributeIdentList (current editor's draft) #18
  • No Licensing Information #17
  • how to regenerate w3c idl files ? #14
  • What is lib/writer.js #13
  • Numerous tests are failing #7
  • Add support for missing types in ServiceWorker #5
  • How can I parse just a function? #3
  • Parser throws on nullable array of nullable array #2
  • Parser throws on nullable array of any #1

Merged pull requests:

  • Fix "default": undefined #47 (mkwtys)
  • Replace expect.js with expct #45 (halton)
  • Correct jsondiffpatch location. #44 (halton)
  • Bump microtime to 2.1.1 #43 (halton)
  • Expand writer support #39 (markandrus)
  • Accept wider (but still incomplete) set of allowed syntax for extended attributes #37 (mlogan)
  • Add test for callback with multiple arguments. #36 (tobie)
  • Iterables #34 (motiz88)
  • Allow trailing comma in enum value lists, per spec #33 (motiz88)
  • Allow typedefs within interfaces (behind an opt-in flag) #32 (motiz88)
  • In draft #31 (othree)
  • Add support for extended attributes identifier lists #29 (tobie)
  • Make attribute Promise\<T\>\[\] attr; work. #26 (jyasskin)
  • Parse required dictionary fields. #25 (jyasskin)
  • Define the WebIDL2 property on self rather than window. #23 (Ms2ger)
  • Teach WebIDL2 to parse [] default values. #22 (jyasskin)
  • Support ID list in extended attributes #20 (othree)
  • Make sure that sequence property of idl types is set to false if the type is actually sequence. #16 (tobie)
  • Parametrized #15 (tobie)
  • Add promise support #12 (tobie)
  • Remove broken coverage support from travis for now. #11 (tobie)
  • Add support for [MapClass(type, type)]. #10 (tobie)
  • Incorporate tests from widlproc[1] and remove dependency on said project. #9 (tobie)
  • README incorrectly recommended updating the widlproc submodule. #8 (tobie)
  • Fix bug where instrumented version of webidl2 was loaded. #6 (tobie)
  • Use https:// instead of git:// #4 (Manishearth)

* This Changelog was automatically generated by github_changelog_generator