diff --git a/src/main/resources/core/ployfill.js b/src/main/resources/core/ployfill.js index 2ae3719..b51f017 100644 --- a/src/main/resources/core/ployfill.js +++ b/src/main/resources/core/ployfill.js @@ -1,22 +1,25 @@ -(function(root, logger) { - // Init Global Value - global.root = root; - global.logger = logger; - // Init Global Function - global.noop = global.engineDisable = function() { }; - global.engineLoad = load; - global.load = load = function __PreventGlobalLoadFunction__() { - throw new Error('Internal engine system not allow use `load` function!'); - }; - // Init console and require - global.XMLHttpRequest = undefined; - global.console = engineLoad(global.root + '/core/console.js')(logger); - global.require = engineLoad(global.root + '/core/require.js')(root); - // String contains ployfill - String.prototype.contains = function(searchString, position) { - return String.prototype.indexOf.call(this, searchString, position) > -1; - }; - // ES6 Map Symbol ployfill - require('es6-map/implement'); - require('es6-symbol/implement'); -}); +( + /** + * @param {string} root + * @param {any} logger + */ + function(root, logger) { + // Init Global Value + global.root = root; + global.logger = logger; + // Init Global Function + global.noop = global.engineDisable = function() { }; + global.engineLoad = load; + global.load = load = function __PreventGlobalLoadFunction__() { + throw new Error('Internal engine system not allow use `load` function!'); + } + global.NashornEngineStartTime = new Date().getTime() + // Init console and require + global.setGlobal = function(key, value) { + global[key] = value; + } + global.console = engineLoad(global.root + '/core/console.js')(logger); + global.require = engineLoad(global.root + '/core/require.js')(root); + require('@ms/ployfill') + } +);