export function shimES5ElementConstructor ( BuiltInHTMLElement ) { if ( window . Reflect === undefined || window . customElements === undefined || ( window . customElements as any ) . polyfillWrapFlushCallback ) { return ; } Object . defineProperty ( window , BuiltInHTMLElement . name , { value : function HTMLElement ( ) { return Reflect . construct ( BuiltInHTMLElement , [ ] , this . constructor ) ; } } ) ; const Element = ( window as any ) [ BuiltInHTMLElement . name ] as typeof HTMLElement ; Element . prototype = BuiltInHTMLElement . prototype ; Element . prototype . constructor = Element ; Object . setPrototypeOf ( Element , BuiltInHTMLElement ) ; } shimES5ElementConstructor ( HTMLElement ) ;