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

Create special case for global method gets and sets #84

Closed
wants to merge 3 commits into from

Conversation

jackbsteinberg
Copy link
Owner

Resolves #57

@jackbsteinberg
Copy link
Owner Author

jackbsteinberg commented Sep 13, 2019

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
Copy link
Owner Author

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting/setting built-in methods should be rewritten or disallowed
1 participant