diff --git a/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java b/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java index 8c95dca..0108422 100644 --- a/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java +++ b/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java @@ -17,18 +17,16 @@ public class ScriptEngine { private Object logger; private Base base; private MiaoScriptEngine engine; - private ScriptEngineManager manager; public ScriptEngine(String root, Object logger, Object instance) { this.root = root; this.logger = logger; this.base = new Base(instance); - this.manager = new ScriptEngineManager(); } public synchronized MiaoScriptEngine createEngine() { if (this.engine == null) { - this.engine = new MiaoScriptEngine(manager, "nashorn"); + this.engine = new MiaoScriptEngine(new ScriptEngineManager(), "nashorn"); this.engine.put("base", this.base); this.engine.put("ScriptEngineContextHolder", this); } diff --git a/src/main/resources/core/ployfill.js b/src/main/resources/core/ployfill.js index 72700cc..19a25b4 100644 --- a/src/main/resources/core/ployfill.js +++ b/src/main/resources/core/ployfill.js @@ -9,7 +9,7 @@ global.logger = logger; global.ScriptEngineStartTime = new Date().getTime() global.engineLoad = load; - global.noop = global.engineDisable = engineDisable = function () { }; + global.noop = function () { }; global.load = load = function __PreventGlobalLoadFunction__() { throw new Error('Internal engine system not allow use `load` function!'); } global.setGlobal = function (key, value, config) { if (config) {