create_window_in_test(test);
     const document = window.document;

     document.open();

     let executed = false;
     let exception = null;
     class CustomElement extends window.HTMLElement {
         constructor() {
             super();
             try {
                 call_function(document, window);
             } catch (error) {
                 exception = error;
             }
             executed = true;
         }
     }
     window.customElements.define('some-element', CustomElement);
