Obviously every method in UnityScript has a separate scope for variables, but blocks don’t:
var y;
if (true) {
var y; // error: There is already a local variable with the name 'y'.
var x;
} else {
var x; // error: There is already a local variable with the name 'x'.
}
From what i found on the wiki, an older version of UnityScript had the usual approach of blocks providing a new declaration space. Thus i’m wondering, is this intentional for some reason or just an oversight?