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

Convert Computed Static Keys to Static Keys #118

Open
kristoferbaxter opened this issue Nov 26, 2018 · 0 comments
Open

Convert Computed Static Keys to Static Keys #118

kristoferbaxter opened this issue Nov 26, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@kristoferbaxter
Copy link
Contributor

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.

@kristoferbaxter kristoferbaxter added the enhancement New feature or request label Nov 26, 2018
@kristoferbaxter kristoferbaxter self-assigned this Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant