Currently we always write/overwrite window.CustomElementsRegistry when the polyfill loads, even if we don't patch anything else, including window.customElements
If the browser has a native implementation of custom elements, this means that customElements isn't an instance of CustomElementsRegistry, so patching CustomElementsRegistry.prototype, as redefine_custom_elements does, does not effect how customElements behaves. This leads to fun and mysterious bugs!
Better to only write to CustomElementsRegistry when we're doing other patching, and otherwise leave it alone.
Currently we always write/overwrite window.CustomElementsRegistry when the polyfill loads, even if we don't patch anything else, including window.customElements
If the browser has a native implementation of custom elements, this means that customElements isn't an instance of CustomElementsRegistry, so patching CustomElementsRegistry.prototype, as redefine_custom_elements does, does not effect how customElements behaves. This leads to fun and mysterious bugs!
Better to only write to CustomElementsRegistry when we're doing other patching, and otherwise leave it alone.
Fixes #340.