-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b132
-
x86
-
windows_xp
-
Verified
A DESCRIPTION OF THE PROBLEM :
The doc contains a possible implementation for the call syntax of JavaScript.
This code is wrong for the case of a zero-length argument array.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
String ret = obj;
ret += "." + m + "(";
for (int i = 0; i < args.length; i++) {
ret += args[i];
if (i < args.length - 1) {
ret += ",";
}
}
ret += ")";
return ret;
ACTUAL -
String ret = obj;
ret += "." + m + "(";
for (int i = 0; i < args.length; i++) {
ret += args[i];
if (i == args.length - 1) {
ret += ")";
} else {
ret += ",";
}
}
return ret;
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/javase/6/docs/api/javax/script/ScriptEngineFactory.html
The doc contains a possible implementation for the call syntax of JavaScript.
This code is wrong for the case of a zero-length argument array.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
String ret = obj;
ret += "." + m + "(";
for (int i = 0; i < args.length; i++) {
ret += args[i];
if (i < args.length - 1) {
ret += ",";
}
}
ret += ")";
return ret;
ACTUAL -
String ret = obj;
ret += "." + m + "(";
for (int i = 0; i < args.length; i++) {
ret += args[i];
if (i == args.length - 1) {
ret += ")";
} else {
ret += ",";
}
}
return ret;
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/javase/6/docs/api/javax/script/ScriptEngineFactory.html