diff --git a/pom.xml b/pom.xml index eb27782..c8a968f 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 pw.yumc MiaoScript - 0.6.0 + 0.6.5 502647092 diff --git a/src/main/resources/core/ployfill.js b/src/main/resources/core/ployfill.js index 725fe9d..ebd40bd 100644 --- a/src/main/resources/core/ployfill.js +++ b/src/main/resources/core/ployfill.js @@ -11,7 +11,14 @@ global.engineLoad = load; global.noop = global.engineDisable = engineDisable = function () { }; global.load = load = function __PreventGlobalLoadFunction__() { throw new Error('Internal engine system not allow use `load` function!'); } - global.setGlobal = function (key, value) { global[key] = value; }; + global.setGlobal = function (key, value, config) { + if (config) { + config.value = value; + Object.defineProperty(global, key, config) + } else { + global[key] = value; + } + }; // Init console and require global.console = engineLoad('classpath:core/console.js')(logger); console.log("Loading Engine at Thread", java.lang.Thread.currentThread().name)