mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 06:38:45 +01:00
18 lines
501 B
Plaintext
18 lines
501 B
Plaintext
import "meta" for Meta
|
|
|
|
var variables = Meta.getModuleVariables("main")
|
|
|
|
// Includes implicitly imported core stuff.
|
|
System.print(variables.contains("Object")) // expect: true
|
|
System.print(variables.contains("Bool")) // expect: true
|
|
|
|
// Includes top level variables.
|
|
System.print(variables.contains("variables")) // expect: true
|
|
|
|
// Even ones declared later.
|
|
System.print(variables.contains("later")) // expect: true
|
|
|
|
var later = "values"
|
|
|
|
System.print(variables.contains("unknown")) // expect: false
|