Split out the core and main modules.

- Implicitly import everything in core into every imported module.
- Test cyclic imports.
This commit is contained in:
Bob Nystrom
2015-02-11 10:06:45 -08:00
parent 2005e1e0a2
commit bc5a793c41
8 changed files with 190 additions and 86 deletions
+9
View File
@@ -0,0 +1,9 @@
// nontest
IO.print("start a")
var A = "a value"
IO.print("a defined ", A)
var B = "b".import_("B")
IO.print("a imported ", B)
IO.print("end a")
+9
View File
@@ -0,0 +1,9 @@
// nontest
IO.print("start b")
var B = "b value"
IO.print("b defined ", B)
var A = "a".import_("A")
IO.print("b imported ", A)
IO.print("end b")
@@ -0,0 +1,11 @@
var A = "a".import_("A")
// Shared module should only run once:
// expect: start a
// expect: a defined a value
// expect: start b
// expect: b defined b value
// expect: b imported a value
// expect: end b
// expect: a imported b value
// expect: end a