rollup-plugin-closure-compiler
rollup-plugin-closure-compiler copied to clipboard
Convert Computed Static Keys to Static Keys
Is your feature request related to a problem? Please describe.
There are remaining computed keys that could be converted to static keys.
In this example (this[Qa] => this.Qa, b.propertyBackedAttributes_[c] => b.propertyBackedAttributes_.c, this[d] => this.d)
class w {
constructor(a, b, c, d, e) {
this[Qa] = [];
this[13] = b;
this[18] = c;
this[46] = b[46].bind(b);
b.propertyBackedAttributes_[c] = [() => this.value, a => (this.value = a)];
d &&
e &&
Object.defineProperty(a.prototype, e, {
enumerable: !0,
configurable: !0,
get() {
return this[d].value;
},
set(a) {
this[d].value = a;
},
});
}
}
Describe the solution you'd like
Iterate over all Declarations and replace static computed keys with just the static key (as long as the key is a string, not a number this.11 is invalid.