mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-16 20:28:04 +01:00
Remove support for implicit self sends and convert everything to '@'.
This fixes the nasty case where "foo(bar)" is context-sensitive, and generally simplifies the compiler a lot since there is a clear distinction between lexical and dynamic scope. Also: - Remove the special handling of capitalized names since all names are lexical now. - Allow methods to close over local variables in enclosing functions. - Allow implicit definition of all lexical names.
This commit is contained in:
5
test/language/module_variable/use_in_function.wren
Normal file
5
test/language/module_variable/use_in_function.wren
Normal file
@ -0,0 +1,5 @@
|
||||
var variable = "module"
|
||||
|
||||
Fn.new {
|
||||
System.print(variable) // expect: module
|
||||
}.call()
|
||||
Reference in New Issue
Block a user