-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 compiler causing it to get 100% cpu and never ends! #10697
Comments
can be reproduced without |
at glance it seems that culprit is the |
also with naive cache in const key = `${getNodeId(reference)}|${declaredType.id}|${assumeInitialized}|${flowContainer ? getNodeId(flowContainer) : 0}|${getNodeId(callExpression)}|${type.id}|${assumeTrue}`; // CC: @ahejlsberg |
Fix available in #10703. |
@nisimjoseph Fix will be in the next nightly build. |
wonderful! |
Ported to release-2.0 in #10726 |
TypeScript Version: nightly (2.0.0-dev.20160903)
The compiler continues on 100% CPU and never end the operation.
this is caused by using very long IF statement like the one exists in Device Detection in the following file URL:
https://github.com/hgoebl/mobile-detect.js/blob/master/mobile-detect.js
you have here a long if, in the "mobileGrade" function, this IF statement stuck the compiler when you take that JS file and use "allowJs" compiler option.
in addition, when it ported that file to TS and kept all content as is, just changed some things, it stuck as well.
after cutting the file in different areas I found it that IF causing hat issue. no matter what IFs parts you cut, it just passes a number if IF parts and stuck.
Code
https://github.com/hgoebl/mobile-detect.js/blob/master/mobile-detect.js
with allowJs compiler.
// A *self-contained* demonstration of the problem follows...
Expected behavior:
finish the compilation with/without errors
Actual behavior:
just stuck on 100% CPU and never ends.
The text was updated successfully, but these errors were encountered: