Closed merryman closed 1 year ago
Thanks for the report, it looks like the transpilation logic is misfiring.
Repro in the debugger:
I have confirmed that the exception occurs in my local environment as well.
It appears that this occurs when the language-out
option is ecmascript5
or ecmascript5_strict
.
This problem seems to start happening after let/const transpilation in https://github.com/google/closure-compiler/blob/394a456cea8b42ed74af668afdc467bf3d5ba56c/src/com/google/javascript/jscomp/Es6RewriteBlockScopedDeclaration.java.
I've reproduced this in a unit test for that pass and am working on a fix.
I am able to reproduce this issue with the 20200517.0.0 version of the compiler. I am also able to crash the service running on https://closure-compiler.appspot.com/ with this snippet.
I have not figured out exactly what causes the crash here but it seems like returning any
const
orlet
variables defined within the scope of afor
loop within a dynamically defined property getter causes a crash:I am also able to reproduce this very issue with "older" versions up until 20190618.0.0/. I have not tested further though.
This is the crash dump I receive with the current version / the one hosted on https://closure-compiler.appspot.com/: