jalangi2
jalangi2 copied to clipboard
Instrumentation introduces SyntaxError (Identifier has already been declared)
The following program runs without errors.
function inc() {}
var inc = function (i) {
return i+1;
};
Running the jalangi-instrumented program yields an uncaught SyntaxError: "Uncaught SyntaxError: Identifier 'inc' has already been declared".
The problem seems to be related to the insertion of while (true)
around every script. Indeed, the following script apparently yields a SyntaxError in Chrome.
while (true) {
function inc() {}
var inc = function (i) {
return i+1;
};
}
Created a Chrome issue, https://bugs.chromium.org/p/chromium/issues/detail?id=646305
It appears that function declarations implicitly become let-bindings (the error message in Firefox is: "SyntaxError: redeclaration of let inc"). This should be fixed in jalangi.