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

Nashorn -nse option causes parse error on anonymous function definition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u25, 9
    • core-libs
    • b69
    • x86_64
    • linux_ubuntu

        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.

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

                Created:
                Updated:
                Resolved: