Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8019398 nashorn-dev spec corner, review bugs
  3. JDK-8019629

void operator should always evaluate to undefined

    XMLWordPrintable

Details

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

    Description

      void operator should always evaluate to undefined.

      See ECMA 11.4.2 The void Operator


      jjs> void +this
      >> NaN
      >> => undefined instead of NaN

      jjs> (function f(){return void +(void 0)})()
      >> NaN
      >> => undefined instead of NaN

      jjs> void function(){}
      >> Exception in thread "main" java.lang.AssertionError
      >> at jdk.nashorn.internal.codegen.Attr.enterFunctionBody(Attr.java:276)
      >> at jdk.nashorn.internal.codegen.Attr.enterBlock(Attr.java:297)
      >> ...

      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: