-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b63
-
generic
-
generic
import javax.script.*;
public class t {
public static void main(String[] args) throws Exception {
ScriptEngineManager m = new ScriptEngineManager();
ScriptEngine e = m.getEngineByName("js");
e.eval("var v = 'hello'");
Bindings b = e.createBindings();
// b is newly created scope. We don't expect 'v' in it...
// we expect 'b' to be empty
for (String s: b.keySet())
System.out.println(s);
}
}
Running the above program prints
context
print
v
This is not expected. The newly created scope somehow gets the values created in default engine scope of the JavaScript engine. This should not happen.
public class t {
public static void main(String[] args) throws Exception {
ScriptEngineManager m = new ScriptEngineManager();
ScriptEngine e = m.getEngineByName("js");
e.eval("var v = 'hello'");
Bindings b = e.createBindings();
// b is newly created scope. We don't expect 'v' in it...
// we expect 'b' to be empty
for (String s: b.keySet())
System.out.println(s);
}
}
Running the above program prints
context
v
This is not expected. The newly created scope somehow gets the values created in default engine scope of the JavaScript engine. This should not happen.