ember-codemods / es5-getter-ember-codemod

34 stars 14 forks source link

`this.getProperties(...)` transformed to `this` #6

Closed Turbo87 closed 6 years ago

Turbo87 commented 6 years ago
// before
let context = this.getProperties('afterSalesCharges', 'exchanges', 'pnrs', 'subscriptions');

// after
let context = this;

After the transformation context is just a reference to this, instead of a dedicated object with just the specified properties.

Turbo87 commented 6 years ago

I guess we should only transform to this if the element before the assignment is a destructuring operation

rondale-sc commented 6 years ago

Definitely. I thought I had a guard for this exact thing :(