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

Constant folding removes var statement

XMLWordPrintable

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

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

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

      It should print:
      undefined

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

              Created:
              Updated:
              Resolved: