google / google/closure-compiler
Dead code elimination doest removes throw after return.
Open
P3
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
Consider this code.
```js
function a() {
return true;
throw Error('Not called!');
}
```
`throw` can be safely removed, but it isn't. Configuration default (compilation_level: 'SIMPLE').
BTW, throw after throw also not removed
```js
function a() {
return 1;
throw Error('Not called 1');
throw Error('Not called 2');
}
```
Compiler leaves both throws in code in that case.
Version: v20170124
Built on: 2017-01-27 11:44
Contributor guide
Assessment
This issue has not been assessed yet.