Retoor software development Projects Research SearchXNG
Register Sign In

11 lines
254 B
Plaintext
Raw Normal View History

feat: split core module from main and add implicit core imports for all modules Extract core module loading into separate `loadIntoCore` function and `getCoreModule` helper, replacing the old `getMainModule`. Implement `loadModule` that automatically imports all core module variables into every newly loaded module, enabling implicit visibility of core types (Bool, Class, Fiber, etc.) across all user modules. Add `wrenImportModule` public API for module loading with circular import detection. Increase `WREN_MAX_TEMP_ROOTS` from 4 to 5 to accommodate additional GC roots during module loading. Add test cases for cyclic imports (a.wren/b.wren) and implicit core imports (implicitly_imports_core.wren/module.wren).
2015-02-11 19:06:45 +01:00
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
Reference in New Issue Copy Permalink
91efd0d0cc
wren/test/module/cyclic_import/cyclic_import.wren
Response time: 36ms
Mail Licenses API