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

Anonymous functions escape to surrounding scope when defined under "with" statement

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 9
    • core-libs
    • b72
    • generic
    • generic

    Backports

      Description

        Test:

        with({}){ /*force vars into scope*/
           function () { /*line 2*/
             print("hello from nashorn");
           }
         }

        print(this["L:2"])

        Expected: undefined
        Observed:
        function () { /*line 2*/
             print("hello from nashorn");
           }


        This bug was reported via nashorn-dev alias ( http://mail.openjdk.java.net/pipermail/nashorn-dev/2015-June/004776.html ) by Andreas Woess

        Attachments

          Issue Links

            Activity

              People

                sundar Sundararajan Athijegannathan
                sundar Sundararajan Athijegannathan
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: