Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zone.js): swallow the error when the element callback is not patchable #45400

Closed
wants to merge 1 commit into from

Commits on Mar 20, 2022

  1. fix(zone.js): swallow the error when the element callback is not patc…

    …hable
    
    The `patchCallbacks` is used for patching the `document.registerElement` and
    `customElements.define`. We explicitly wrap the patching code into try-catch since
    callbacks may be already patched by other web components frameworks (e.g. LWC), and they
    make those properties non-writable. This means that patching callback will throw an error
    `cannot assign to read-only property`. See this code as an example:
    https://github.com/salesforce/lwc/blob/master/packages/@lwc/engine-core/src/framework/base-bridge-element.ts#L180-L186
    We don't want to stop the application rendering if we couldn't patch some
    callback, e.g. `attributeChangedCallback`.
    
    PR Close angular#42546
    arturovt committed Mar 20, 2022
    Configuration menu
    Copy the full SHA
    8491ef1 View commit details
    Browse the repository at this point in the history