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

Nashorn -nse option causes parse error on anonymous function definition

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u25, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b69
    • CPU:
      x86_64
    • OS:
      linux_ubuntu

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_45"
        Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
        Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        Linux metacanvas-dev01 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


        A DESCRIPTION OF THE PROBLEM :
        Start interactive nashorn shell with -nse option. Execute anonymous function: (function(){})()

        This is standard JavaScript, not a nashorn extension, but it will not compile.

        REGRESSION. Last worked in version 8u20

        ADDITIONAL REGRESSION INFORMATION:
        java version "1.8.0_45"
        Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
        Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Start interactive nashorn shell with -nse option.
        Execute anonymous function: (function(){})()

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        jjs -nse
        jjs> (function(){})()
        jjs>

        ACTUAL -
        jjs -nse
        jjs> (function(){})()
        jdk.nashorn.internal.runtime.ParserException: <shell>:1:9 Expected ident but found (
        (function(){})()
                 ^

        REPRODUCIBILITY :
        This bug can be reproduced always.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sundar Sundararajan Athijegannathan
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: