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

javax.script.filename variable should not be enumerable with nashorn engine's ENGINE_SCOPE bindings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b24
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Pre jdk9 prints only "i" with the following code:

        import javax.script.*;

        public class Main {
           public static void main(String[] args) throws Exception {
              ScriptEngineManager m = new ScriptEngineManager();
              ScriptEngine e = m.getEngineByName("nashorn");
              e.put(ScriptEngine.FILENAME, "foo");
              e.eval("for (var i in this) print(i)");
           }
        }


        jdk9 nashorn tip prints "i" and "javax.script.filename". So "javax.script.filename" has become enumerable. We need to restore the old behavior.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: