Skip to content
This repository was archived by the owner on Apr 4, 2022. It is now read-only.
This repository was archived by the owner on Apr 4, 2022. It is now read-only.

BaseElement.setAttribute should track super.setAttribute succes/failure #153

@devingfx

Description

@devingfx

Hello

This is a (very) small issue though, but reading this lines in file :

setAttribute(name: string, value: string) {
this.attributeChangedCallback(name, this.getAttribute(name), value)
super.setAttribute(name, value)
}

... I assume wrong arguments can be given (like wrong attributeName) for the native impl. to throw an error.
In this case, the attributeChangedCallback will be called even the actual attribute set is not terminated...

Easy solution: invert the 2 lines, so the callback would not be fired if an error occured.
Less easy solution: Encapsulate the super call in a try/catch and call the callback only in case of success, and manage the error case...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions