I think it counters the general aim of safety to retain the scoping rules from Javascript. While historically the language might have been much closer to it, today it provides less resemblance.
The sheer amout of guidance in the documentation to warn about the scoping rules is also an indication that it is not neccesarily providing a safe behaviour.
The two main changes:
- variables must be defined before the first reference
- conditionals and loops have their own scope (can access upvalues of course)
I think it counters the general aim of safety to retain the scoping rules from Javascript. While historically the language might have been much closer to it, today it provides less resemblance.
The sheer amout of guidance in the documentation to warn about the scoping rules is also an indication that it is not neccesarily providing a safe behaviour.
The two main changes: