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

[Nashorn] Wrong static type return value on some assignment operators

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 8u40
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      9
    • CPU:
      generic
    • OS:
      generic

      Description

      Running b-=a, b*=a, b/=a or b%=a on global variables like: var a=1, b=2 the return type is wrong, we get double instead of int.
      I tried with b = b - a and it worked, I got an int.

      Repro:
      =====
      var inspect = Java.type("jdk.nashorn.test.tools.StaticTypeInspector").inspect
      var a=1,b=2;
      print(inspect(b-=a, " assignment substraction "))

        Attachments

          Activity

            People

            Assignee:
            lagergren Marcus Lagergren
            Reporter:
            mnunez Matherey Nunez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: