|
1 |
| -// IE11 polyfills |
2 |
| - |
3 |
| -if (!Array..find) { |
4 |
| -Array..find = function(predicate) { |
5 |
| -if (this == null) { |
6 |
| -throw new TypeError('Array..find called on null or undefined'); |
7 |
| -} |
8 |
| -if (typeof predicate !== 'function') { |
9 |
| -throw new TypeError('predicate must be a function'); |
10 |
| -} |
11 |
| -const list = Object(this); |
12 |
| -const length = list.length >>> 0; |
13 |
| -const thisArg = arguments[1]; |
14 |
| -let value; |
15 |
| - |
16 |
| -for (let i = 0; i < length; i++) { |
17 |
| -value = list[i]; |
18 |
| -if (predicate.call(thisArg, value, i, list)) { |
19 |
| -return value; |
20 |
| -} |
21 |
| -} |
22 |
| -return undefined; |
23 |
| -}; |
24 |
| -} |
| 1 | +/* |
| 2 | +* required polyfills |
| 3 | +*/ |
| 4 | + |
| 5 | +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ |
| 6 | +// import 'core-js/es6/symbol' |
| 7 | +// import 'core-js/es6/object' |
| 8 | +// import 'core-js/es6/function' |
| 9 | +// import 'core-js/es6/parse-int' |
| 10 | +// import 'core-js/es6/parse-float' |
| 11 | +// import 'core-js/es6/number' |
| 12 | +// import 'core-js/es6/math' |
| 13 | +// import 'core-js/es6/string' |
| 14 | +// import 'core-js/es6/date' |
| 15 | +import 'core-js/es6/array' |
| 16 | +// import 'core-js/es6/regexp' |
| 17 | +import 'core-js/es6/map' |
| 18 | +// import 'core-js/es6/weak-map' |
| 19 | +import 'core-js/es6/set' |
| 20 | +import 'core-js/es7/object' |
| 21 | + |
| 22 | +/** IE10 and IE11 requires the following for the Reflect API. */ |
| 23 | +// import 'core-js/es6/reflect' |
| 24 | + |
| 25 | +/** Evergreen browsers require these. **/ |
| 26 | +// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. |
| 27 | +// import 'core-js/es7/reflect' |
| 28 | + |
| 29 | +// CustomEvent() constructor functionality in IE9, IE10, IE11 |
| 30 | +(function () { |
| 31 | + |
| 32 | +if ( typeof window.CustomEvent === "function" ) return false |
| 33 | + |
| 34 | +function CustomEvent ( event, params ) { |
| 35 | +params = params || { bubbles: false, cancelable: false, detail: undefined } |
| 36 | +var evt = document.createEvent( 'CustomEvent' ) |
| 37 | +evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ) |
| 38 | +return evt |
| 39 | +} |
| 40 | + |
| 41 | +CustomEvent. = window.Event. |
| 42 | + |
| 43 | +window.CustomEvent = CustomEvent |
| 44 | +})() |
0 commit comments