UNPKG

bit-docs-html-toc

Version:
43 lines (36 loc) 1 kB
<html> <bit-toc></bit-toc> <script> console.log("executing"); console.log("executed"); function safeCustomElement(tag, constructor, prototype){ var Element = function(){ var result; if(typeof Reflect !== "undefined") { result = Reflect.construct(HTMLElement, [], new.target); } else { result = HTMLElement.apply(this, arguments); } return result; } if(typeof HTMLElement !== undefined) { Element.prototype = Object.create(HTMLElement.prototype); } Object.getOwnPropertyNames(prototype).forEach(function(property){ Object.defineProperty(Element.prototype, property, Object.getOwnPropertyDescriptor(prototype, property)) }); if(typeof customElements !== "undefined") { customElements.define(tag, Element); } return Element; } var BitToc = safeCustomElement('bit-toc',function(){ console.log("constructor"); },{ connectedCallback: function(){ console.log("connected"); } }); </script> </html>