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

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

XMLWordPrintable

    • b72
    • generic
    • generic

        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

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

                Created:
                Updated:
                Resolved: