custom-module: add filename to error traces, add support for node/electron --inspect switch

This commit is contained in:
jean-emmanuel 2019-03-31 18:50:43 +02:00
parent dabd01fca4
commit 55ff84b7cb
2 changed files with 5 additions and 2 deletions

View file

@ -66,7 +66,9 @@ class OscServer {
})
try {
mod = vm.runInContext(file, context)
mod = vm.runInContext(file, context, {
filename: customModule[0]
})
if (context.module.exports) mod = context.module.exports
} catch(err) {
console.error(err)