mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 14:48:40 +01:00
This is a breaking change because existing imports in user Wren code that assume the path is relative to the entrypoint file will now likely fail. Also, stack trace output and host API calls that take a module string now need the resolved module string, not the short name that appears in the import.
25 lines
538 B
Plaintext
25 lines
538 B
Plaintext
import "./get_variable_module"
|
|
|
|
class GetVariable {
|
|
foreign static beforeDefined()
|
|
foreign static afterDefined()
|
|
foreign static afterAssigned()
|
|
foreign static otherSlot()
|
|
foreign static 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
|