Unary ADD and array literal always produces NaN

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b93
    • Verified

      the following expressions all evaluate to NaN:

      +[]
      +[1]
      +[1,2,3]

      They should evaluate to 0, 1, NaN respectively.

      It looks like somewhere the array literal node is replaced with a NaN constant as the generated bytecode always looks like this:

          LDC NaN
          INVOKESTATIC java/lang/Double.valueOf (D)Ljava/lang/Double;

            Assignee:
            Marcus Lagergren
            Reporter:
            Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: