Closed martin-henz closed 9 months ago
The root cause of this appears to be that no validation is performed in the CSE machine at all - for example, this program also evaluates without error:
const a=1;
if (false) {
c;
}
else {
a;
}
https://share.sourceacademy.org/novalincse
I think we should borrow the checkForUndefinedVariables
function from the stepper to accomplish this.
This program
() => c;
should giveLine 1: Name c not declared.
but currently evaluates without error.