let & const: remaining issues with lexical scoping

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8u40
    • Affects Version/s: 8u40
    • Component/s: core-libs
    • None
    • b17
    • generic
    • generic

        There are a few remaining issues with let/const after JDK-8051889:

         - let/const declarations should not be allowed in raw switch statements where the case clause does not have a block with explicit curly braces.
         - let/const should not be allowed in other unprotected statements such as if or while statements without explicit curly braces for the body of the statement.
         - for statement with let/const initializer should copy defined symbols from the outer to the inner block on each iteration (see http://esdiscuss.org/topic/in-es6-do-for-loops-with-a-let-const-initializer-create-a-separate-scope)

              Assignee:
              Hannes Wallnoefer
              Reporter:
              Hannes Wallnoefer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: