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

Prevent Replacement of Proxies with Update Expressions #71

Open
BenBaryoPX opened this issue Feb 12, 2023 · 0 comments
Open

Prevent Replacement of Proxies with Update Expressions #71

BenBaryoPX opened this issue Feb 12, 2023 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@BenBaryoPX
Copy link
Collaborator

Assignments where the right side contains an update expression should not be treated as proxied replacements, but as static values.
For example:

const a = [1, 2, 3, 4];
let i = 0;
const b = a[i++];
for (let _ of a) console.log(b);

This should print 1 four times.

However, after deobfuscation, the resulting code looks like this:

const a = [
  1,
  2,
  3,
  4
];
let i = 0;
const b = a[i++];
for (let _ of a)
  console.log(a[i++]);

And prints 2, 3, 4.

I've mentioned assignments, but the same goes for variable declarators and their init.

In the expected fixed behvaior variable b should not be replaced with its init value.

@BenBaryoPX BenBaryoPX added bug Something isn't working good first issue Good for newcomers labels Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant