refactor(elements): add accessor workaround for build-optimizer (#37456)
Build-optimizer currently uses TypeScript 3.6 which is unable to resolve an 'accessor' in 'getTypeOfVariableOrParameterOrPropertyWorker'. Unfortunately, in Build optimizer we cannot update the version of TypeScript because of https://github.com/microsoft/TypeScript/issues/38412 PR Close #37456
This commit is contained in:
parent
aa8f1d569b
commit
a937889c3b
|
@ -213,7 +213,11 @@ export function createCustomElement<P>(
|
|||
// compliance with the spec). This breaks emulated inheritance in ES5 on environments that do not
|
||||
// natively support `Object.setPrototypeOf()` (such as IE 9-10).
|
||||
// Update the property descriptor of `NgElementImpl#ngElementStrategy` to make it enumerable.
|
||||
Object.defineProperty(NgElementImpl.prototype, 'ngElementStrategy', {enumerable: true});
|
||||
// The below 'const', shouldn't be needed but currently this breaks build-optimizer
|
||||
// Build-optimizer currently uses TypeScript 3.6 which is unable to resolve an 'accessor'
|
||||
// in 'getTypeOfVariableOrParameterOrPropertyWorker'.
|
||||
const getterName = 'ngElementStrategy';
|
||||
Object.defineProperty(NgElementImpl.prototype, getterName, {enumerable: true});
|
||||
|
||||
// Add getters and setters to the prototype for each property input.
|
||||
defineInputGettersSetters(inputs, NgElementImpl.prototype);
|
||||
|
|
Loading…
Reference in New Issue