jackbsteinberg / get-originals-rewriter

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Create special case for global method gets and sets #84

Closed jackbsteinberg closed 4 years ago

jackbsteinberg commented 5 years ago

Resolves #57

jackbsteinberg commented 5 years ago

Currently this specially handles function "gets" and ignores function "sets." However, I noticed in the fringe case alluded to in #57:

a.concat = 5;
const c = a.concat;

Will rewrite to

a.concat = 5;
const c = Array_concat;

This is currently captured in the failing test. The problem here is that even when put into the ts-ast-viewer const c = a.concat shows up as a reference to the global concat method on Array. Should we consider this a case we don't cover and make a note not to do this, or should we write something a more complicated check to try and handle the set -> get case?

jackbsteinberg commented 4 years ago

Closing due to inactivity