   throw event.error;
};

promise_test(t => {
    const error = { name: "test" };

    return promise_rejects_exactly(t, error,
        uncaught_error_test(t, () => { throw error; }));
}, "rethrows errors when getting `handleEvent`");

promise_test(t => {
    return promise_rejects_js(t, TypeError, uncaught_error_test(t, () => null));
}, "throws if `handleEvent` is falsy and not callable");

promise_test(t => {
    return promise_rejects_js(t, TypeError, uncaught_error_test(t, () => 42));
}, "throws if `han