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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • core-libs
    • None
    • b24
    • generic
    • generic

        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.

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

                Created:
                Updated:
                Resolved: