Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8057980

let & const: remaining issues with lexical scoping

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 8u40
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b17
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        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)

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: