[7.0] Remove old code used for backwards compatibility (#5122)
[7.0] Remove old code used for backwards compatibility in babel-polyfill Fixes #5121
This commit is contained in:
parent
d710e6dd5b
commit
81c3578adc
@ -7,23 +7,3 @@ global._babelPolyfill = true;
|
||||
|
||||
import "core-js/shim";
|
||||
import "regenerator-runtime/runtime";
|
||||
|
||||
// Should be removed in the next major release:
|
||||
|
||||
import "core-js/fn/regexp/escape";
|
||||
|
||||
const DEFINE_PROPERTY = "defineProperty";
|
||||
function define(O, key, value) {
|
||||
O[key] || Object[DEFINE_PROPERTY](O, key, {
|
||||
writable: true,
|
||||
configurable: true,
|
||||
value: value
|
||||
});
|
||||
}
|
||||
|
||||
define(String.prototype, "padLeft", "".padStart);
|
||||
define(String.prototype, "padRight", "".padEnd);
|
||||
|
||||
"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(key) {
|
||||
[][key] && define(Array, key, Function.call.bind([][key]));
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user