old-website/node_modules/domexception
Jared He 0549ed1d78 Add todos 2021-06-13 21:40:44 -05:00
..
lib Add todos 2021-06-13 21:40:44 -05:00
node_modules/webidl-conversions Add todos 2021-06-13 21:40:44 -05:00
LICENSE.txt Add todos 2021-06-13 21:40:44 -05:00
README.md Add todos 2021-06-13 21:40:44 -05:00
index.js Add todos 2021-06-13 21:40:44 -05:00
package.json Add todos 2021-06-13 21:40:44 -05:00
webidl2js-wrapper.js Add todos 2021-06-13 21:40:44 -05:00

README.md

DOMException

This package implements the DOMException class, from web browsers. It exists in service of jsdom and related packages.

Example usage:

const DOMException = require("domexception");

const e1 = new DOMException("Something went wrong", "BadThingsError");
console.assert(e1.name === "BadThingsError");
console.assert(e1.code === 0);

const e2 = new DOMException("Another exciting error message", "NoModificationAllowedError");
console.assert(e2.name === "NoModificationAllowedError");
console.assert(e2.code === 7);

console.assert(DOMException.INUSE_ATTRIBUTE_ERR === 10);

APIs

This package exposes two flavors of the DOMException interface depending on the imported module.

domexception module

This module default-exports the DOMException interface constructor.

domexception/webidl2js-wrapper module

This module exports the DOMException interface wrapper API generated by webidl2js.