feat: move ployfill to @ms/ployfill
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
8933afeb71
commit
57926ba788
@ -1,22 +1,25 @@
|
|||||||
(function(root, logger) {
|
(
|
||||||
// Init Global Value
|
/**
|
||||||
global.root = root;
|
* @param {string} root
|
||||||
global.logger = logger;
|
* @param {any} logger
|
||||||
// Init Global Function
|
*/
|
||||||
global.noop = global.engineDisable = function() { };
|
function(root, logger) {
|
||||||
global.engineLoad = load;
|
// Init Global Value
|
||||||
global.load = load = function __PreventGlobalLoadFunction__() {
|
global.root = root;
|
||||||
throw new Error('Internal engine system not allow use `load` function!');
|
global.logger = logger;
|
||||||
};
|
// Init Global Function
|
||||||
// Init console and require
|
global.noop = global.engineDisable = function() { };
|
||||||
global.XMLHttpRequest = undefined;
|
global.engineLoad = load;
|
||||||
global.console = engineLoad(global.root + '/core/console.js')(logger);
|
global.load = load = function __PreventGlobalLoadFunction__() {
|
||||||
global.require = engineLoad(global.root + '/core/require.js')(root);
|
throw new Error('Internal engine system not allow use `load` function!');
|
||||||
// String contains ployfill
|
}
|
||||||
String.prototype.contains = function(searchString, position) {
|
global.NashornEngineStartTime = new Date().getTime()
|
||||||
return String.prototype.indexOf.call(this, searchString, position) > -1;
|
// Init console and require
|
||||||
};
|
global.setGlobal = function(key, value) {
|
||||||
// ES6 Map Symbol ployfill
|
global[key] = value;
|
||||||
require('es6-map/implement');
|
}
|
||||||
require('es6-symbol/implement');
|
global.console = engineLoad(global.root + '/core/console.js')(logger);
|
||||||
});
|
global.require = engineLoad(global.root + '/core/require.js')(root);
|
||||||
|
require('@ms/ployfill')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user