summaryrefslogtreecommitdiff
path: root/school/node_modules/domexception
diff options
context:
space:
mode:
Diffstat (limited to 'school/node_modules/domexception')
-rw-r--r--school/node_modules/domexception/LICENSE.txt21
-rw-r--r--school/node_modules/domexception/README.md31
-rw-r--r--school/node_modules/domexception/index.js7
-rw-r--r--school/node_modules/domexception/lib/DOMException-impl.js22
-rw-r--r--school/node_modules/domexception/lib/DOMException.js205
-rw-r--r--school/node_modules/domexception/lib/legacy-error-codes.json27
-rw-r--r--school/node_modules/domexception/lib/utils.js115
-rw-r--r--school/node_modules/domexception/node_modules/webidl-conversions/LICENSE.md12
-rw-r--r--school/node_modules/domexception/node_modules/webidl-conversions/README.md79
-rw-r--r--school/node_modules/domexception/node_modules/webidl-conversions/lib/index.js361
-rw-r--r--school/node_modules/domexception/node_modules/webidl-conversions/package.json30
-rw-r--r--school/node_modules/domexception/package.json42
-rw-r--r--school/node_modules/domexception/webidl2js-wrapper.js15
13 files changed, 967 insertions, 0 deletions
diff --git a/school/node_modules/domexception/LICENSE.txt b/school/node_modules/domexception/LICENSE.txt
new file mode 100644
index 0000000..991b146
--- /dev/null
+++ b/school/node_modules/domexception/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright © 2017 Domenic Denicola
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/school/node_modules/domexception/README.md b/school/node_modules/domexception/README.md
new file mode 100644
index 0000000..fc1ef59
--- /dev/null
+++ b/school/node_modules/domexception/README.md
@@ -0,0 +1,31 @@
+# DOMException
+
+This package implements the [`DOMException`](https://heycam.github.io/webidl/#idl-DOMException) class, from web browsers. It exists in service of [jsdom](https://github.com/tmpvar/jsdom) and related packages.
+
+Example usage:
+
+```js
+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](https://github.com/jsdom/webidl2js#for-interfaces) generated by [webidl2js](https://github.com/jsdom/webidl2js).
diff --git a/school/node_modules/domexception/index.js b/school/node_modules/domexception/index.js
new file mode 100644
index 0000000..6651596
--- /dev/null
+++ b/school/node_modules/domexception/index.js
@@ -0,0 +1,7 @@
+"use strict";
+const DOMException = require("./webidl2js-wrapper.js");
+
+const sharedGlobalObject = { Error };
+DOMException.install(sharedGlobalObject);
+
+module.exports = sharedGlobalObject.DOMException;
diff --git a/school/node_modules/domexception/lib/DOMException-impl.js b/school/node_modules/domexception/lib/DOMException-impl.js
new file mode 100644
index 0000000..7395751
--- /dev/null
+++ b/school/node_modules/domexception/lib/DOMException-impl.js
@@ -0,0 +1,22 @@
+"use strict";
+const legacyErrorCodes = require("./legacy-error-codes.json");
+const idlUtils = require("./utils.js");
+
+exports.implementation = class DOMExceptionImpl {
+ constructor(globalObject, [message, name]) {
+ this.name = name;
+ this.message = message;
+ }
+
+ get code() {
+ return legacyErrorCodes[this.name] || 0;
+ }
+};
+
+// A proprietary V8 extension that causes the stack property to appear.
+exports.init = impl => {
+ if (Error.captureStackTrace) {
+ const wrapper = idlUtils.wrapperForImpl(impl);
+ Error.captureStackTrace(wrapper, wrapper.constructor);
+ }
+};
diff --git a/school/node_modules/domexception/lib/DOMException.js b/school/node_modules/domexception/lib/DOMException.js
new file mode 100644
index 0000000..b63c31d
--- /dev/null
+++ b/school/node_modules/domexception/lib/DOMException.js
@@ -0,0 +1,205 @@
+"use strict";
+
+const conversions = require("webidl-conversions");
+const utils = require("./utils.js");
+
+const impl = utils.implSymbol;
+const ctorRegistry = utils.ctorRegistrySymbol;
+
+const iface = {
+ // When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
+ // method into this array. It allows objects that directly implements *those* interfaces to be recognized as
+ // implementing this mixin interface.
+ _mixedIntoPredicates: [],
+ is(obj) {
+ if (obj) {
+ if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) {
+ return true;
+ }
+ for (const isMixedInto of module.exports._mixedIntoPredicates) {
+ if (isMixedInto(obj)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ isImpl(obj) {
+ if (obj) {
+ if (obj instanceof Impl.implementation) {
+ return true;
+ }
+
+ const wrapper = utils.wrapperForImpl(obj);
+ for (const isMixedInto of module.exports._mixedIntoPredicates) {
+ if (isMixedInto(wrapper)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ convert(obj, { context = "The provided value" } = {}) {
+ if (module.exports.is(obj)) {
+ return utils.implForWrapper(obj);
+ }
+ throw new TypeError(`${context} is not of type 'DOMException'.`);
+ },
+
+ create(globalObject, constructorArgs, privateData) {
+ if (globalObject[ctorRegistry] === undefined) {
+ throw new Error("Internal error: invalid global object");
+ }
+
+ const ctor = globalObject[ctorRegistry]["DOMException"];
+ if (ctor === undefined) {
+ throw new Error("Internal error: constructor DOMException is not installed on the passed global object");
+ }
+
+ let obj = Object.create(ctor.prototype);
+ obj = iface.setup(obj, globalObject, constructorArgs, privateData);
+ return obj;
+ },
+ createImpl(globalObject, constructorArgs, privateData) {
+ const obj = iface.create(globalObject, constructorArgs, privateData);
+ return utils.implForWrapper(obj);
+ },
+ _internalSetup(obj) {},
+ setup(obj, globalObject, constructorArgs = [], privateData = {}) {
+ privateData.wrapper = obj;
+
+ iface._internalSetup(obj);
+ Object.defineProperty(obj, impl, {
+ value: new Impl.implementation(globalObject, constructorArgs, privateData),
+ configurable: true
+ });
+
+ obj[impl][utils.wrapperSymbol] = obj;
+ if (Impl.init) {
+ Impl.init(obj[impl], privateData);
+ }
+ return obj;
+ },
+
+ install(globalObject) {
+ class DOMException {
+ constructor() {
+ const args = [];
+ {
+ let curArg = arguments[0];
+ if (curArg !== undefined) {
+ curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'DOMException': parameter 1" });
+ } else {
+ curArg = "";
+ }
+ args.push(curArg);
+ }
+ {
+ let curArg = arguments[1];
+ if (curArg !== undefined) {
+ curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'DOMException': parameter 2" });
+ } else {
+ curArg = "Error";
+ }
+ args.push(curArg);
+ }
+ return iface.setup(Object.create(new.target.prototype), globalObject, args);
+ }
+
+ get name() {
+ if (!this || !module.exports.is(this)) {
+ throw new TypeError("Illegal invocation");
+ }
+
+ return this[impl]["name"];
+ }
+
+ get message() {
+ if (!this || !module.exports.is(this)) {
+ throw new TypeError("Illegal invocation");
+ }
+
+ return this[impl]["message"];
+ }
+
+ get code() {
+ if (!this || !module.exports.is(this)) {
+ throw new TypeError("Illegal invocation");
+ }
+
+ return this[impl]["code"];
+ }
+ }
+ Object.defineProperties(DOMException.prototype, {
+ name: { enumerable: true },
+ message: { enumerable: true },
+ code: { enumerable: true },
+ [Symbol.toStringTag]: { value: "DOMException", configurable: true },
+ INDEX_SIZE_ERR: { value: 1, enumerable: true },
+ DOMSTRING_SIZE_ERR: { value: 2, enumerable: true },
+ HIERARCHY_REQUEST_ERR: { value: 3, enumerable: true },
+ WRONG_DOCUMENT_ERR: { value: 4, enumerable: true },
+ INVALID_CHARACTER_ERR: { value: 5, enumerable: true },
+ NO_DATA_ALLOWED_ERR: { value: 6, enumerable: true },
+ NO_MODIFICATION_ALLOWED_ERR: { value: 7, enumerable: true },
+ NOT_FOUND_ERR: { value: 8, enumerable: true },
+ NOT_SUPPORTED_ERR: { value: 9, enumerable: true },
+ INUSE_ATTRIBUTE_ERR: { value: 10, enumerable: true },
+ INVALID_STATE_ERR: { value: 11, enumerable: true },
+ SYNTAX_ERR: { value: 12, enumerable: true },
+ INVALID_MODIFICATION_ERR: { value: 13, enumerable: true },
+ NAMESPACE_ERR: { value: 14, enumerable: true },
+ INVALID_ACCESS_ERR: { value: 15, enumerable: true },
+ VALIDATION_ERR: { value: 16, enumerable: true },
+ TYPE_MISMATCH_ERR: { value: 17, enumerable: true },
+ SECURITY_ERR: { value: 18, enumerable: true },
+ NETWORK_ERR: { value: 19, enumerable: true },
+ ABORT_ERR: { value: 20, enumerable: true },
+ URL_MISMATCH_ERR: { value: 21, enumerable: true },
+ QUOTA_EXCEEDED_ERR: { value: 22, enumerable: true },
+ TIMEOUT_ERR: { value: 23, enumerable: true },
+ INVALID_NODE_TYPE_ERR: { value: 24, enumerable: true },
+ DATA_CLONE_ERR: { value: 25, enumerable: true }
+ });
+ Object.defineProperties(DOMException, {
+ INDEX_SIZE_ERR: { value: 1, enumerable: true },
+ DOMSTRING_SIZE_ERR: { value: 2, enumerable: true },
+ HIERARCHY_REQUEST_ERR: { value: 3, enumerable: true },
+ WRONG_DOCUMENT_ERR: { value: 4, enumerable: true },
+ INVALID_CHARACTER_ERR: { value: 5, enumerable: true },
+ NO_DATA_ALLOWED_ERR: { value: 6, enumerable: true },
+ NO_MODIFICATION_ALLOWED_ERR: { value: 7, enumerable: true },
+ NOT_FOUND_ERR: { value: 8, enumerable: true },
+ NOT_SUPPORTED_ERR: { value: 9, enumerable: true },
+ INUSE_ATTRIBUTE_ERR: { value: 10, enumerable: true },
+ INVALID_STATE_ERR: { value: 11, enumerable: true },
+ SYNTAX_ERR: { value: 12, enumerable: true },
+ INVALID_MODIFICATION_ERR: { value: 13, enumerable: true },
+ NAMESPACE_ERR: { value: 14, enumerable: true },
+ INVALID_ACCESS_ERR: { value: 15, enumerable: true },
+ VALIDATION_ERR: { value: 16, enumerable: true },
+ TYPE_MISMATCH_ERR: { value: 17, enumerable: true },
+ SECURITY_ERR: { value: 18, enumerable: true },
+ NETWORK_ERR: { value: 19, enumerable: true },
+ ABORT_ERR: { value: 20, enumerable: true },
+ URL_MISMATCH_ERR: { value: 21, enumerable: true },
+ QUOTA_EXCEEDED_ERR: { value: 22, enumerable: true },
+ TIMEOUT_ERR: { value: 23, enumerable: true },
+ INVALID_NODE_TYPE_ERR: { value: 24, enumerable: true },
+ DATA_CLONE_ERR: { value: 25, enumerable: true }
+ });
+ if (globalObject[ctorRegistry] === undefined) {
+ globalObject[ctorRegistry] = Object.create(null);
+ }
+ globalObject[ctorRegistry]["DOMException"] = DOMException;
+
+ Object.defineProperty(globalObject, "DOMException", {
+ configurable: true,
+ writable: true,
+ value: DOMException
+ });
+ }
+}; // iface
+module.exports = iface;
+
+const Impl = require("./DOMException-impl.js");
diff --git a/school/node_modules/domexception/lib/legacy-error-codes.json b/school/node_modules/domexception/lib/legacy-error-codes.json
new file mode 100644
index 0000000..d8b1e14
--- /dev/null
+++ b/school/node_modules/domexception/lib/legacy-error-codes.json
@@ -0,0 +1,27 @@
+{
+ "IndexSizeError": 1,
+ "DOMStringSizeError": 2,
+ "HierarchyRequestError": 3,
+ "WrongDocumentError": 4,
+ "InvalidCharacterError": 5,
+ "NoDataAllowedError": 6,
+ "NoModificationAllowedError": 7,
+ "NotFoundError": 8,
+ "NotSupportedError": 9,
+ "InUseAttributeError": 10,
+ "InvalidStateError": 11,
+ "SyntaxError": 12,
+ "InvalidModificationError": 13,
+ "NamespaceError": 14,
+ "InvalidAccessError": 15,
+ "ValidationError": 16,
+ "TypeMismatchError": 17,
+ "SecurityError": 18,
+ "NetworkError": 19,
+ "AbortError": 20,
+ "URLMismatchError": 21,
+ "QuotaExceededError": 22,
+ "TimeoutError": 23,
+ "InvalidNodeTypeError": 24,
+ "DataCloneError": 25
+}
diff --git a/school/node_modules/domexception/lib/utils.js b/school/node_modules/domexception/lib/utils.js
new file mode 100644
index 0000000..c020d0b
--- /dev/null
+++ b/school/node_modules/domexception/lib/utils.js
@@ -0,0 +1,115 @@
+"use strict";
+
+// Returns "Type(value) is Object" in ES terminology.
+function isObject(value) {
+ return typeof value === "object" && value !== null || typeof value === "function";
+}
+
+function hasOwn(obj, prop) {
+ return Object.prototype.hasOwnProperty.call(obj, prop);
+}
+
+const wrapperSymbol = Symbol("wrapper");
+const implSymbol = Symbol("impl");
+const sameObjectCaches = Symbol("SameObject caches");
+const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry");
+
+function getSameObject(wrapper, prop, creator) {
+ if (!wrapper[sameObjectCaches]) {
+ wrapper[sameObjectCaches] = Object.create(null);
+ }
+
+ if (prop in wrapper[sameObjectCaches]) {
+ return wrapper[sameObjectCaches][prop];
+ }
+
+ wrapper[sameObjectCaches][prop] = creator();
+ return wrapper[sameObjectCaches][prop];
+}
+
+function wrapperForImpl(impl) {
+ return impl ? impl[wrapperSymbol] : null;
+}
+
+function implForWrapper(wrapper) {
+ return wrapper ? wrapper[implSymbol] : null;
+}
+
+function tryWrapperForImpl(impl) {
+ const wrapper = wrapperForImpl(impl);
+ return wrapper ? wrapper : impl;
+}
+
+function tryImplForWrapper(wrapper) {
+ const impl = implForWrapper(wrapper);
+ return impl ? impl : wrapper;
+}
+
+const iterInternalSymbol = Symbol("internal");
+const IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
+
+function isArrayIndexPropName(P) {
+ if (typeof P !== "string") {
+ return false;
+ }
+ const i = P >>> 0;
+ if (i === Math.pow(2, 32) - 1) {
+ return false;
+ }
+ const s = `${i}`;
+ if (P !== s) {
+ return false;
+ }
+ return true;
+}
+
+const byteLengthGetter =
+ Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
+function isArrayBuffer(value) {
+ try {
+ byteLengthGetter.call(value);
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+const supportsPropertyIndex = Symbol("supports property index");
+const supportedPropertyIndices = Symbol("supported property indices");
+const supportsPropertyName = Symbol("supports property name");
+const supportedPropertyNames = Symbol("supported property names");
+const indexedGet = Symbol("indexed property get");
+const indexedSetNew = Symbol("indexed property set new");
+const indexedSetExisting = Symbol("indexed property set existing");
+const namedGet = Symbol("named property get");
+const namedSetNew = Symbol("named property set new");
+const namedSetExisting = Symbol("named property set existing");
+const namedDelete = Symbol("named property delete");
+
+module.exports = exports = {
+ isObject,
+ hasOwn,
+ wrapperSymbol,
+ implSymbol,
+ getSameObject,
+ ctorRegistrySymbol,
+ wrapperForImpl,
+ implForWrapper,
+ tryWrapperForImpl,
+ tryImplForWrapper,
+ iterInternalSymbol,
+ IteratorPrototype,
+ isArrayBuffer,
+ isArrayIndexPropName,
+ supportsPropertyIndex,
+ supportedPropertyIndices,
+ supportsPropertyName,
+ supportedPropertyNames,
+ indexedGet,
+ indexedSetNew,
+ indexedSetExisting,
+ namedGet,
+ namedSetNew,
+ namedSetExisting,
+ namedDelete
+};
diff --git a/school/node_modules/domexception/node_modules/webidl-conversions/LICENSE.md b/school/node_modules/domexception/node_modules/webidl-conversions/LICENSE.md
new file mode 100644
index 0000000..d4a994f
--- /dev/null
+++ b/school/node_modules/domexception/node_modules/webidl-conversions/LICENSE.md
@@ -0,0 +1,12 @@
+# The BSD 2-Clause License
+
+Copyright (c) 2014, Domenic Denicola
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/school/node_modules/domexception/node_modules/webidl-conversions/README.md b/school/node_modules/domexception/node_modules/webidl-conversions/README.md
new file mode 100644
index 0000000..b2905df
--- /dev/null
+++ b/school/node_modules/domexception/node_modules/webidl-conversions/README.md
@@ -0,0 +1,79 @@
+# Web IDL Type Conversions on JavaScript Values
+
+This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [Web IDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types).
+
+The goal is that you should be able to write code like
+
+```js
+"use strict";
+const conversions = require("webidl-conversions");
+
+function doStuff(x, y) {
+ x = conversions["boolean"](x);
+ y = conversions["unsigned long"](y);
+ // actual algorithm code here
+}
+```
+
+and your function `doStuff` will behave the same as a Web IDL operation declared as
+
+```webidl
+void doStuff(boolean x, unsigned long y);
+```
+
+## API
+
+This package's main module's default export is an object with a variety of methods, each corresponding to a different Web IDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the Web IDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the Web IDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float).
+
+Each method also accepts a second, optional, parameter for miscellaneous options. For conversion methods that throw errors, a string option `{ context }` may be provided to provide more information in the error message. (For example, `conversions["float"](NaN, { context: "Argument 1 of Interface's operation" })` will throw an error with message `"Argument 1 of Interface's operation is not a finite floating-point value."`) Specific conversions may also accept other options, the details of which can be found below.
+
+## Conversions implemented
+
+Conversions for all of the basic types from the Web IDL specification are implemented:
+
+- [`any`](https://heycam.github.io/webidl/#es-any)
+- [`void`](https://heycam.github.io/webidl/#es-void)
+- [`boolean`](https://heycam.github.io/webidl/#es-boolean)
+- [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter
+- [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float)
+- [`double`](https://heycam.github.io/webidl/#es-double), [`unrestricted double`](https://heycam.github.io/webidl/#es-unrestricted-double)
+- [`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter
+- [`ByteString`](https://heycam.github.io/webidl/#es-ByteString), [`USVString`](https://heycam.github.io/webidl/#es-USVString)
+- [`object`](https://heycam.github.io/webidl/#es-object)
+- [Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types)
+
+Additionally, for convenience, the following derived type definitions are implemented:
+
+- [`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView)
+- [`BufferSource`](https://heycam.github.io/webidl/#BufferSource)
+- [`DOMTimeStamp`](https://heycam.github.io/webidl/#DOMTimeStamp)
+- [`Function`](https://heycam.github.io/webidl/#Function)
+- [`VoidFunction`](https://heycam.github.io/webidl/#VoidFunction) (although it will not censor the return type)
+
+Derived types, such as nullable types, promise types, sequences, records, etc. are not handled by this library. You may wish to investigate the [webidl2js](https://github.com/jsdom/webidl2js) project.
+
+### A note on the `long long` types
+
+The `long long` and `unsigned long long` Web IDL types can hold values that cannot be stored in JavaScript numbers, so the conversion is imperfect. For example, converting the JavaScript number `18446744073709552000` to a Web IDL `long long` is supposed to produce the Web IDL value `-18446744073709551232`. Since we are representing our Web IDL values in JavaScript, we can't represent `-18446744073709551232`, so we instead the best we could do is `-18446744073709552000` as the output.
+
+This library actually doesn't even get that far. Producing those results would require doing accurate modular arithmetic on 64-bit intermediate values, but JavaScript does not make this easy. We could pull in a big-integer library as a dependency, but in lieu of that, we for now have decided to just produce inaccurate results if you pass in numbers that are not strictly between `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER`.
+
+## Background
+
+What's actually going on here, conceptually, is pretty weird. Let's try to explain.
+
+Web IDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on Web IDL values, i.e. instances of Web IDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a Web IDL value of [Web IDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules.
+
+Separately from its type system, Web IDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given Web IDL operation, how does that get converted into a Web IDL value? For example, a JavaScript `true` passed in the position of a Web IDL `boolean` argument becomes a Web IDL `true`. But, a JavaScript `true` passed in the position of a [Web IDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a Web IDL `1`. And so on.
+
+Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the Web IDL algorithms, they don't actually use Web IDL values, since those aren't "real" outside of specs. Instead, implementations apply the Web IDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`.
+
+The upside of all this is that implementations can abstract all the conversion logic away, letting Web IDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of Web IDL, in a nutshell.
+
+And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given Web IDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ Web IDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ Web IDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a Web IDL `1` in an unsigned long context, which then becomes a JavaScript `1`.
+
+## Don't use this
+
+Seriously, why would you ever use this? You really shouldn't. Web IDL is … strange, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from Web IDL. In general, your JavaScript should not be trying to become more like Web IDL; if anything, we should fix Web IDL to make it more like JavaScript.
+
+The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in Web IDL. Its main consumer is the [jsdom](https://github.com/jsdom/jsdom) project.
diff --git a/school/node_modules/domexception/node_modules/webidl-conversions/lib/index.js b/school/node_modules/domexception/node_modules/webidl-conversions/lib/index.js
new file mode 100644
index 0000000..bae66dc
--- /dev/null
+++ b/school/node_modules/domexception/node_modules/webidl-conversions/lib/index.js
@@ -0,0 +1,361 @@
+"use strict";
+
+function _(message, opts) {
+ return `${opts && opts.context ? opts.context : "Value"} ${message}.`;
+}
+
+function type(V) {
+ if (V === null) {
+ return "Null";
+ }
+ switch (typeof V) {
+ case "undefined":
+ return "Undefined";
+ case "boolean":
+ return "Boolean";
+ case "number":
+ return "Number";
+ case "string":
+ return "String";
+ case "symbol":
+ return "Symbol";
+ case "object":
+ // Falls through
+ case "function":
+ // Falls through
+ default:
+ // Per ES spec, typeof returns an implemention-defined value that is not any of the existing ones for
+ // uncallable non-standard exotic objects. Yet Type() which the Web IDL spec depends on returns Object for
+ // such cases. So treat the default case as an object.
+ return "Object";
+ }
+}
+
+// Round x to the nearest integer, choosing the even integer if it lies halfway between two.
+function evenRound(x) {
+ // There are four cases for numbers with fractional part being .5:
+ //
+ // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example
+ // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0
+ // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2
+ // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0
+ // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2
+ // (where n is a non-negative integer)
+ //
+ // Branch here for cases 1 and 4
+ if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) ||
+ (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) {
+ return censorNegativeZero(Math.floor(x));
+ }
+
+ return censorNegativeZero(Math.round(x));
+}
+
+function integerPart(n) {
+ return censorNegativeZero(Math.trunc(n));
+}
+
+function sign(x) {
+ return x < 0 ? -1 : 1;
+}
+
+function modulo(x, y) {
+ // https://tc39.github.io/ecma262/#eqn-modulo
+ // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos
+ const signMightNotMatch = x % y;
+ if (sign(y) !== sign(signMightNotMatch)) {
+ return signMightNotMatch + y;
+ }
+ return signMightNotMatch;
+}
+
+function censorNegativeZero(x) {
+ return x === 0 ? 0 : x;
+}
+
+function createIntegerConversion(bitLength, typeOpts) {
+ const isSigned = !typeOpts.unsigned;
+
+ let lowerBound;
+ let upperBound;
+ if (bitLength === 64) {
+ upperBound = Math.pow(2, 53) - 1;
+ lowerBound = !isSigned ? 0 : -Math.pow(2, 53) + 1;
+ } else if (!isSigned) {
+ lowerBound = 0;
+ upperBound = Math.pow(2, bitLength) - 1;
+ } else {
+ lowerBound = -Math.pow(2, bitLength - 1);
+ upperBound = Math.pow(2, bitLength - 1) - 1;
+ }
+
+ const twoToTheBitLength = Math.pow(2, bitLength);
+ const twoToOneLessThanTheBitLength = Math.pow(2, bitLength - 1);
+
+ return (V, opts) => {
+ if (opts === undefined) {
+ opts = {};
+ }
+
+ let x = +V;
+ x = censorNegativeZero(x); // Spec discussion ongoing: https://github.com/heycam/webidl/issues/306
+
+ if (opts.enforceRange) {
+ if (!Number.isFinite(x)) {
+ throw new TypeError(_("is not a finite number", opts));
+ }
+
+ x = integerPart(x);
+
+ if (x < lowerBound || x > upperBound) {
+ throw new TypeError(_(
+ `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, opts));
+ }
+
+ return x;
+ }
+
+ if (!Number.isNaN(x) && opts.clamp) {
+ x = Math.min(Math.max(x, lowerBound), upperBound);
+ x = evenRound(x);
+ return x;
+ }
+
+ if (!Number.isFinite(x) || x === 0) {
+ return 0;
+ }
+ x = integerPart(x);
+
+ // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if
+ // possible. Hopefully it's an optimization for the non-64-bitLength cases too.
+ if (x >= lowerBound && x <= upperBound) {
+ return x;
+ }
+
+ // These will not work great for bitLength of 64, but oh well. See the README for more details.
+ x = modulo(x, twoToTheBitLength);
+ if (isSigned && x >= twoToOneLessThanTheBitLength) {
+ return x - twoToTheBitLength;
+ }
+ return x;
+ };
+}
+
+exports.any = V => {
+ return V;
+};
+
+exports.void = function () {
+ return undefined;
+};
+
+exports.boolean = function (val) {
+ return !!val;
+};
+
+exports.byte = createIntegerConversion(8, { unsigned: false });
+exports.octet = createIntegerConversion(8, { unsigned: true });
+
+exports.short = createIntegerConversion(16, { unsigned: false });
+exports["unsigned short"] = createIntegerConversion(16, { unsigned: true });
+
+exports.long = createIntegerConversion(32, { unsigned: false });
+exports["unsigned long"] = createIntegerConversion(32, { unsigned: true });
+
+exports["long long"] = createIntegerConversion(64, { unsigned: false });
+exports["unsigned long long"] = createIntegerConversion(64, { unsigned: true });
+
+exports.double = (V, opts) => {
+ const x = +V;
+
+ if (!Number.isFinite(x)) {
+ throw new TypeError(_("is not a finite floating-point value", opts));
+ }
+
+ return x;
+};
+
+exports["unrestricted double"] = V => {
+ const x = +V;
+
+ return x;
+};
+
+exports.float = (V, opts) => {
+ const x = +V;
+
+ if (!Number.isFinite(x)) {
+ throw new TypeError(_("is not a finite floating-point value", opts));
+ }
+
+ if (Object.is(x, -0)) {
+ return x;
+ }
+
+ const y = Math.fround(x);
+
+ if (!Number.isFinite(y)) {
+ throw new TypeError(_("is outside the range of a single-precision floating-point value", opts));
+ }
+
+ return y;
+};
+
+exports["unrestricted float"] = V => {
+ const x = +V;
+
+ if (isNaN(x)) {
+ return x;
+ }
+
+ if (Object.is(x, -0)) {
+ return x;
+ }
+
+ return Math.fround(x);
+};
+
+exports.DOMString = function (V, opts) {
+ if (opts === undefined) {
+ opts = {};
+ }
+
+ if (opts.treatNullAsEmptyString && V === null) {
+ return "";
+ }
+
+ if (typeof V === "symbol") {
+ throw new TypeError(_("is a symbol, which cannot be converted to a string", opts));
+ }
+
+ return String(V);
+};
+
+exports.ByteString = (V, opts) => {
+ const x = exports.DOMString(V, opts);
+ let c;
+ for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {
+ if (c > 255) {
+ throw new TypeError(_("is not a valid ByteString", opts));
+ }
+ }
+
+ return x;
+};
+
+exports.USVString = (V, opts) => {
+ const S = exports.DOMString(V, opts);
+ const n = S.length;
+ const U = [];
+ for (let i = 0; i < n; ++i) {
+ const c = S.charCodeAt(i);
+ if (c < 0xD800 || c > 0xDFFF) {
+ U.push(String.fromCodePoint(c));
+ } else if (0xDC00 <= c && c <= 0xDFFF) {
+ U.push(String.fromCodePoint(0xFFFD));
+ } else if (i === n - 1) {
+ U.push(String.fromCodePoint(0xFFFD));
+ } else {
+ const d = S.charCodeAt(i + 1);
+ if (0xDC00 <= d && d <= 0xDFFF) {
+ const a = c & 0x3FF;
+ const b = d & 0x3FF;
+ U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b));
+ ++i;
+ } else {
+ U.push(String.fromCodePoint(0xFFFD));
+ }
+ }
+ }
+
+ return U.join("");
+};
+
+exports.object = (V, opts) => {
+ if (type(V) !== "Object") {
+ throw new TypeError(_("is not an object", opts));
+ }
+
+ return V;
+};
+
+// Not exported, but used in Function and VoidFunction.
+
+// Neither Function nor VoidFunction is defined with [TreatNonObjectAsNull], so
+// handling for that is omitted.
+function convertCallbackFunction(V, opts) {
+ if (typeof V !== "function") {
+ throw new TypeError(_("is not a function", opts));
+ }
+ return V;
+}
+
+const abByteLengthGetter =
+ Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
+
+function isArrayBuffer(V) {
+ try {
+ abByteLengthGetter.call(V);
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+// I don't think we can reliably detect detached ArrayBuffers.
+exports.ArrayBuffer = (V, opts) => {
+ if (!isArrayBuffer(V)) {
+ throw new TypeError(_("is not a view on an ArrayBuffer object", opts));
+ }
+ return V;
+};
+
+const dvByteLengthGetter =
+ Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get;
+exports.DataView = (V, opts) => {
+ try {
+ dvByteLengthGetter.call(V);
+ return V;
+ } catch (e) {
+ throw new TypeError(_("is not a view on an DataView object", opts));
+ }
+};
+
+[
+ Int8Array, Int16Array, Int32Array, Uint8Array,
+ Uint16Array, Uint32Array, Uint8ClampedArray, Float32Array, Float64Array
+].forEach(func => {
+ const name = func.name;
+ const article = /^[AEIOU]/.test(name) ? "an" : "a";
+ exports[name] = (V, opts) => {
+ if (!ArrayBuffer.isView(V) || V.constructor.name !== name) {
+ throw new TypeError(_(`is not ${article} ${name} object`, opts));
+ }
+
+ return V;
+ };
+});
+
+// Common definitions
+
+exports.ArrayBufferView = (V, opts) => {
+ if (!ArrayBuffer.isView(V)) {
+ throw new TypeError(_("is not a view on an ArrayBuffer object", opts));
+ }
+
+ return V;
+};
+
+exports.BufferSource = (V, opts) => {
+ if (!ArrayBuffer.isView(V) && !isArrayBuffer(V)) {
+ throw new TypeError(_("is not an ArrayBuffer object or a view on one", opts));
+ }
+
+ return V;
+};
+
+exports.DOMTimeStamp = exports["unsigned long long"];
+
+exports.Function = convertCallbackFunction;
+
+exports.VoidFunction = convertCallbackFunction;
diff --git a/school/node_modules/domexception/node_modules/webidl-conversions/package.json b/school/node_modules/domexception/node_modules/webidl-conversions/package.json
new file mode 100644
index 0000000..4087df5
--- /dev/null
+++ b/school/node_modules/domexception/node_modules/webidl-conversions/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "webidl-conversions",
+ "version": "5.0.0",
+ "description": "Implements the WebIDL algorithms for converting to and from JavaScript values",
+ "main": "lib/index.js",
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha test/*.js",
+ "coverage": "nyc mocha test/*.js"
+ },
+ "repository": "jsdom/webidl-conversions",
+ "keywords": [
+ "webidl",
+ "web",
+ "types"
+ ],
+ "files": [
+ "lib/"
+ ],
+ "author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
+ "license": "BSD-2-Clause",
+ "devDependencies": {
+ "eslint": "^6.7.2",
+ "mocha": "^6.2.2",
+ "nyc": "^14.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+}
diff --git a/school/node_modules/domexception/package.json b/school/node_modules/domexception/package.json
new file mode 100644
index 0000000..e594e10
--- /dev/null
+++ b/school/node_modules/domexception/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "domexception",
+ "description": "An implementation of the DOMException class from browsers",
+ "keywords": [
+ "dom",
+ "webidl",
+ "web idl",
+ "domexception",
+ "error",
+ "exception"
+ ],
+ "version": "2.0.1",
+ "author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
+ "license": "MIT",
+ "repository": "jsdom/domexception",
+ "main": "index.js",
+ "files": [
+ "index.js",
+ "webidl2js-wrapper.js",
+ "lib/"
+ ],
+ "scripts": {
+ "prepare": "node scripts/generate.js",
+ "init-wpt": "node scripts/get-latest-platform-tests.js",
+ "pretest": "npm run prepare && npm run init-wpt",
+ "test": "mocha",
+ "lint": "eslint lib"
+ },
+ "dependencies": {
+ "webidl-conversions": "^5.0.0"
+ },
+ "devDependencies": {
+ "eslint": "^6.7.2",
+ "mkdirp": "^0.5.1",
+ "mocha": "^6.2.2",
+ "request": "^2.88.0",
+ "webidl2js": "^12.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+}
diff --git a/school/node_modules/domexception/webidl2js-wrapper.js b/school/node_modules/domexception/webidl2js-wrapper.js
new file mode 100644
index 0000000..05d3470
--- /dev/null
+++ b/school/node_modules/domexception/webidl2js-wrapper.js
@@ -0,0 +1,15 @@
+"use strict";
+const DOMException = require("./lib/DOMException.js");
+
+// Special install function to make the DOMException inherit from Error.
+// https://heycam.github.io/webidl/#es-DOMException-specialness
+function installOverride(globalObject) {
+ if (typeof globalObject.Error !== "function") {
+ throw new Error("Internal error: Error constructor is not present on the given global object.");
+ }
+
+ DOMException.install(globalObject);
+ Object.setPrototypeOf(globalObject.DOMException.prototype, globalObject.Error.prototype);
+}
+
+module.exports = {...DOMException, install: installOverride };