Skip to content

Commit 314f12c

Browse files
committed
chore: clean-up
1 parent 04f87de commit 314f12c

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

__old/polyfill.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* required polyfills
3+
*/
4+
5+
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
6+
// import "core-js";
7+
// import 'core-js/features/symbol'
8+
// import 'core-js/features/object'
9+
// import 'core-js/features/function'
10+
// import 'core-js/features/parse-int'
11+
// import 'core-js/features/parse-float'
12+
// import 'core-js/features/number'
13+
// import 'core-js/features/math'
14+
// import 'core-js/features/string'
15+
// import 'core-js/features/date'
16+
// import 'core-js/features/array'
17+
// import 'core-js/features/regexp'
18+
// import 'core-js/features/map'
19+
// import 'core-js/features/weak-map'
20+
// import 'core-js/features/set'
21+
// import 'core-js/features/set/map';
22+
23+
/** IE10 and IE11 requires the following for the Reflect API. */
24+
// import 'core-js/features/reflect';
25+
26+
/** Evergreen browsers require these. **/
27+
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
28+
// import 'core-js/features/reflect'
29+
30+
// CustomEvent() constructor functionality in IE9, IE10, IE11
31+
;(function () {
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.prototype = window.Event.prototype
42+
43+
window.CustomEvent = CustomEvent
44+
})()
45+
46+
if (!Element.prototype.matches) {
47+
Element.prototype.matches =
48+
Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector
49+
}
50+
51+
if (!Element.prototype.closest) {
52+
Element.prototype.closest = function (s) {
53+
var el = this
54+
55+
do {
56+
if (Element.prototype.matches.call(el, s)) return el
57+
el = el.parentElement || el.parentNode
58+
} while (el !== null && el.nodeType === 1)
59+
return null
60+
}
61+
}

0 commit comments

Comments
 (0)