Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8019398 nashorn-dev spec corner, review bugs
  3. JDK-8019488

switch on literals result in NoSuchMethodError or VerifyError

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • P4
    • Resolution: Fixed
    • None
    • 8
    • core-libs
    • None
    • b98
    • generic
    • generic
    • Verified

    Description


      jjs> (function(){ switch(""){case 0:break} })()
      >> Exception in thread "main" java.lang.NoSuchMethodError: jdk.nashorn.internal.runtime.ScriptRuntime.switchTagAsInt(Ljava/lang/String;I)I

      jjs> switch(true){case 0:}
      >> Exception in thread "main" java.lang.NoSuchMethodError: jdk.nashorn.internal.runtime.ScriptRuntime.switchTagAsInt(ZI)I

      jjs> (function(){switch([]){case 1:} })()
      >> Exception in thread "main" java.lang.VerifyError: Bad type on operand stack

      Attachments

        Activity

          People

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: