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

nashorn: "!!" of nonzero even integer var becomes false when returned

XMLWordPrintable

    • b32
    • x86_64
    • linux

      FULL PRODUCT VERSION :
      openjdk version "9.0.1"
      OpenJDK Runtime Environment (build 9.0.1+11)
      OpenJDK 64-Bit Server VM (build 9.0.1+11, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux jeffrey-XPS-8700 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      A nashorn function that returns the "!!" of a variable returns false whenever that variable is even. It should only be false if it's 0.

      jjs> (function(x) { return !!x })(8192)
      false


      REPRODUCIBILITY :
      This bug can be reproduced always.

            pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: