let variable in loop scope retains previous iteration value #1386
Labels
block-scope
bug
Issues considered a bug
Ecma Incompatibility
Issues about Rhino being incompatible with the EcmaScript spec
prints
undefined
then1
. Same code in V8 printsundefined
twice as expected. For a quick shell repro:Investigating the issue, the JS bytecode created is:
We see there's a
ONE; SETVAR1 1
to set the value to 1 after the console.log call, but the originallet x;
resulted in no code.The problem most likely lies in
NodeTransformer
that'll entirely transform away an initializer-less(LET (NAME x))
AST node instead of initializing the variable to undefined.The text was updated successfully, but these errors were encountered: