* 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)
| 831 | * @returns {Converter} |
| 832 | */ |
| 833 | function 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 |
no test coverage detected
searching dependent graphs…