Relates :
|
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.
|