You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 9, 2017. It is now read-only.
undefined is not a reserved keyword in JavaScript and can be shadowed by a local variable of the same name.
the following simplified test case shows the error:
function foo() {
var undefined = 2;
return b + 2;
}
console.log(foo());
in the above test case, undefined is redefined to be 2.
var b is undefined (in a sense that it is not yet declared).
foo() should report error on undeclared variable b but in Jalangi instrumentation, it returns 4 as undefined is equal to 2.
also related is the following case:
function undef() { return; }
var undefined = 2;
console.log(undef() == undefined);
it should return false as undefined is already redefined, but in Jalangi, it returns true as the outer undefined is not redefined.
use either void operator to create a true undefined value (e.g. void 0) or declare a function to generate the undefined value (e.g. function undef() { return; }, then undef() will always return undefined).
The text was updated successfully, but these errors were encountered:
undefined is not a reserved keyword in JavaScript and can be shadowed by a local variable of the same name.
the following simplified test case shows the error:
function foo() {
var undefined = 2;
return b + 2;
}
console.log(foo());
in the above test case, undefined is redefined to be 2.
var b is undefined (in a sense that it is not yet declared).
foo() should report error on undeclared variable b but in Jalangi instrumentation, it returns 4 as undefined is equal to 2.
also related is the following case:
function undef() { return; }
var undefined = 2;
console.log(undef() == undefined);
it should return false as undefined is already redefined, but in Jalangi, it returns true as the outer undefined is not redefined.
use either void operator to create a true undefined value (e.g. void 0) or declare a function to generate the undefined value (e.g. function undef() { return; }, then undef() will always return undefined).
The text was updated successfully, but these errors were encountered: