]> git.kaiwu.me - njs.git/commit
Fixed non-native module importing.
authorhongzhidao <hongzhidao@gmail.com>
Thu, 30 Jan 2020 13:14:30 +0000 (21:14 +0800)
committerhongzhidao <hongzhidao@gmail.com>
Thu, 30 Jan 2020 13:14:30 +0000 (21:14 +0800)
commitf846489fa9b36ca98435d6b8c853aec6f3fc17d9
treef32fede49a0fa9e302176447d07564423df49aa0
parent65308d947f0ca878fb965b31d34d7f2c9ac5105d
Fixed non-native module importing.

Previously, string from "import statement" was used as a key in a hash
to keep track of already loaded modules. This works fine for built-in
modules. It can cause an issue when different modules from different
paths but with identical names are loaded. This patch avoids the issue
by using a full path to a file as a key.

This closes #282 issue on GitHub.
src/njs_module.c
test/module/lib1.js
test/module/libs/hash.js
test/module/libs/name.js [new file with mode: 0644]
test/module/name.js [new file with mode: 0644]
test/module/normal.js
test/module/recursive.js
test/njs_expect_test.exp