Inside a method, all local variable lookup stops at the method boundary. In other words, methods, do not close over outer local variables. If a name is not found inside a method and is lowercase, it's a method on this. If it's capitalized, it's a global variable.
7 lines
82 B
Plaintext
7 lines
82 B
Plaintext
class Foo {
|
|
bar {
|
|
var A = "value"
|
|
var A = "other" // expect error
|
|
}
|
|
}
|