-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
13
A DESCRIPTION OF THE PROBLEM :
#Testcase:
var NISLFuzzingFunc = function(){
var e = ["a", "b", "c"];
for (var n in e){
print(n < e.length);
e.splice(n,1);
}
};
NISLFuzzingFunc();
#Command:
./nashorn/jdk-13.0.1/bin/jjs --no-syntax-extensions=true --no-deprecation-warning=true testcase.js
#Output:
true
true
false
#Expected output:
true
true
#Description
The for-in statement is executed unexpectedly when using splice() method to update the array. There are the same situations when using method pop() and shift().
#Testcase:
var NISLFuzzingFunc = function(){
var e = ["a", "b", "c"];
for (var n in e){
print(n < e.length);
e.splice(n,1);
}
};
NISLFuzzingFunc();
#Command:
./nashorn/jdk-13.0.1/bin/jjs --no-syntax-extensions=true --no-deprecation-warning=true testcase.js
#Output:
true
true
false
#Expected output:
true
true
#Description
The for-in statement is executed unexpectedly when using splice() method to update the array. There are the same situations when using method pop() and shift().