LambdaJS
LambdaJS copied to clipboard
Desugaring bug with labeled continue
When we execute this code,
lbl:
for(var i=0;i<3;i++){
for(var j=0;j<3;j++){
if(i+j===3){
continue lbl;// control should jump to (1)
}
print(i+":"+j);
}
// (1)
}
// (2)
expected output is bellow.
0:0
0:1
0:2
1:0
1:1
2:0
But output of run.sh is
0:0
0:1
0:2
1:0
1:1
When labeled continue is executed, control should jump to (1)
.
In desugared code, however, it jumps to (2)
.
In other words, labeled continue behaves like labeled break.