[sr-dev] git:master:4a2415e3: app_jsdt: add duk_module_node for JS module resolution

Daniel-Constantin Mierla miconda at gmail.com
Fri Feb 25 08:38:45 CET 2022


Module: kamailio
Branch: master
Commit: 4a2415e33ea75bb103da3561312f7b850c4aedf6
URL: https://github.com/kamailio/kamailio/commit/4a2415e33ea75bb103da3561312f7b850c4aedf6

Author: Ian Carlson <ian at xantek.net>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-02-25T08:38:40+01:00

app_jsdt: add duk_module_node for JS module resolution

- reported by GH #3037
- cb_resolve_module: resolves absolute and relative paths
  resolves absolute if request_id starts with a /
  if parent_id then resolved relative path based parent_id path
  if no parent_id resolves relative path based on app_jsdt load file path
  request_id without /, ./, or ../ are not resolved and return error
- cb_load_module: use jsdt_load_file to load resolved file
- see: https://github.com/svaarala/duktape/tree/master/extras/module-node

---

Added: src/modules/app_jsdt/duk_module_node.c
Added: src/modules/app_jsdt/duk_module_node.h
Modified: src/modules/app_jsdt/app_jsdt_api.c
Modified: src/modules/app_jsdt/app_jsdt_api.h

---

Diff:  https://github.com/kamailio/kamailio/commit/4a2415e33ea75bb103da3561312f7b850c4aedf6.diff
Patch: https://github.com/kamailio/kamailio/commit/4a2415e33ea75bb103da3561312f7b850c4aedf6.patch




More information about the sr-dev mailing list