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

Nashorn shouldn't accept FunctionDeclaration as a Statement

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • None
    • core-libs
    • None
    • b89
    • generic
    • generic
    • Verified

    Description

      Right now, Nashorn accepts the FunctionDeclaration grammar production where Statement is expected; that used to be an ill-defined feature of old JavaScript runtimes, but ES5.1 is clear about FunctionDeclaration not being a Statement but rather a SourceElement, and as such it can only appear on the level of Program or FunctionBody, and not in other places where Statement is allowed.

      (Note: FunctionExpression can still appear anywhere any expression can)

      Attachments

        Activity

          People

            attila Attila Szegedi
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: