fix(elements): prevent closure renaming of platform properties (#23843)
Closure compiler with type based optimizations has a bug where externs for inherited static fields are not being honored. For Angular Elements this meant that 'observedAttributes' static field which is marked as an extern for the base HTMLElement class was getting renamed. This commit works around the bug by using quoted access of 'observedAttributes' that explicitly prevents the renaming. PR Close #23843
This commit is contained in:
parent
cfde36da84
commit
d4b8b24406
|
@ -131,7 +131,9 @@ export function createCustomElement<P>(
|
|||
const attributeToPropertyInputs = getDefaultAttributeToPropertyInputs(inputs);
|
||||
|
||||
class NgElementImpl extends NgElement {
|
||||
static readonly observedAttributes = Object.keys(attributeToPropertyInputs);
|
||||
// Work around a bug in closure typed optimizations(b/79557487) where it is not honoring static
|
||||
// field externs. So using quoted access to explicitly prevent renaming.
|
||||
static readonly['observedAttributes'] = Object.keys(attributeToPropertyInputs);
|
||||
|
||||
constructor(injector?: Injector) {
|
||||
super();
|
||||
|
|
Loading…
Reference in New Issue