Files
wren/test/api/get_variable.wren
Bob Nystrom 37800d441c Merge branch 'master' into unify-modules-and-classes
# Conflicts:
#	src/module/io.wren
#	src/module/io.wren.inc
#	test/api/call.wren
#	test/api/returns.wren
2016-01-01 11:49:00 -08:00

25 lines
556 B
Plaintext

import "get_variable_module"
class GetVariable {
foreign static def beforeDefined()
foreign static def afterDefined()
foreign static def afterAssigned()
foreign static def otherSlot()
foreign static def otherModule()
}
System.print(GetVariable.beforeDefined()) // expect: null
var A = "a"
System.print(GetVariable.afterDefined()) // expect: a
A = "changed"
System.print(GetVariable.afterAssigned()) // expect: changed
var B = "b"
System.print(GetVariable.otherSlot()) // expect: b
System.print(GetVariable.otherModule()) // expect: value