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

fix invalid transform on const #1919

Merged
merged 2 commits into from May 11, 2017
Merged

Conversation

alexlamsl
Copy link
Collaborator

  • preserve (re)assignment to const for runtime error
  • suppress cascade on const, as runtime behaviour is ill-defined

#1500 (comment)

Backport candidate for v2.x

- preserve (re)assignment to `const` for runtime error
- suppress `cascade` on `const`, as runtime behaviour is ill-defined
@kzc
Copy link
Contributor

kzc commented May 11, 2017

Backport candidate for v2.x

This PR is for master and harmony?

Do you plan to fix this issue and cut a 3.x release before you apply the const removal PR #1910 in 3.x?

@alexlamsl
Copy link
Collaborator Author

This PR will be short-lived on master, but I did it here because both v2.x and harmony would benefit from this patch.

And yes, this will get merged first, then #1910 will be rebased and merged.

@alexlamsl
Copy link
Collaborator Author

@kzc I would be grateful if you can test this PR for all the corner cases you have in mind 😉

@kzc
Copy link
Contributor

kzc commented May 11, 2017

Cool. Could you merge this PR first, make a new 3.x release, then merge #1910?

@alexlamsl
Copy link
Collaborator Author

Cool. Could you merge this PR first, make a new 3.x release, then merge #1910?

Sure, I don't mind it either way 👍

@kzc
Copy link
Contributor

kzc commented May 11, 2017

I see this PR handles const reassignment and const modification via unary operators - that's all I can think of to test it.

@alexlamsl alexlamsl merged commit 1d407e7 into mishoo:master May 11, 2017
@alexlamsl alexlamsl deleted the issue-1500 branch May 11, 2017 20:51
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this pull request May 11, 2017
- preserve (re)assignment to `const` for runtime error
- suppress `cascade` on `const`, as runtime behaviour is ill-defined
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.

None yet

2 participants