custom-module: fix context var
This commit is contained in:
parent
cce58c9fc9
commit
732d3d4f4f
1 changed files with 2 additions and 3 deletions
|
|
@ -40,7 +40,7 @@ class OscServer {
|
|||
}
|
||||
})(),
|
||||
mod,
|
||||
context = {
|
||||
context = vm.createContext({
|
||||
console,
|
||||
sendOsc: this.sendOsc.bind(this),
|
||||
receiveOsc: this.receiveOsc.bind(this),
|
||||
|
|
@ -56,10 +56,9 @@ class OscServer {
|
|||
settings,
|
||||
options: customModule.slice(1, customModule.length),
|
||||
module: {},
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
var context = vm.createContext(context)
|
||||
mod = vm.runInContext(file, context)
|
||||
if (context.module.exports) mod = context.module.exports
|
||||
} catch(err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue