feat: move ployfill to @ms/ployfill

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-02-01 02:40:39 +08:00
parent 8933afeb71
commit 57926ba788

View File

@ -1,4 +1,9 @@
(function(root, logger) { (
/**
* @param {string} root
* @param {any} logger
*/
function(root, logger) {
// Init Global Value // Init Global Value
global.root = root; global.root = root;
global.logger = logger; global.logger = logger;
@ -7,16 +12,14 @@
global.engineLoad = load; global.engineLoad = load;
global.load = load = function __PreventGlobalLoadFunction__() { global.load = load = function __PreventGlobalLoadFunction__() {
throw new Error('Internal engine system not allow use `load` function!'); throw new Error('Internal engine system not allow use `load` function!');
}; }
global.NashornEngineStartTime = new Date().getTime()
// Init console and require // Init console and require
global.XMLHttpRequest = undefined; global.setGlobal = function(key, value) {
global[key] = value;
}
global.console = engineLoad(global.root + '/core/console.js')(logger); global.console = engineLoad(global.root + '/core/console.js')(logger);
global.require = engineLoad(global.root + '/core/require.js')(root); global.require = engineLoad(global.root + '/core/require.js')(root);
// String contains ployfill require('@ms/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');
});