@ -1,19 +1,10 @@
|
||||
import './global'
|
||||
import '@ms/nashorn'
|
||||
import { Proxy } from './proxy'
|
||||
import { XMLHttpRequest } from './xml-http-request'
|
||||
|
||||
/// <reference path="./global.ts" />
|
||||
/// <reference types='@ms/nashorn' />
|
||||
let ployfillStartTime = new Date().getTime();
|
||||
console.info('Initialization Java Nashorn ployfill. Please wait...');
|
||||
// String contains ployfill
|
||||
Object.defineProperty(String.prototype, 'contains', {
|
||||
value: function(searchString: string, position: number) {
|
||||
return String.prototype.indexOf.call(this, searchString, position) > -1;
|
||||
}
|
||||
})
|
||||
// ES6 Map Symbol ployfill
|
||||
require('es6-map/implement');
|
||||
require('es6-symbol/implement');
|
||||
global.setGlobal('Proxy', Proxy)
|
||||
global.setGlobal('XMLHttpRequest', XMLHttpRequest)
|
||||
require('./es5-ext');
|
||||
require('core-js');
|
||||
global.setGlobal('Proxy', require('./proxy').Proxy)
|
||||
global.setGlobal('XMLHttpRequest', require('./xml-http-request').XMLHttpRequest)
|
||||
global.setGlobal('Blob', require('blob-polyfill').Blob)
|
||||
console.info('Java Nashorn ployfill loading completed... Cost (' + (new Date().getTime() - ployfillStartTime) / 1000 + 's)!');
|
||||
|
Reference in New Issue
Block a user