MCPcopy Create free account
hub / github.com/ampproject/amphtml / HTMLElementWrapper

Function HTMLElementWrapper

src/polyfills/custom-elements.js:773–780  ·  view source on GitHub ↗

@return {!Element}

()

Source from the content-addressed store, hash-verified

771 const {HTMLElement, Reflect} = win;
772 /** @return {!Element} */
773 function HTMLElementWrapper() {
774 const ctor = /** @type {function(...?):?|undefined} */ (this.constructor);
775
776 // Reflect.construct allows us to construct a new HTMLElement without using
777 // `new` (which will always fail because native HTMLElement is a restricted
778 // constructor).
779 return Reflect.construct(HTMLElement, [], ctor);
780 }
781 subClass(HTMLElement, HTMLElementWrapper);
782
783 // Expose the wrapped HTMLElement constructor for everyone to extend from.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected