google / google/closure-compiler

java.lang.IllegalStateException: Unexpected variable bar

Open
#2,000 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

Compiling the following in SIMPLE mode throws an exception instead of providing an error message.

``` js
(function(foo) {
var bar;
function foo() {
bar = true;
}
})();
```

> 23: java.lang.IllegalStateException: Unexpected variable bar

Full stack trace attached. It does not throw exceptions in other optimization modes.

[stack_trace.txt](https://github.com/google/closure-compiler/files/458078/stack_trace.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.