ADVANCED mode java.lang.IllegalStateException
See original GitHub issueVersion: v20220502 I use closure-compiler in ADVANCED mode and get java.lang.IllegalStateException
0 error(s), 223 warning(s), 60.6% typed java.lang.IllegalStateException at com.google.common.base.Preconditions.checkState(Preconditions.java:486) at com.google.javascript.rhino.Node.getOnlyChild(Node.java:563) at com.google.javascript.jscomp.NodeUtil.getRValueOfLValue(NodeUtil.java:5190) at com.google.javascript.jscomp.PureFunctionIdentifier.populateFunctionDefinitions(PureFunctionIdentifier.java:423) at java.util.Map.forEach(Map.java:661) at com.google.javascript.jscomp.PureFunctionIdentifier.populateDatastructuresForAnalysisTraversal(PureFunctionIdentifier.java:399) at com.google.javascript.jscomp.PureFunctionIdentifier.process(PureFunctionIdentifier.java:157) at com.google.javascript.jscomp.OptimizeCalls.process(OptimizeCalls.java:124) at com.google.javascript.jscomp.PureFunctionIdentifier$Driver.process(PureFunctionIdentifier.java:1364) at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:267) at com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java:186) at com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations(Compiler.java:2572) at com.google.javascript.jscomp.Compiler.lambda$stage2Passes$5(Compiler.java:936) at com.google.javascript.jscomp.CompilerExecutor.lambda$runInCompilerThread$0(CompilerExecutor.java:101) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:829) at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:597) at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:194)
Have no idea how to debug this problem and is there any problems in my code (12000 lines of code) I will be grateful for your help
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
I encountered the same error and managed to reduce it to this:
The culprit seems to be the uninitialized instance field declaration and the fact that it’s accessed inside the
value()
function.If I remove the field or initialize it to
undefined
or remove the access invalue()
, the error goes away.FYI I used https://github.com/wala/jsdelta to find a reduced version of my crash. It was very fast and simplified it from 500k to only a few lines.