Details

    • Sub-task
    • Resolution: Fixed
    • P3
    • 8
    • 8
    • core-libs
    • None
    • b100
    • generic
    • generic
    • Verified

    Description

      ECMA section 11.4.8 - Bit Not operator "~" is a unary operator. Nashorn treats it as binary operator in certain circumstances.

      Syntax error expected - but crashes inside code generator:

      jjs> (function(){if(1~0)return 0; return 1})()
      > Exception in thread "main" java.lang.AssertionError: node 1 ~ 0 class jdk.nashorn.internal.ir.BinaryNode has no symbol! [int] function _L1()


      jjs> ""~""
      >> Exception in thread "main" java.lang.AssertionError: "" ~ "" has no type


      Valid case - but crashes in code generator:

      >> jjs> Function(" 0 \n ~ 2 \n ~ 1")()
      >> Exception in thread "main" java.lang.AssertionError: 2 ~ 1 has no type

      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: