MCPcopy Index your code
hub / github.com/nodejs/node / createInterfaceConverter

Function createInterfaceConverter

lib/internal/webidl.js:833–844  ·  view source on GitHub ↗

* Creates a converter for a Web IDL interface type. * @see https://webidl.spec.whatwg.org/#js-interface * @param {string} name Interface identifier. * @param {object} prototype Interface prototype object. * @returns {Converter}

(name, prototype)

Source from the content-addressed store, hash-verified

831 * @returns {Converter}
832 */
833function createInterfaceConverter(name, prototype) {
834 return (V, options = kEmptyObject) => {
835 // Web IDL interface conversion step 1: return V if it implements I.
836 if (ObjectPrototypeIsPrototypeOf(prototype, V)) {
837 return V;
838 }
839 // Step 2: otherwise throw.
840 throw makeException(
841 `is not of type ${name}.`,
842 options);
843 };
844}
845
846/**
847 * Returns the ArrayBuffer or SharedArrayBuffer viewed by a typed array or

Callers 2

webidl.jsFile · 0.85

Calls 1

makeExceptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…