@ 261102.1

260918.6 · 12cdd950e9c6abc45df90cbed15b86eda4ec5669

Register imported libraries in dependency order (#3620)

block_mark_referenced walks the joined block backwards and skips the body of any definition not yet marked referenced, so a library must precede its importers. f58787c41 registered a library before walking its dependencies, to have somewhere to keep the `loading` flag, which reversed that order and made block_drop_unreferenced free definitions that are still referenced through bound_by.

Keep the libraries being loaded on a stack threaded through the load_library frames instead, so registration can move back after the dependency walk.

reading declarations

Changes to tests/modules/deep2a.jq. All files

tests/modules/deep2a.jq

new file mode 100644@@ -0,0 +1,2 @@+import "deep3" as m;+def f: [21, m::f];