]> git.kaiwu.me - njs.git/commit
Parser: release non-global semantic state
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 3 Sep 2026 15:53:14 +0000 (08:53 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 10 Sep 2026 03:11:04 +0000 (20:11 -0700)
commite5696ba5854a895f941abbf370c26c01d0b93b49
tree68171043e073345fdcfe84160f5c1e79e0ad3a2b
parentf560e1cf74630e2c1461b5da3748d5a02de426e1
Parser: release non-global semantic state

Allocate non-global scopes, local variables, variable tree nodes, references,
and declaration arrays from the compilation pool.  The global scope and its
symbol table remain persistent for runtime lookup and later compilation.

Build closure-index arrays temporarily, then copy the finalized indexes into
VM-owned storage referenced by each lambda.  Preserve declaration-origin type
without retaining pointers to released block scopes.
src/njs_function.c
src/njs_generator.c
src/njs_parser.c
src/njs_parser.h
src/njs_variable.c
src/njs_variable.h
src/njs_vm.c
src/test/njs_unit_test.c