diff --git a/src/compiler/compiler.js b/src/compiler/compiler.js index f7c7f7e0..9d44b958 100644 --- a/src/compiler/compiler.js +++ b/src/compiler/compiler.js @@ -210,7 +210,7 @@ class ScriptCompiler { compile() { const compiledStack = this.compileStack(this.topBlock); const script = this.createScriptFactory(compiledStack); - const fn = execute.createScriptFactory(script); + const fn = execute.scopedEval(script); log.info(`[${this.target.getName()}] compiled script`, script); return fn; } diff --git a/src/compiler/execute.js b/src/compiler/execute.js index c3cfda4c..d32e6521 100644 --- a/src/compiler/execute.js +++ b/src/compiler/execute.js @@ -428,11 +428,10 @@ const execute = (_thread) => { }; /** - * Evaluate a continuation from its source code. - * Prepares the necessary environment. + * eval() some JS * @param {string} source */ -const createScriptFactory = (source) => { +const scopedEval = (source) => { try { return eval(source); } catch (e) { @@ -441,6 +440,6 @@ const createScriptFactory = (source) => { } }; -execute.createScriptFactory = createScriptFactory; +execute.scopedEval = scopedEval; module.exports = execute;