-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
11
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
<dependency>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
<version>15.4</version>
</dependency>
A DESCRIPTION OF THE PROBLEM :
scriptObject should not be array, but it is now array
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
a
b
c
ACTUAL -
0,a
1,b
2,c
---------- BEGIN SOURCE ----------
public class Main {
public static void main(String[] args) throws ScriptException {
ScriptEngine engine1 = new NashornScriptEngineFactory().getScriptEngine(new String[]{"--language=es6"});
Object arr = engine1.eval("['a', 'b', 'c']");
System.out.println("bug?");
ScriptEngine engine2 = new NashornScriptEngineFactory().getScriptEngine(new String[]{"--language=es6"});
engine2.put("arr", arr);
engine2.eval("for (var a of arr) {\n" +
"\tprint(a)\n" +
"}");
}
}
---------- END SOURCE ----------
FREQUENCY : always
<dependency>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
<version>15.4</version>
</dependency>
A DESCRIPTION OF THE PROBLEM :
scriptObject should not be array, but it is now array
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
a
b
c
ACTUAL -
0,a
1,b
2,c
---------- BEGIN SOURCE ----------
public class Main {
public static void main(String[] args) throws ScriptException {
ScriptEngine engine1 = new NashornScriptEngineFactory().getScriptEngine(new String[]{"--language=es6"});
Object arr = engine1.eval("['a', 'b', 'c']");
System.out.println("bug?");
ScriptEngine engine2 = new NashornScriptEngineFactory().getScriptEngine(new String[]{"--language=es6"});
engine2.put("arr", arr);
engine2.eval("for (var a of arr) {\n" +
"\tprint(a)\n" +
"}");
}
}
---------- END SOURCE ----------
FREQUENCY : always