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

Labeled break in catch and finally works wrongly, when invoked through nashorn

XMLWordPrintable

    • b22
    • generic
    • generic

      FULL PRODUCT VERSION :
      java version "1.8.0_121"
      Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      All following functions return undefined, but should return "OK":

      function box1() {
          label: {
              try {
                  throw 1;
              }
              catch (e) {
                  break label;
              }
              throw 2;
          }
          return 'OK';
      };

      function box2() {
          label: {
              try {
                  throw 1;
              }
              finally {
                  break label;
              }
              throw 2;
          }
          return 'OK';
      };

      function box3() {
          label: {
              try {
                  throw 1;
              }
              finally {
                  break label;
              }
          }
          return 'OK';
      };


      REPRODUCIBILITY :
      This bug can be reproduced always.

            sdama Srinivas Dama (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: