]> git.kaiwu.me - njs.git/commit
VM: report import of a module removed after failed compilation
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 30 Sep 2026 06:12:30 +0000 (23:12 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Wed, 30 Sep 2026 18:56:11 +0000 (11:56 -0700)
commite5728cba528ca75993491b2d6d8bb22fb28e732d
treef69d2f724d79a867a11766472b9278ab6005daa1
parentc3e86ead170a5eee0bba90dc4c753438780441ba
VM: report import of a module removed after failed compilation

A module whose compilation fails is removed from the cache, but another
module compiled earlier in the same cycle may still import it.  Executing
such an import returned an error without setting an exception, so the
shell reported an unrelated TypeError.

Throw "Cannot load module" instead, and add a shell test for a cyclic
dependency of a module that fails to compile.
src/njs_vmcode.c
test/js/module/cyclic_compile_exception.js [new file with mode: 0644]
test/js/module/cyclic_compile_exception_dep.js [new file with mode: 0644]
test/shell_test.exp