function assert_throws_dom(type, funcOrConstructor, descriptionOrFunc, maybeDescription)
    {
        let constructor, func, description;
        if (funcOrConstructor.name === "DOMException") {
            constructor = funcOrConstructor;
            func = descriptionOrFunc;
            description = maybeDescription;
        } else {
            constructor = self.DOMException;
            func = funcOrConstructor;
            description = descriptionOrFunc;
            assert(maybeDescription === undefined,
                   "Too many args passed to no-constructor version of assert_throws_dom, or accidentally explicitly passed undefined");
        }
        assert_throws_dom_impl(type, func, description, "assert_throws_dom", constructor);
    }
Assert a DOMException with the expected type is thrown.

There are two ways of calling assert_throws_dom:

1) If the DOMException is expected to come from the current global, the
second argument should be the function expected to throw and a third,
optional, argument is the assertion description.

2) If the DOMException is expected to come from some other global, the
second argument should be the DOMException constructor from that global,
the third argument the function expected to throw, and the fourth, optional,
argument the assertion description.

@param {number|string} type - The expected exception name or
code.  See the `table of names and codes
<https://webidl.spec.whatwg.org/#dfn-error-names-table>`_. If a
number is passed it should be one of the numeric code values in
that table (e.g. 3, 4, etc).  If a string is passed it can
either be an exception name (e.g. "HierarchyRequestError",
"WrongDocumentError") or the name of the corresponding error
code (e.g. "``HIERARCHY_REQUEST_ERR``", "``WRONG_DOCUMENT_ERR``").
@param {Function} descriptionOrFunc - The function expected to
throw (if the exception comes from another global), or the
optional description of the condition being tested (if the
exception comes from the current global).
@param {string} [description] - Description of the condition
being tested (if the exception comes from another global).