-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Bug in build-optimizer or uglify-es (AOT output bug) #12082
Comments
I'm sorry, but this issue is not caused by Angular CLI. Please contact the author(s) of the I have tried this directly using https://skalman.github.io/UglifyJS-online/ and I can re-produce the problem |
I disagree: The online tool that you pasted above produces a correct output:
--> Angular CLI produces a wrong output:
--> |
@fbernhard sorry about that but I didn't realize I had some different The flag that is breaking your code is Note in the latest beta version of the |
Thank you for re-opening the issue.
These type of changes are very dangerous for your users; We have more than
100k lines of code since Angular 2. We don't see these type of issues in
tests as the they only appear in the AOT compilation. We have to "read" the
code to find out where else this problem might occur.
…On Tue, Sep 4, 2018, 19:04 Alan Agius ***@***.***> wrote:
Reopened #12082 <#12082>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12082 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACDatKGi2lbfVD7UDP4LKg3-251ET9dQks5uXrKUgaJpZM4WY4kV>
.
|
I guess this is the same problem with pure_getters: true that is already discussed in issue 11439 |
This is actually a defect in |
Fixed via #11996, which will be the default in CLI 7.0. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
As per @trotyl on angular/angular#25800 I post this here:
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
Angular CLI: 6.0.8
Node: 10.4.0
OS: darwin x64
Angular: 6.1.6
Repro steps
Current behavior
The following Typescript code:
when compiled with AOT in an Angular project (
ng build --prod --build-optimizer --vendor-chunk=true --aot
), produces the following "compiled" code:The compiled code checks for null first before it increments
i
, the written Typescript codes incrementsi
before the null check.When run in a browser the AOT code prints
hello null
Expected behavior
The AOT compiled code in a browser should print
hello world
Minimal reproduction of the problem with instructions
Copy above Typescript snipped into a newly created Angular project and build it with AOT.
What is the motivation / use case for changing the behavior?
We expect AOT compiled code to do exactly what the code intends to do
The text was updated successfully, but these errors were encountered: