switch on literals result in NoSuchMethodError or VerifyError

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b98
    • generic
    • generic
    • Verified


      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

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

              Created:
              Updated:
              Resolved: