From 96639d0978624976c5c14e052f91c214e899b993 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Mon, 9 Sep 2019 14:48:19 +0800 Subject: [PATCH] feat: add comment Signed-off-by: MiaoWoo --- src/main/resources/core/ployfill.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/resources/core/ployfill.js b/src/main/resources/core/ployfill.js index 17e4d35..de4c630 100644 --- a/src/main/resources/core/ployfill.js +++ b/src/main/resources/core/ployfill.js @@ -1,17 +1,21 @@ (function(root, logger) { + // Init Global Value global.root = root; global.logger = logger; + // Init Global Function global.noop = global.engineDisable = function() { }; - // disable global.engineLoad = load; global.load = function __PreventGlobalLoadFunction__() { throw new Error('Internal engine system not allow use `load` function!'); }; + // Init console and require global.console = engineLoad(global.root + '/core/console.js')(logger); global.require = engineLoad(global.root + '/core/require.js')(root); - String.prototype.contains = function(searchString/*, position*/) { - return String.prototype.indexOf.call(this, searchString, arguments[1]) > -1; + // String contains playfill + String.prototype.contains = function(searchString, position) { + return String.prototype.indexOf.call(this, searchString, position) > -1; }; + // ES6 Map Symbol playfill require('es6-map/implement'); require('es6-symbol/implement'); });