Files
wren/test/variable/local_collide_with_method_parameter.wren
T
Bob Nystrom 4240e46e05 feat: replace Scope stack with Local array to fix variable shadowing in nested blocks
Replace the linked-list Scope structure with a flat Local array indexed by depth, enabling proper shadowing semantics where inner declarations correctly hide outer ones. Remove the PUSH_SCOPE/POP_SCOPE macros and the SymbolTable-based locals tracking, replacing them with a MAX_LOCALS (255) fixed-size array that stores variable name, length, and depth. Add four new test cases covering local/parameter collision, nested block scoping, global shadowing, and local shadowing to validate the new behavior.
2013-12-01 02:28:01 +00:00

6 lines
64 B
Plaintext

class Foo {
bar(a) {
var a = "oops" // expect error
}
}