Closed antonwsu closed 2 years ago
I cannot reproduce this.
But there IS a bug when there is no int as the generated code is incorrect
Fixed, covered with the following test case:
it('variable can be introduced globally', () => {
expect(`
int i;
void run()
{
int length = 10;
for (i = 0; i < length; i++ )
i++;
};
`).toCompileMethodsTo(`
constructor() {
this.i = 0;
}
run() {
let length = 10;
for (this.i = 0; this.i < length; this.i++) {
this.i++;
}
}
`);
});
Inserting the method below anywhere in your code would disable the "run" button and no error will be reported. This is due to missing "int" in the for-loop and the lack of curly brackets. Having no curly brackets should be allowed.