When using the webcomponents.js custom element polyfill, window.HTMLElement is modified in such a way that breaks document.registerElement.
document.registerElement expects that if prototype is declared in the options, that its .constructor is configurable. When this requirement is not satisfied, an error like the following is emitted (this example comes from Chrome):
VM17049:156 Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'aui-item-link'. Prototype constructor property is not configurable.
When using the webcomponents.js custom element polyfill,
window.HTMLElement
is modified in such a way that breaksdocument.registerElement
.document.registerElement
expects that ifprototype
is declared in the options, that its.constructor
is configurable. When this requirement is not satisfied, an error like the following is emitted (this example comes from Chrome):The problem comes from https://github.com/webcomponents/webcomponentsjs/blob/b77ca743edecb6ec262d4ffe8443708dbe0be49b/src/CustomElements/v1/CustomElements.js#L471.
The difference is observable in unpolyfilled:
vs polyfilled:
Note the difference in
configurable
.