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

Nashorn incorrectly identifies some code as dead

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 10
    • 9
    • core-libs
    • None

      print((function() { L: { { break L; } throw x; } return "hello world"; })());

      prints "undefined" instead of "hello world".

      Note that taking away {} from around the break statement produces the correct result:

      print((function() { L: { break L; throw x; } return "hello world"; })());

            pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: