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

Constant folding removes var statement

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 8
    • 8
    • core-libs
    • None
    • b113
    • generic
    • generic

    Description

      The following script:
      if (false) var foo = 42; print(foo);

      produces:
      <shell>:1 ReferenceError: "foo" is not defined

      It should print:
      undefined

      Attachments

        Issue Links

          Activity

            People

              hannesw Hannes Wallnoefer
              hannesw Hannes Wallnoefer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: