(_global: any, api: _ZonePrivate)
| 7 | */ |
| 8 | |
| 9 | export function patchCustomElements(_global: any, api: _ZonePrivate) { |
| 10 | const {isBrowser, isMix} = api.getGlobalObjects()!; |
| 11 | if ((!isBrowser && !isMix) || !_global['customElements'] || !('customElements' in _global)) { |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | // https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-lifecycle-callbacks |
| 16 | const callbacks = [ |
| 17 | 'connectedCallback', |
| 18 | 'disconnectedCallback', |
| 19 | 'adoptedCallback', |
| 20 | 'attributeChangedCallback', |
| 21 | 'formAssociatedCallback', |
| 22 | 'formDisabledCallback', |
| 23 | 'formResetCallback', |
| 24 | 'formStateRestoreCallback', |
| 25 | ]; |
| 26 | |
| 27 | api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks); |
| 28 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…