aboutsummaryrefslogtreecommitdiffstats
path: root/dist/plyr.polyfilled.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'dist/plyr.polyfilled.mjs')
-rw-r--r--dist/plyr.polyfilled.mjs1290
1 files changed, 708 insertions, 582 deletions
diff --git a/dist/plyr.polyfilled.mjs b/dist/plyr.polyfilled.mjs
index ad1e571f..5e76caf0 100644
--- a/dist/plyr.polyfilled.mjs
+++ b/dist/plyr.polyfilled.mjs
@@ -90,6 +90,8 @@ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Nashorn ~ JDK8 bug
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
+// `Object.prototype.propertyIsEnumerable` method implementation
+// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
@@ -114,12 +116,9 @@ var classofRaw = function (it) {
return toString.call(it).slice(8, -1);
};
-// fallback for non-array-like ES3 and non-enumerable old V8 strings
-
-
-
var split = ''.split;
+// fallback for non-array-like ES3 and non-enumerable old V8 strings
var indexedObject = fails(function () {
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
// eslint-disable-next-line no-prototype-builtins
@@ -147,15 +146,16 @@ var isObject = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
-// 7.1.1 ToPrimitive(input [, PreferredType])
+// `ToPrimitive` abstract operation
+// https://tc39.github.io/ecma262/#sec-toprimitive
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
-var toPrimitive = function (it, S) {
- if (!isObject(it)) return it;
+var toPrimitive = function (input, PREFERRED_STRING) {
+ if (!isObject(input)) return input;
var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
+ if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
+ if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
+ if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
throw TypeError("Can't convert object to primitive value");
};
@@ -167,10 +167,10 @@ var has = function (it, key) {
var document$1 = global_1.document;
// typeof document.createElement is 'object' in old IE
-var exist = isObject(document$1) && isObject(document$1.createElement);
+var EXISTS = isObject(document$1) && isObject(document$1.createElement);
var documentCreateElement = function (it) {
- return exist ? document$1.createElement(it) : {};
+ return EXISTS ? document$1.createElement(it) : {};
};
// Thank's IE8 for his funny defineProperty
@@ -182,6 +182,8 @@ var ie8DomDefine = !descriptors && !fails(function () {
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+// `Object.getOwnPropertyDescriptor` method
+// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPrimitive(P, true);
@@ -203,6 +205,8 @@ var anObject = function (it) {
var nativeDefineProperty = Object.defineProperty;
+// `Object.defineProperty` method
+// https://tc39.github.io/ecma262/#sec-object.defineproperty
var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
@@ -259,7 +263,7 @@ var id = 0;
var postfix = Math.random();
var uid = function (key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + postfix).toString(36));
+ return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
};
var keys = shared('keys');
@@ -358,6 +362,17 @@ shared('inspectSource', function (it) {
});
});
+var path = global_1;
+
+var aFunction = function (variable) {
+ return typeof variable == 'function' ? variable : undefined;
+};
+
+var getBuiltIn = function (namespace, method) {
+ return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
+ : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
+};
+
var ceil = Math.ceil;
var floor = Math.floor;
@@ -387,11 +402,7 @@ var toAbsoluteIndex = function (index, length) {
};
// `Array.prototype.{ indexOf, includes }` methods implementation
-// false -> Array#indexOf
-// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
-// true -> Array#includes
-// https://tc39.github.io/ecma262/#sec-array.prototype.includes
-var arrayIncludes = function (IS_INCLUDES) {
+var createMethod = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = toLength(O.length);
@@ -404,13 +415,23 @@ var arrayIncludes = function (IS_INCLUDES) {
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
- if (O[index] === el) return IS_INCLUDES || index || 0;
+ } else for (;length > index; index++) {
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
-var arrayIndexOf = arrayIncludes(false);
+var arrayIncludes = {
+ // `Array.prototype.includes` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.includes
+ includes: createMethod(true),
+ // `Array.prototype.indexOf` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
+ indexOf: createMethod(false)
+};
+
+var indexOf = arrayIncludes.indexOf;
+
var objectKeysInternal = function (object, names) {
var O = toIndexedObject(object);
@@ -420,7 +441,7 @@ var objectKeysInternal = function (object, names) {
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
- ~arrayIndexOf(result, key) || result.push(key);
+ ~indexOf(result, key) || result.push(key);
}
return result;
};
@@ -436,12 +457,10 @@ var enumBugKeys = [
'valueOf'
];
-// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
-
-
-
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
+// `Object.getOwnPropertyNames` method
+// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return objectKeysInternal(O, hiddenKeys$1);
};
@@ -456,10 +475,8 @@ var objectGetOwnPropertySymbols = {
f: f$4
};
-var Reflect = global_1.Reflect;
-
// all object keys, includes non-enumerable and symbols
-var ownKeys = Reflect && Reflect.ownKeys || function ownKeys(it) {
+var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
var keys = objectGetOwnPropertyNames.f(anObject(it));
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
@@ -555,61 +572,6 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
return !String(Symbol());
});
-var Symbol$1 = global_1.Symbol;
-var store$1 = shared('wks');
-
-var wellKnownSymbol = function (name) {
- return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
- || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
-};
-
-var defineProperty = objectDefineProperty.f;
-
-
-
-var TO_STRING_TAG = wellKnownSymbol('toStringTag');
-
-var setToStringTag = function (it, TAG, STATIC) {
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
- defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
- }
-};
-
-var f$5 = wellKnownSymbol;
-
-var wrappedWellKnownSymbol = {
- f: f$5
-};
-
-var path = global_1;
-
-var defineProperty$1 = objectDefineProperty.f;
-
-var defineWellKnownSymbol = function (NAME) {
- var Symbol = path.Symbol || (path.Symbol = {});
- if (!has(Symbol, NAME)) defineProperty$1(Symbol, NAME, {
- value: wrappedWellKnownSymbol.f(NAME)
- });
-};
-
-// 19.1.2.14 / 15.2.3.14 Object.keys(O)
-var objectKeys = Object.keys || function keys(O) {
- return objectKeysInternal(O, enumBugKeys);
-};
-
-// all enumerable object keys, includes symbols
-var enumKeys = function (it) {
- var result = objectKeys(it);
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
- if (getOwnPropertySymbols) {
- var symbols = getOwnPropertySymbols(it);
- var propertyIsEnumerable = objectPropertyIsEnumerable.f;
- var i = 0;
- var key;
- while (symbols.length > i) if (propertyIsEnumerable.call(it, key = symbols[i++])) result.push(key);
- } return result;
-};
-
// `IsArray` abstract operation
// https://tc39.github.io/ecma262/#sec-isarray
var isArray = Array.isArray || function isArray(arg) {
@@ -622,19 +584,25 @@ var toObject = function (argument) {
return Object(requireObjectCoercible(argument));
};
+// `Object.keys` method
+// https://tc39.github.io/ecma262/#sec-object.keys
+var objectKeys = Object.keys || function keys(O) {
+ return objectKeysInternal(O, enumBugKeys);
+};
+
+// `Object.defineProperties` method
+// https://tc39.github.io/ecma262/#sec-object.defineproperties
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = objectKeys(Properties);
var length = keys.length;
- var i = 0;
+ var index = 0;
var key;
- while (length > i) objectDefineProperty.f(O, key = keys[i++], Properties[key]);
+ while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
return O;
};
-var document$2 = global_1.document;
-
-var html = document$2 && document$2.documentElement;
+var html = getBuiltIn('document', 'documentElement');
var IE_PROTO = sharedKey('IE_PROTO');
@@ -663,7 +631,8 @@ var createDict = function () {
return createDict();
};
-// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
+// `Object.create` method
+// https://tc39.github.io/ecma262/#sec-object.create
var objectCreate = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
@@ -694,34 +663,178 @@ var getWindowNames = function (it) {
};
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
-var f$6 = function getOwnPropertyNames(it) {
+var f$5 = function getOwnPropertyNames(it) {
return windowNames && toString$1.call(it) == '[object Window]'
? getWindowNames(it)
: nativeGetOwnPropertyNames(toIndexedObject(it));
};
var objectGetOwnPropertyNamesExternal = {
+ f: f$5
+};
+
+var Symbol$1 = global_1.Symbol;
+var store$1 = shared('wks');
+
+var wellKnownSymbol = function (name) {
+ return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
+ || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
+};
+
+var f$6 = wellKnownSymbol;
+
+var wrappedWellKnownSymbol = {
f: f$6
};
+var defineProperty = objectDefineProperty.f;
+
+var defineWellKnownSymbol = function (NAME) {
+ var Symbol = path.Symbol || (path.Symbol = {});
+ if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
+ value: wrappedWellKnownSymbol.f(NAME)
+ });
+};
+
+var defineProperty$1 = objectDefineProperty.f;
+
+
+
+var TO_STRING_TAG = wellKnownSymbol('toStringTag');
+
+var setToStringTag = function (it, TAG, STATIC) {
+ if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
+ defineProperty$1(it, TO_STRING_TAG, { configurable: true, value: TAG });
+ }
+};
+
+var aFunction$1 = function (it) {
+ if (typeof it != 'function') {
+ throw TypeError(String(it) + ' is not a function');
+ } return it;
+};
+
+// optional / simple context binding
+var bindContext = function (fn, that, length) {
+ aFunction$1(fn);
+ if (that === undefined) return fn;
+ switch (length) {
+ case 0: return function () {
+ return fn.call(that);
+ };
+ case 1: return function (a) {
+ return fn.call(that, a);
+ };
+ case 2: return function (a, b) {
+ return fn.call(that, a, b);
+ };
+ case 3: return function (a, b, c) {
+ return fn.call(that, a, b, c);
+ };
+ }
+ return function (/* ...args */) {
+ return fn.apply(that, arguments);
+ };
+};
+
+var SPECIES = wellKnownSymbol('species');
+
+// `ArraySpeciesCreate` abstract operation
+// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
+var arraySpeciesCreate = function (originalArray, length) {
+ var C;
+ if (isArray(originalArray)) {
+ C = originalArray.constructor;
+ // cross-realm fallback
+ if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
+ else if (isObject(C)) {
+ C = C[SPECIES];
+ if (C === null) C = undefined;
+ }
+ } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
+};
+
+var push = [].push;
+
+// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
+var createMethod$1 = function (TYPE) {
+ var IS_MAP = TYPE == 1;
+ var IS_FILTER = TYPE == 2;
+ var IS_SOME = TYPE == 3;
+ var IS_EVERY = TYPE == 4;
+ var IS_FIND_INDEX = TYPE == 6;
+ var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
+ return function ($this, callbackfn, that, specificCreate) {
+ var O = toObject($this);
+ var self = indexedObject(O);
+ var boundFunction = bindContext(callbackfn, that, 3);
+ var length = toLength(self.length);
+ var index = 0;
+ var create = specificCreate || arraySpeciesCreate;
+ var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
+ var value, result;
+ for (;length > index; index++) if (NO_HOLES || index in self) {
+ value = self[index];
+ result = boundFunction(value, index, O);
+ if (TYPE) {
+ if (IS_MAP) target[index] = result; // map
+ else if (result) switch (TYPE) {
+ case 3: return true; // some
+ case 5: return value; // find
+ case 6: return index; // findIndex
+ case 2: push.call(target, value); // filter
+ } else if (IS_EVERY) return false; // every
+ }
+ }
+ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
+ };
+};
+
+var arrayIteration = {
+ // `Array.prototype.forEach` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
+ forEach: createMethod$1(0),
+ // `Array.prototype.map` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.map
+ map: createMethod$1(1),
+ // `Array.prototype.filter` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.filter
+ filter: createMethod$1(2),
+ // `Array.prototype.some` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.some
+ some: createMethod$1(3),
+ // `Array.prototype.every` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.every
+ every: createMethod$1(4),
+ // `Array.prototype.find` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.find
+ find: createMethod$1(5),
+ // `Array.prototype.findIndex` method
+ // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
+ findIndex: createMethod$1(6)
+};
+
+var $forEach = arrayIteration.forEach;
+
var HIDDEN = sharedKey('hidden');
var SYMBOL = 'Symbol';
+var PROTOTYPE$1 = 'prototype';
+var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
var setInternalState = internalState.set;
var getInternalState = internalState.getterFor(SYMBOL);
-var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
-var nativeDefineProperty$1 = objectDefineProperty.f;
-var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
+var ObjectPrototype = Object[PROTOTYPE$1];
var $Symbol = global_1.Symbol;
var JSON$1 = global_1.JSON;
var nativeJSONStringify = JSON$1 && JSON$1.stringify;
-var PROTOTYPE$1 = 'prototype';
-var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
+var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
+var nativeDefineProperty$1 = objectDefineProperty.f;
+var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
-var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var ObjectPrototypeSymbols = shared('op-symbols');
+var StringToSymbolRegistry = shared('string-to-symbol-registry');
+var SymbolToStringRegistry = shared('symbol-to-string-registry');
var WellKnownSymbolsStore = shared('wks');
-var ObjectPrototype = Object[PROTOTYPE$1];
var QObject = global_1.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
@@ -731,12 +844,12 @@ var setSymbolDescriptor = descriptors && fails(function () {
return objectCreate(nativeDefineProperty$1({}, 'a', {
get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; }
})).a != 7;
-}) ? function (it, key, D) {
- var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype, key);
- if (ObjectPrototypeDescriptor) delete ObjectPrototype[key];
- nativeDefineProperty$1(it, key, D);
- if (ObjectPrototypeDescriptor && it !== ObjectPrototype) {
- nativeDefineProperty$1(ObjectPrototype, key, ObjectPrototypeDescriptor);
+}) ? function (O, P, Attributes) {
+ var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype, P);
+ if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
+ nativeDefineProperty$1(O, P, Attributes);
+ if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
+ nativeDefineProperty$1(ObjectPrototype, P, ObjectPrototypeDescriptor);
}
} : nativeDefineProperty$1;
@@ -757,70 +870,73 @@ var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (i
return Object(it) instanceof $Symbol;
};
-var $defineProperty = function defineProperty(it, key, D) {
- if (it === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, key, D);
- anObject(it);
- key = toPrimitive(key, true);
- anObject(D);
+var $defineProperty = function defineProperty(O, P, Attributes) {
+ if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
+ anObject(O);
+ var key = toPrimitive(P, true);
+ anObject(Attributes);
if (has(AllSymbols, key)) {
- if (!D.enumerable) {
- if (!has(it, HIDDEN)) nativeDefineProperty$1(it, HIDDEN, createPropertyDescriptor(1, {}));
- it[HIDDEN][key] = true;
+ if (!Attributes.enumerable) {
+ if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {}));
+ O[HIDDEN][key] = true;
} else {
- if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
- D = objectCreate(D, { enumerable: createPropertyDescriptor(0, false) });
- } return setSymbolDescriptor(it, key, D);
- } return nativeDefineProperty$1(it, key, D);
+ if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
+ Attributes = objectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
+ } return setSymbolDescriptor(O, key, Attributes);
+ } return nativeDefineProperty$1(O, key, Attributes);
};
-var $defineProperties = function defineProperties(it, P) {
- anObject(it);
- var keys = enumKeys(P = toIndexedObject(P));
- var i = 0;
- var l = keys.length;
- var key;
- while (l > i) $defineProperty(it, key = keys[i++], P[key]);
- return it;
+var $defineProperties = function defineProperties(O, Properties) {
+ anObject(O);
+ var properties = toIndexedObject(Properties);
+ var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
+ $forEach(keys, function (key) {
+ if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
+ });
+ return O;
};
-var $create = function create(it, P) {
- return P === undefined ? objectCreate(it) : $defineProperties(objectCreate(it), P);
+var $create = function create(O, Properties) {
+ return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties);
};
-var $propertyIsEnumerable = function propertyIsEnumerable(key) {
- var E = nativePropertyIsEnumerable$1.call(this, key = toPrimitive(key, true));
- if (this === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return false;
- return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
+var $propertyIsEnumerable = function propertyIsEnumerable(V) {
+ var P = toPrimitive(V, true);
+ var enumerable = nativePropertyIsEnumerable$1.call(this, P);
+ if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
+ return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
};
-var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
- it = toIndexedObject(it);
- key = toPrimitive(key, true);
+var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
+ var it = toIndexedObject(O);
+ var key = toPrimitive(P, true);
if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
- var D = nativeGetOwnPropertyDescriptor$1(it, key);
- if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
- return D;
+ var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
+ if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
+ descriptor.enumerable = true;
+ }
+ return descriptor;
};
-var $getOwnPropertyNames = function getOwnPropertyNames(it) {
- var names = nativeGetOwnPropertyNames$1(toIndexedObject(it));
+var $getOwnPropertyNames = function getOwnPropertyNames(O) {
+ var names = nativeGetOwnPropertyNames$1(toIndexedObject(O));
var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (!has(AllSymbols, key = names[i++]) && !has(hiddenKeys, key)) result.push(key);
- } return result;
+ $forEach(names, function (key) {
+ if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
+ });
+ return result;
};
-var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
- var IS_OP = it === ObjectPrototype;
- var names = nativeGetOwnPropertyNames$1(IS_OP ? ObjectPrototypeSymbols : toIndexedObject(it));
+var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
+ var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
+ var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectPrototype, key) : true)) result.push(AllSymbols[key]);
- } return result;
+ $forEach(names, function (key) {
+ if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
+ result.push(AllSymbols[key]);
+ }
+ });
+ return result;
};
// `Symbol` constructor
@@ -828,7 +944,7 @@ var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
if (!nativeSymbol) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
- var description = arguments[0] === undefined ? undefined : String(arguments[0]);
+ var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
var tag = uid(description);
var setter = function (value) {
if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
@@ -838,6 +954,7 @@ if (!nativeSymbol) {
if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
return wrap(tag, description);
};
+
redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
return getInternalState(this).tag;
});
@@ -870,23 +987,26 @@ _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }
Symbol: $Symbol
});
-for (var wellKnownSymbols = objectKeys(WellKnownSymbolsStore), k = 0; wellKnownSymbols.length > k;) {
- defineWellKnownSymbol(wellKnownSymbols[k++]);
-}
+$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
+ defineWellKnownSymbol(name);
+});
_export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
// `Symbol.for` method
// https://tc39.github.io/ecma262/#sec-symbol.for
'for': function (key) {
- return has(SymbolRegistry, key += '')
- ? SymbolRegistry[key]
- : SymbolRegistry[key] = $Symbol(key);
+ var string = String(key);
+ if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
+ var symbol = $Symbol(string);
+ StringToSymbolRegistry[string] = symbol;
+ SymbolToStringRegistry[symbol] = string;
+ return symbol;
},
// `Symbol.keyFor` method
// https://tc39.github.io/ecma262/#sec-symbol.keyfor
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
- for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
+ if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
},
useSetter: function () { USE_SETTER = true; },
useSimple: function () { USE_SETTER = false; }
@@ -937,9 +1057,9 @@ JSON$1 && _export({ target: 'JSON', stat: true, forced: !nativeSymbol || fails(f
}) }, {
stringify: function stringify(it) {
var args = [it];
- var i = 1;
+ var index = 1;
var replacer, $replacer;
- while (arguments.length > i) args.push(arguments[i++]);
+ while (arguments.length > index) args.push(arguments[index++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value) {
@@ -1032,7 +1152,8 @@ var correctPrototypeGetter = !fails(function () {
var IE_PROTO$1 = sharedKey('IE_PROTO');
var ObjectPrototype$1 = Object.prototype;
-// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
+// `Object.getPrototypeOf` method
+// https://tc39.github.io/ecma262/#sec-object.getprototypeof
var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
O = toObject(O);
if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
@@ -1086,27 +1207,29 @@ var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
return IteratorConstructor;
};
-var validateSetPrototypeOfArguments = function (O, proto) {
- anObject(O);
- if (!isObject(proto) && proto !== null) {
- throw TypeError("Can't set " + String(proto) + ' as a prototype');
- }
+var aPossiblePrototype = function (it) {
+ if (!isObject(it) && it !== null) {
+ throw TypeError("Can't set " + String(it) + ' as a prototype');
+ } return it;
};
+// `Object.setPrototypeOf` method
+// https://tc39.github.io/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
- var correctSetter = false;
+ var CORRECT_SETTER = false;
var test = {};
var setter;
try {
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
setter.call(test, []);
- correctSetter = test instanceof Array;
+ CORRECT_SETTER = test instanceof Array;
} catch (error) { /* empty */ }
return function setPrototypeOf(O, proto) {
- validateSetPrototypeOfArguments(O, proto);
- if (correctSetter) setter.call(O, proto);
+ anObject(O);
+ aPossiblePrototype(proto);
+ if (CORRECT_SETTER) setter.call(O, proto);
else O.__proto__ = proto;
return O;
};
@@ -1263,29 +1386,27 @@ var createProperty = function (object, key, value) {
else object[propertyKey] = value;
};
-var SPECIES = wellKnownSymbol('species');
+var SPECIES$1 = wellKnownSymbol('species');
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
return !fails(function () {
var array = [];
var constructor = array.constructor = {};
- constructor[SPECIES] = function () {
+ constructor[SPECIES$1] = function () {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};
-var SPECIES$1 = wellKnownSymbol('species');
+var SPECIES$2 = wellKnownSymbol('species');
var nativeSlice = [].slice;
var max$1 = Math.max;
-var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
-
// `Array.prototype.slice` method
// https://tc39.github.io/ecma262/#sec-array.prototype.slice
// fallback for not array-like ES3 strings and DOM objects
-_export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT }, {
+_export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
slice: function slice(start, end) {
var O = toIndexedObject(this);
var length = toLength(O.length);
@@ -1299,7 +1420,7 @@ _export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT }, {
if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
Constructor = undefined;
} else if (isObject(Constructor)) {
- Constructor = Constructor[SPECIES$1];
+ Constructor = Constructor[SPECIES$2];
if (Constructor === null) Constructor = undefined;
}
if (Constructor === Array || Constructor === undefined) {
@@ -1363,14 +1484,15 @@ var regexpFlags = function () {
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
+ if (that.dotAll) result += 's';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
var TO_STRING = 'toString';
-var nativeToString = /./[TO_STRING];
var RegExpPrototype = RegExp.prototype;
+var nativeToString = RegExpPrototype[TO_STRING];
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
// FF44- RegExp#toString has a wrong name
@@ -1388,21 +1510,35 @@ if (NOT_GENERIC || INCORRECT_NAME) {
}, { unsafe: true });
}
-// CONVERT_TO_STRING: true -> String#at
-// CONVERT_TO_STRING: false -> String#codePointAt
-var stringAt = function (that, pos, CONVERT_TO_STRING) {
- var S = String(requireObjectCoercible(that));
- var position = toInteger(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
- first = S.charCodeAt(position);
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
- ? CONVERT_TO_STRING ? S.charAt(position) : first
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
+// `String.prototype.{ codePointAt, at }` methods implementation
+var createMethod$2 = function (CONVERT_TO_STRING) {
+ return function ($this, pos) {
+ var S = String(requireObjectCoercible($this));
+ var position = toInteger(pos);
+ var size = S.length;
+ var first, second;
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
+ first = S.charCodeAt(position);
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
+ || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
+ ? CONVERT_TO_STRING ? S.charAt(position) : first
+ : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
+ };
+};
+
+var stringMultibyte = {
+ // `String.prototype.codePointAt` method
+ // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
+ codeAt: createMethod$2(false),
+ // `String.prototype.at` method
+ // https://github.com/mathiasbynens/String.prototype.at
+ charAt: createMethod$2(true)
};
+var charAt = stringMultibyte.charAt;
+
+
+
var STRING_ITERATOR = 'String Iterator';
var setInternalState$2 = internalState.set;
var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
@@ -1423,7 +1559,7 @@ defineIterator(String, 'String', function (iterated) {
var index = state.index;
var point;
if (index >= string.length) return { value: undefined, done: true };
- point = stringAt(string, index, true);
+ point = charAt(string, index);
state.index += point.length;
return { value: point, done: false };
});
@@ -1480,7 +1616,7 @@ if (PATCH) {
var regexpExec = patchedExec;
-var SPECIES$2 = wellKnownSymbol('species');
+var SPECIES$3 = wellKnownSymbol('species');
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
// #replace needs built-in support for named groups.
@@ -1525,7 +1661,7 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
- re.constructor[SPECIES$2] = function () { return re; };
+ re.constructor[SPECIES$3] = function () { return re; };
}
re[SYMBOL]('');
@@ -1567,10 +1703,12 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
}
};
+var charAt$1 = stringMultibyte.charAt;
+
// `AdvanceStringIndex` abstract operation
// https://tc39.github.io/ecma262/#sec-advancestringindex
var advanceStringIndex = function (S, index, unicode) {
- return index + (unicode ? stringAt(S, index, true).length : 1);
+ return index + (unicode ? charAt$1(S, index).length : 1);
};
// `RegExpExec` abstract operation
@@ -1753,20 +1891,14 @@ var isRegexp = function (it) {
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
};
-var aFunction = function (it) {
- if (typeof it != 'function') {
- throw TypeError(String(it) + ' is not a function');
- } return it;
-};
-
-var SPECIES$3 = wellKnownSymbol('species');
+var SPECIES$4 = wellKnownSymbol('species');
// `SpeciesConstructor` abstract operation
// https://tc39.github.io/ecma262/#sec-speciesconstructor
var speciesConstructor = function (O, defaultConstructor) {
var C = anObject(O).constructor;
var S;
- return C === undefined || (S = anObject(C)[SPECIES$3]) == undefined ? defaultConstructor : aFunction(S);
+ return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
};
var arrayPush = [].push;
@@ -1928,101 +2060,13 @@ var domIterables = {
TouchList: 0
};
-// optional / simple context binding
-var bindContext = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 0: return function () {
- return fn.call(that);
- };
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
-};
+var $forEach$1 = arrayIteration.forEach;
-var SPECIES$4 = wellKnownSymbol('species');
-
-// `ArraySpeciesCreate` abstract operation
-// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
-var arraySpeciesCreate = function (originalArray, length) {
- var C;
- if (isArray(originalArray)) {
- C = originalArray.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
- else if (isObject(C)) {
- C = C[SPECIES$4];
- if (C === null) C = undefined;
- }
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
-};
-
-// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
-// 0 -> Array#forEach
-// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
-// 1 -> Array#map
-// https://tc39.github.io/ecma262/#sec-array.prototype.map
-// 2 -> Array#filter
-// https://tc39.github.io/ecma262/#sec-array.prototype.filter
-// 3 -> Array#some
-// https://tc39.github.io/ecma262/#sec-array.prototype.some
-// 4 -> Array#every
-// https://tc39.github.io/ecma262/#sec-array.prototype.every
-// 5 -> Array#find
-// https://tc39.github.io/ecma262/#sec-array.prototype.find
-// 6 -> Array#findIndex
-// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
-var arrayMethods = function (TYPE, specificCreate) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- var create = specificCreate || arraySpeciesCreate;
- return function ($this, callbackfn, that) {
- var O = toObject($this);
- var self = indexedObject(O);
- var boundFunction = bindContext(callbackfn, that, 3);
- var length = toLength(self.length);
- var index = 0;
- var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
- var value, result;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- value = self[index];
- result = boundFunction(value, index, O);
- if (TYPE) {
- if (IS_MAP) target[index] = result; // map
- else if (result) switch (TYPE) {
- case 3: return true; // some
- case 5: return value; // find
- case 6: return index; // findIndex
- case 2: target.push(value); // filter
- } else if (IS_EVERY) return false; // every
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
- };
-};
-
-var internalForEach = arrayMethods(0);
-var SLOPPY_METHOD$1 = sloppyArrayMethod('forEach');
// `Array.prototype.forEach` method implementation
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
-var arrayForEach = SLOPPY_METHOD$1 ? function forEach(callbackfn /* , thisArg */) {
- return internalForEach(this, callbackfn, arguments[1]);
+var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
+ return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
} : [].forEach;
for (var COLLECTION_NAME in domIterables) {
@@ -2091,7 +2135,8 @@ var anInstance = function (it, Constructor, name) {
var nativeAssign = Object.assign;
-// 19.1.2.1 Object.assign(target, source, ...)
+// `Object.assign` method
+// https://tc39.github.io/ecma262/#sec-object.assign
// should work with symbols and should have deterministic property order (V8 bug)
var objectAssign = !nativeAssign || fails(function () {
var A = {};
@@ -2149,7 +2194,7 @@ var getIteratorMethod = function (it) {
|| iterators[classof(it)];
};
-// `Array.from` method
+// `Array.from` method implementation
// https://tc39.github.io/ecma262/#sec-array.from
var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
@@ -2247,7 +2292,7 @@ var adapt = function (delta, numPoints, firstTime) {
var k = 0;
delta = firstTime ? floor$2(delta / damp) : delta >> 1;
delta += floor$2(delta / numPoints);
- for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
+ for (; delta > baseMinusTMin * tMax >> 1; k += base) {
delta = floor$2(delta / baseMinusTMin);
}
return floor$2(k + (baseMinusTMin + 1) * delta / (delta + skew));
@@ -2319,9 +2364,7 @@ var encode = function (input) {
var q = delta;
for (var k = base; /* no condition */; k += base) {
var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
- if (q < t) {
- break;
- }
+ if (q < t) break;
var qMinusT = q - t;
var baseMinusT = base - t;
output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
@@ -2364,6 +2407,24 @@ var getIterator = function (it) {
} return anObject(iteratorMethod.call(it));
};
+// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
var ITERATOR$6 = wellKnownSymbol('iterator');
var URL_SEARCH_PARAMS = 'URLSearchParams';
var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
@@ -2421,10 +2482,10 @@ var serialize = function (it) {
var parseSearchParams = function (result, query) {
if (query) {
var attributes = query.split('&');
- var i = 0;
+ var index = 0;
var attribute, entry;
- while (i < attributes.length) {
- attribute = attributes[i++];
+ while (index < attributes.length) {
+ attribute = attributes[index++];
if (attribute.length) {
entry = attribute.split('=');
result.push({
@@ -2433,7 +2494,7 @@ var parseSearchParams = function (result, query) {
});
}
}
- } return result;
+ }
};
var updateSearchParams = function (query) {
@@ -2473,7 +2534,7 @@ var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
setInternalState$3(that, {
type: URL_SEARCH_PARAMS,
entries: entries,
- updateURL: null,
+ updateURL: function () { /* empty */ },
updateSearchParams: updateSearchParams
});
@@ -2507,7 +2568,7 @@ redefineAll(URLSearchParamsPrototype, {
validateArgumentsLength(arguments.length, 2);
var state = getInternalParamsState(this);
state.entries.push({ key: name + '', value: value + '' });
- if (state.updateURL) state.updateURL();
+ state.updateURL();
},
// `URLSearchParams.prototype.delete` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-delete
@@ -2516,12 +2577,12 @@ redefineAll(URLSearchParamsPrototype, {
var state = getInternalParamsState(this);
var entries = state.entries;
var key = name + '';
- var i = 0;
- while (i < entries.length) {
- if (entries[i].key === key) entries.splice(i, 1);
- else i++;
+ var index = 0;
+ while (index < entries.length) {
+ if (entries[index].key === key) entries.splice(index, 1);
+ else index++;
}
- if (state.updateURL) state.updateURL();
+ state.updateURL();
},
// `URLSearchParams.prototype.get` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-get
@@ -2529,8 +2590,10 @@ redefineAll(URLSearchParamsPrototype, {
validateArgumentsLength(arguments.length, 1);
var entries = getInternalParamsState(this).entries;
var key = name + '';
- var i = 0;
- for (; i < entries.length; i++) if (entries[i].key === key) return entries[i].value;
+ var index = 0;
+ for (; index < entries.length; index++) {
+ if (entries[index].key === key) return entries[index].value;
+ }
return null;
},
// `URLSearchParams.prototype.getAll` method
@@ -2540,8 +2603,10 @@ redefineAll(URLSearchParamsPrototype, {
var entries = getInternalParamsState(this).entries;
var key = name + '';
var result = [];
- var i = 0;
- for (; i < entries.length; i++) if (entries[i].key === key) result.push(entries[i].value);
+ var index = 0;
+ for (; index < entries.length; index++) {
+ if (entries[index].key === key) result.push(entries[index].value);
+ }
return result;
},
// `URLSearchParams.prototype.has` method
@@ -2550,8 +2615,10 @@ redefineAll(URLSearchParamsPrototype, {
validateArgumentsLength(arguments.length, 1);
var entries = getInternalParamsState(this).entries;
var key = name + '';
- var i = 0;
- while (i < entries.length) if (entries[i++].key === key) return true;
+ var index = 0;
+ while (index < entries.length) {
+ if (entries[index++].key === key) return true;
+ }
return false;
},
// `URLSearchParams.prototype.set` method
@@ -2563,12 +2630,12 @@ redefineAll(URLSearchParamsPrototype, {
var found = false;
var key = name + '';
var val = value + '';
- var i = 0;
+ var index = 0;
var entry;
- for (; i < entries.length; i++) {
- entry = entries[i];
+ for (; index < entries.length; index++) {
+ entry = entries[index];
if (entry.key === key) {
- if (found) entries.splice(i--, 1);
+ if (found) entries.splice(index--, 1);
else {
found = true;
entry.value = val;
@@ -2576,7 +2643,7 @@ redefineAll(URLSearchParamsPrototype, {
}
}
if (!found) entries.push({ key: key, value: val });
- if (state.updateURL) state.updateURL();
+ state.updateURL();
},
// `URLSearchParams.prototype.sort` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-sort
@@ -2585,26 +2652,28 @@ redefineAll(URLSearchParamsPrototype, {
var entries = state.entries;
// Array#sort is not stable in some engines
var slice = entries.slice();
- var entry, i, j;
+ var entry, entriesIndex, sliceIndex;
entries.length = 0;
- for (i = 0; i < slice.length; i++) {
- entry = slice[i];
- for (j = 0; j < i; j++) if (entries[j].key > entry.key) {
- entries.splice(j, 0, entry);
- break;
+ for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
+ entry = slice[sliceIndex];
+ for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
+ if (entries[entriesIndex].key > entry.key) {
+ entries.splice(entriesIndex, 0, entry);
+ break;
+ }
}
- if (j === i) entries.push(entry);
+ if (entriesIndex === sliceIndex) entries.push(entry);
}
- if (state.updateURL) state.updateURL();
+ state.updateURL();
},
// `URLSearchParams.prototype.forEach` method
forEach: function forEach(callback /* , thisArg */) {
var entries = getInternalParamsState(this).entries;
var boundFunction = bindContext(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
- var i = 0;
+ var index = 0;
var entry;
- while (i < entries.length) {
- entry = entries[i++];
+ while (index < entries.length) {
+ entry = entries[index++];
boundFunction(entry.value, entry.key, this);
}
},
@@ -2630,10 +2699,10 @@ redefine(URLSearchParamsPrototype, ITERATOR$6, URLSearchParamsPrototype.entries)
redefine(URLSearchParamsPrototype, 'toString', function toString() {
var entries = getInternalParamsState(this).entries;
var result = [];
- var i = 0;
+ var index = 0;
var entry;
- while (i < entries.length) {
- entry = entries[i++];
+ while (index < entries.length) {
+ entry = entries[index++];
result.push(serialize(entry.key) + '=' + serialize(entry.value));
} return result.join('&');
}, { enumerable: true });
@@ -2649,11 +2718,30 @@ var web_urlSearchParams = {
getState: getInternalParamsState
};
+// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
+
+
+
+
+
+
+
+
+
+
+
+var codeAt = stringMultibyte.codeAt;
+
+
+
+
+
var NativeURL = global_1.URL;
var URLSearchParams$1 = web_urlSearchParams.URLSearchParams;
var getInternalSearchParamsState = web_urlSearchParams.getState;
var setInternalState$4 = internalState.set;
var getInternalURLState = internalState.getterFor('URL');
+var floor$3 = Math.floor;
var pow = Math.pow;
var INVALID_AUTHORITY = 'Invalid authority';
@@ -2679,7 +2767,7 @@ var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
var EOF;
var parseHost = function (url, input) {
- var result, codePoints, i;
+ var result, codePoints, index;
if (input.charAt(0) == '[') {
if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
result = parseIPv6(input.slice(1, -1));
@@ -2690,7 +2778,9 @@ var parseHost = function (url, input) {
if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
result = '';
codePoints = arrayFrom(input);
- for (i = 0; i < codePoints.length; i++) result += percentEncode(codePoints[i], C0ControlPercentEncodeSet);
+ for (index = 0; index < codePoints.length; index++) {
+ result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
+ }
url.host = result;
} else {
input = punycodeToAscii(input);
@@ -2703,38 +2793,38 @@ var parseHost = function (url, input) {
var parseIPv4 = function (input) {
var parts = input.split('.');
- var partsLength, numbers, i, part, R, n, ipv4;
- if (parts[parts.length - 1] == '') {
- if (parts.length) parts.pop();
+ var partsLength, numbers, index, part, radix, number, ipv4;
+ if (parts.length && parts[parts.length - 1] == '') {
+ parts.pop();
}
partsLength = parts.length;
if (partsLength > 4) return input;
numbers = [];
- for (i = 0; i < partsLength; i++) {
- part = parts[i];
+ for (index = 0; index < partsLength; index++) {
+ part = parts[index];
if (part == '') return input;
- R = 10;
+ radix = 10;
if (part.length > 1 && part.charAt(0) == '0') {
- R = HEX_START.test(part) ? 16 : 8;
- part = part.slice(R == 8 ? 1 : 2);
+ radix = HEX_START.test(part) ? 16 : 8;
+ part = part.slice(radix == 8 ? 1 : 2);
}
if (part === '') {
- n = 0;
+ number = 0;
} else {
- if (!(R == 10 ? DEC : R == 8 ? OCT : HEX).test(part)) return input;
- n = parseInt(part, R);
+ if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
+ number = parseInt(part, radix);
}
- numbers.push(n);
+ numbers.push(number);
}
- for (i = 0; i < partsLength; i++) {
- n = numbers[i];
- if (i == partsLength - 1) {
- if (n >= pow(256, 5 - partsLength)) return null;
- } else if (n > 255) return null;
+ for (index = 0; index < partsLength; index++) {
+ number = numbers[index];
+ if (index == partsLength - 1) {
+ if (number >= pow(256, 5 - partsLength)) return null;
+ } else if (number > 255) return null;
}
ipv4 = numbers.pop();
- for (i = 0; i < numbers.length; i++) {
- ipv4 += numbers[i] * pow(256, 3 - i);
+ for (index = 0; index < numbers.length; index++) {
+ ipv4 += numbers[index] * pow(256, 3 - index);
}
return ipv4;
};
@@ -2821,9 +2911,9 @@ var findLongestZeroSequence = function (ipv6) {
var maxLength = 1;
var currStart = null;
var currLength = 0;
- var i = 0;
- for (; i < 8; i++) {
- if (ipv6[i] !== 0) {
+ var index = 0;
+ for (; index < 8; index++) {
+ if (ipv6[index] !== 0) {
if (currLength > maxLength) {
maxIndex = currStart;
maxLength = currLength;
@@ -2831,7 +2921,7 @@ var findLongestZeroSequence = function (ipv6) {
currStart = null;
currLength = 0;
} else {
- if (currStart === null) currStart = i;
+ if (currStart === null) currStart = index;
++currLength;
}
}
@@ -2843,27 +2933,27 @@ var findLongestZeroSequence = function (ipv6) {
};
var serializeHost = function (host) {
- var result, i, compress, ignore0;
+ var result, index, compress, ignore0;
// ipv4
if (typeof host == 'number') {
result = [];
- for (i = 0; i < 4; i++) {
+ for (index = 0; index < 4; index++) {
result.unshift(host % 256);
- host = Math.floor(host / 256);
+ host = floor$3(host / 256);
} return result.join('.');
// ipv6
} else if (typeof host == 'object') {
result = '';
compress = findLongestZeroSequence(host);
- for (i = 0; i < 8; i++) {
- if (ignore0 && host[i] === 0) continue;
+ for (index = 0; index < 8; index++) {
+ if (ignore0 && host[index] === 0) continue;
if (ignore0) ignore0 = false;
- if (compress === i) {
- result += i ? ':' : '::';
+ if (compress === index) {
+ result += index ? ':' : '::';
ignore0 = true;
} else {
- result += host[i].toString(16);
- if (i < 7) result += ':';
+ result += host[index].toString(16);
+ if (index < 7) result += ':';
}
}
return '[' + result + ']';
@@ -2882,7 +2972,7 @@ var userinfoPercentEncodeSet = objectAssign({}, pathPercentEncodeSet, {
});
var percentEncode = function (char, set) {
- var code = stringAt(char, 0);
+ var code = codeAt(char, 0);
return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
};
@@ -3006,13 +3096,11 @@ var parseURL = function (url, input, stateOverride, base) {
if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
buffer += char.toLowerCase();
} else if (char == ':') {
- if (stateOverride) {
- if (
- (isSpecial(url) != has(specialSchemes, buffer)) ||
- (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
- (url.scheme == 'file' && !url.host)
- ) return;
- }
+ if (stateOverride && (
+ (isSpecial(url) != has(specialSchemes, buffer)) ||
+ (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
+ (url.scheme == 'file' && !url.host)
+ )) return;
url.scheme = buffer;
if (stateOverride) {
if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
@@ -4226,7 +4314,7 @@ var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
return array.concat()[0] !== array;
});
-var SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('concat');
+var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
var isConcatSpreadable = function (O) {
if (!isObject(O)) return false;
@@ -4234,7 +4322,7 @@ var isConcatSpreadable = function (O) {
return spreadable !== undefined ? !!spreadable : isArray(O);
};
-var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT$1;
+var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
// `Array.prototype.concat` method
// https://tc39.github.io/ecma262/#sec-array.prototype.concat
@@ -4261,19 +4349,21 @@ _export({ target: 'Array', proto: true, forced: FORCED }, {
}
});
-var internalFilter = arrayMethods(2);
-var SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('filter');
+var $filter = arrayIteration.filter;
+
// `Array.prototype.filter` method
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
// with adding support of @@species
-_export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT$2 }, {
+_export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
filter: function filter(callbackfn /* , thisArg */) {
- return internalFilter(this, callbackfn, arguments[1]);
+ return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
-var internalFind = arrayMethods(5);
+var $find = arrayIteration.find;
+
+
var FIND = 'find';
var SKIPS_HOLES = true;
@@ -4284,7 +4374,7 @@ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
// https://tc39.github.io/ecma262/#sec-array.prototype.find
_export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
find: function find(callbackfn /* , that = undefined */) {
- return internalFind(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
+ return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
@@ -4338,37 +4428,45 @@ _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
from: arrayFrom
});
-var internalIncludes = arrayIncludes(true);
+var $includes = arrayIncludes.includes;
+
// `Array.prototype.includes` method
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
_export({ target: 'Array', proto: true }, {
includes: function includes(el /* , fromIndex = 0 */) {
- return internalIncludes(this, el, arguments.length > 1 ? arguments[1] : undefined);
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('includes');
-var internalMap = arrayMethods(1);
-var SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport('map');
+var $map = arrayIteration.map;
+
// `Array.prototype.map` method
// https://tc39.github.io/ecma262/#sec-array.prototype.map
// with adding support of @@species
-_export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT$3 }, {
+_export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, {
map: function map(callbackfn /* , thisArg */) {
- return internalMap(this, callbackfn, arguments[1]);
+ return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
-var inheritIfRequired = function (that, target, C) {
- var S = target.constructor;
- var P;
- if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && objectSetPrototypeOf) {
- objectSetPrototypeOf(that, P);
- } return that;
+// makes subclassing work correct for wrapped built-ins
+var inheritIfRequired = function ($this, dummy, Wrapper) {
+ var NewTarget, NewTargetPrototype;
+ if (
+ // it can work only with native `setPrototypeOf`
+ objectSetPrototypeOf &&
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
+ typeof (NewTarget = dummy.constructor) == 'function' &&
+ NewTarget !== Wrapper &&
+ isObject(NewTargetPrototype = NewTarget.prototype) &&
+ NewTargetPrototype !== Wrapper.prototype
+ ) objectSetPrototypeOf($this, NewTargetPrototype);
+ return $this;
};
// a string of all valid unicode whitespaces
@@ -4379,20 +4477,32 @@ var whitespace = '[' + whitespaces + ']';
var ltrim = RegExp('^' + whitespace + whitespace + '*');
var rtrim = RegExp(whitespace + whitespace + '*$');
-// 1 -> String#trimStart
-// 2 -> String#trimEnd
-// 3 -> String#trim
-var stringTrim = function (string, TYPE) {
- string = String(requireObjectCoercible(string));
- if (TYPE & 1) string = string.replace(ltrim, '');
- if (TYPE & 2) string = string.replace(rtrim, '');
- return string;
+// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
+var createMethod$3 = function (TYPE) {
+ return function ($this) {
+ var string = String(requireObjectCoercible($this));
+ if (TYPE & 1) string = string.replace(ltrim, '');
+ if (TYPE & 2) string = string.replace(rtrim, '');
+ return string;
+ };
+};
+
+var stringTrim = {
+ // `String.prototype.{ trimLeft, trimStart }` methods
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
+ start: createMethod$3(1),
+ // `String.prototype.{ trimRight, trimEnd }` methods
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
+ end: createMethod$3(2),
+ // `String.prototype.trim` method
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trim
+ trim: createMethod$3(3)
};
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
var defineProperty$3 = objectDefineProperty.f;
-
+var trim = stringTrim.trim;
var NUMBER = 'Number';
var NativeNumber = global_1[NUMBER];
@@ -4400,15 +4510,14 @@ var NumberPrototype = NativeNumber.prototype;
// Opera ~12 has broken Object#toString
var BROKEN_CLASSOF = classofRaw(objectCreate(NumberPrototype)) == NUMBER;
-var NATIVE_TRIM = 'trim' in String.prototype;
// `ToNumber` abstract operation
// https://tc39.github.io/ecma262/#sec-tonumber
var toNumber = function (argument) {
var it = toPrimitive(argument, false);
- var first, third, radix, maxCode, digits, length, i, code;
+ var first, third, radix, maxCode, digits, length, index, code;
if (typeof it == 'string' && it.length > 2) {
- it = NATIVE_TRIM ? it.trim() : stringTrim(it, 3);
+ it = trim(it);
first = it.charCodeAt(0);
if (first === 43 || first === 45) {
third = it.charCodeAt(2);
@@ -4421,8 +4530,8 @@ var toNumber = function (argument) {
}
digits = it.slice(2);
length = digits.length;
- for (i = 0; i < length; i++) {
- code = digits.charCodeAt(i);
+ for (index = 0; index < length; index++) {
+ code = digits.charCodeAt(index);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if (code < 48 || code > maxCode) return NaN;
@@ -4436,11 +4545,11 @@ var toNumber = function (argument) {
if (isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
var NumberWrapper = function Number(value) {
var it = arguments.length < 1 ? 0 : value;
- var that = this;
- return that instanceof NumberWrapper
+ var dummy = this;
+ return dummy instanceof NumberWrapper
// check on 1..constructor(foo) case
- && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(that); }) : classofRaw(that) != NUMBER)
- ? inheritIfRequired(new NativeNumber(toNumber(it)), that, NumberWrapper) : toNumber(it);
+ && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classofRaw(dummy) != NUMBER)
+ ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
};
for (var keys$1 = descriptors ? getOwnPropertyNames(NativeNumber) : (
// ES3:
@@ -4468,14 +4577,10 @@ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
}
});
-// helper for String#{startsWith, endsWith, includes}
-
-
-
-var validateStringMethodArguments = function (that, searchString, NAME) {
- if (isRegexp(searchString)) {
- throw TypeError('String.prototype.' + NAME + " doesn't accept regex");
- } return String(requireObjectCoercible(that));
+var notARegexp = function (it) {
+ if (isRegexp(it)) {
+ throw TypeError("The method doesn't accept regular expressions");
+ } return it;
};
var MATCH$1 = wellKnownSymbol('match');
@@ -4496,8 +4601,8 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
// https://tc39.github.io/ecma262/#sec-string.prototype.includes
_export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
includes: function includes(searchString /* , position = 0 */) {
- return !!~validateStringMethodArguments(this, searchString, 'includes')
- .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
+ return !!~String(requireObjectCoercible(this))
+ .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined);
}
});
@@ -4570,14 +4675,17 @@ var internalMetadata_2 = internalMetadata.fastKey;
var internalMetadata_3 = internalMetadata.getWeakData;
var internalMetadata_4 = internalMetadata.onFreeze;
-var iterate = createCommonjsModule(function (module) {
-var BREAK = {};
+var iterate_1 = createCommonjsModule(function (module) {
+var Result = function (stopped, result) {
+ this.stopped = stopped;
+ this.result = result;
+};
-var exports = module.exports = function (iterable, fn, that, ENTRIES, ITERATOR) {
- var boundFunction = bindContext(fn, that, ENTRIES ? 2 : 1);
+var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
+ var boundFunction = bindContext(fn, that, AS_ENTRIES ? 2 : 1);
var iterator, iterFn, index, length, result, step;
- if (ITERATOR) {
+ if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
@@ -4585,19 +4693,24 @@ var exports = module.exports = function (iterable, fn, that, ENTRIES, ITERATOR)
// optimisation for array iterators
if (isArrayIteratorMethod(iterFn)) {
for (index = 0, length = toLength(iterable.length); length > index; index++) {
- result = ENTRIES ? boundFunction(anObject(step = iterable[index])[0], step[1]) : boundFunction(iterable[index]);
- if (result === BREAK) return BREAK;
- } return;
+ result = AS_ENTRIES
+ ? boundFunction(anObject(step = iterable[index])[0], step[1])
+ : boundFunction(iterable[index]);
+ if (result && result instanceof Result) return result;
+ } return new Result(false);
}
iterator = iterFn.call(iterable);
}
while (!(step = iterator.next()).done) {
- if (callWithSafeIterationClosing(iterator, boundFunction, step.value, ENTRIES) === BREAK) return BREAK;
- }
+ result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
+ if (result && result instanceof Result) return result;
+ } return new Result(false);
};
-exports.BREAK = BREAK;
+iterate.stop = function (result) {
+ return new Result(true, result);
+};
});
var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
@@ -4652,10 +4765,10 @@ var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
});
if (!ACCEPT_ITERABLES) {
- Constructor = wrapper(function (target, iterable) {
- anInstance(target, Constructor, CONSTRUCTOR_NAME);
- var that = inheritIfRequired(new NativeConstructor(), target, Constructor);
- if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
+ Constructor = wrapper(function (dummy, iterable) {
+ anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
+ var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
+ if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
return that;
});
Constructor.prototype = NativePrototype;
@@ -4695,8 +4808,8 @@ var getWeakData = internalMetadata.getWeakData;
var setInternalState$5 = internalState.set;
var internalStateGetterFor = internalState.getterFor;
-var arrayFind = arrayMethods(5);
-var arrayFindIndex = arrayMethods(6);
+var find$1 = arrayIteration.find;
+var findIndex = arrayIteration.findIndex;
var id$1 = 0;
// fallback for uncaught frozen keys
@@ -4709,7 +4822,7 @@ var UncaughtFrozenStore = function () {
};
var findUncaughtFrozen = function (store, key) {
- return arrayFind(store.entries, function (it) {
+ return find$1(store.entries, function (it) {
return it[0] === key;
});
};
@@ -4728,7 +4841,7 @@ UncaughtFrozenStore.prototype = {
else this.entries.push([key, value]);
},
'delete': function (key) {
- var index = arrayFindIndex(this.entries, function (it) {
+ var index = findIndex(this.entries, function (it) {
return it[0] === key;
});
if (~index) this.entries.splice(index, 1);
@@ -4745,7 +4858,7 @@ var collectionWeak = {
id: id$1++,
frozen: undefined
});
- if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
+ if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
});
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
@@ -4820,7 +4933,7 @@ var InternalWeakMap;
var wrapper = function (get) {
return function WeakMap() {
- return get(this, arguments.length > 0 ? arguments[0] : undefined);
+ return get(this, arguments.length ? arguments[0] : undefined);
};
};
@@ -4889,13 +5002,14 @@ var forcedStringTrimMethod = function (METHOD_NAME) {
});
};
-var FORCED$1 = forcedStringTrimMethod('trim');
+var $trim = stringTrim.trim;
+
// `String.prototype.trim` method
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
-_export({ target: 'String', proto: true, forced: FORCED$1 }, {
+_export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
trim: function trim() {
- return stringTrim(this, 3);
+ return $trim(this);
}
});
@@ -4920,39 +5034,7 @@ var stringRepeat = ''.repeat || function repeat(count) {
};
var nativeToFixed = 1.0.toFixed;
-var floor$3 = Math.floor;
-var data$1 = [0, 0, 0, 0, 0, 0];
-
-var multiply = function (n, c) {
- var i = -1;
- var c2 = c;
- while (++i < 6) {
- c2 += n * data$1[i];
- data$1[i] = c2 % 1e7;
- c2 = floor$3(c2 / 1e7);
- }
-};
-
-var divide = function (n) {
- var i = 6;
- var c = 0;
- while (--i >= 0) {
- c += data$1[i];
- data$1[i] = floor$3(c / n);
- c = (c % n) * 1e7;
- }
-};
-
-var numToString = function () {
- var i = 6;
- var s = '';
- while (--i >= 0) {
- if (s !== '' || i === 0 || data$1[i] !== 0) {
- var t = String(data$1[i]);
- s = s === '' ? t : s + stringRepeat.call('0', 7 - t.length) + t;
- }
- } return s;
-};
+var floor$4 = Math.floor;
var pow$1 = function (x, n, acc) {
return n === 0 ? acc : n % 2 === 1 ? pow$1(x, n - 1, acc * x) : pow$1(x * x, n / 2, acc);
@@ -4971,7 +5053,7 @@ var log = function (x) {
} return n;
};
-var FORCED$2 = nativeToFixed && (
+var FORCED$1 = nativeToFixed && (
0.00008.toFixed(3) !== '0.000' ||
0.9.toFixed(0) !== '1' ||
1.255.toFixed(2) !== '1.25' ||
@@ -4983,29 +5065,63 @@ var FORCED$2 = nativeToFixed && (
// `Number.prototype.toFixed` method
// https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
-_export({ target: 'Number', proto: true, forced: FORCED$2 }, {
+_export({ target: 'Number', proto: true, forced: FORCED$1 }, {
+ // eslint-disable-next-line max-statements
toFixed: function toFixed(fractionDigits) {
- var x = thisNumberValue(this);
- var f = toInteger(fractionDigits);
- var s = '';
- var m = '0';
+ var number = thisNumberValue(this);
+ var fractDigits = toInteger(fractionDigits);
+ var data = [0, 0, 0, 0, 0, 0];
+ var sign = '';
+ var result = '0';
var e, z, j, k;
- if (f < 0 || f > 20) throw RangeError('Incorrect fraction digits');
+
+ var multiply = function (n, c) {
+ var index = -1;
+ var c2 = c;
+ while (++index < 6) {
+ c2 += n * data[index];
+ data[index] = c2 % 1e7;
+ c2 = floor$4(c2 / 1e7);
+ }
+ };
+
+ var divide = function (n) {
+ var index = 6;
+ var c = 0;
+ while (--index >= 0) {
+ c += data[index];
+ data[index] = floor$4(c / n);
+ c = (c % n) * 1e7;
+ }
+ };
+
+ var dataToString = function () {
+ var index = 6;
+ var s = '';
+ while (--index >= 0) {
+ if (s !== '' || index === 0 || data[index] !== 0) {
+ var t = String(data[index]);
+ s = s === '' ? t : s + stringRepeat.call('0', 7 - t.length) + t;
+ }
+ } return s;
+ };
+
+ if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
// eslint-disable-next-line no-self-compare
- if (x != x) return 'NaN';
- if (x <= -1e21 || x >= 1e21) return String(x);
- if (x < 0) {
- s = '-';
- x = -x;
- }
- if (x > 1e-21) {
- e = log(x * pow$1(2, 69, 1)) - 69;
- z = e < 0 ? x * pow$1(2, -e, 1) : x / pow$1(2, e, 1);
+ if (number != number) return 'NaN';
+ if (number <= -1e21 || number >= 1e21) return String(number);
+ if (number < 0) {
+ sign = '-';
+ number = -number;
+ }
+ if (number > 1e-21) {
+ e = log(number * pow$1(2, 69, 1)) - 69;
+ z = e < 0 ? number * pow$1(2, -e, 1) : number / pow$1(2, e, 1);
z *= 0x10000000000000;
e = 52 - e;
if (e > 0) {
multiply(0, z);
- j = f;
+ j = fractDigits;
while (j >= 7) {
multiply(1e7, 0);
j -= 7;
@@ -5019,55 +5135,71 @@ _export({ target: 'Number', proto: true, forced: FORCED$2 }, {
divide(1 << j);
multiply(1, 1);
divide(2);
- m = numToString();
+ result = dataToString();
} else {
multiply(0, z);
multiply(1 << -e, 0);
- m = numToString() + stringRepeat.call('0', f);
+ result = dataToString() + stringRepeat.call('0', fractDigits);
}
}
- if (f > 0) {
- k = m.length;
- m = s + (k <= f ? '0.' + stringRepeat.call('0', f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
+ if (fractDigits > 0) {
+ k = result.length;
+ result = sign + (k <= fractDigits
+ ? '0.' + stringRepeat.call('0', fractDigits - k) + result
+ : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
} else {
- m = s + m;
- } return m;
+ result = sign + result;
+ } return result;
}
});
var propertyIsEnumerable = objectPropertyIsEnumerable.f;
-// TO_ENTRIES: true -> Object.entries
-// TO_ENTRIES: false -> Object.values
-var objectToArray = function (it, TO_ENTRIES) {
- var O = toIndexedObject(it);
- var keys = objectKeys(O);
- var length = keys.length;
- var i = 0;
- var result = [];
- var key;
- while (length > i) {
- key = keys[i++];
- if (!descriptors || propertyIsEnumerable.call(O, key)) {
- result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
+// `Object.{ entries, values }` methods implementation
+var createMethod$4 = function (TO_ENTRIES) {
+ return function (it) {
+ var O = toIndexedObject(it);
+ var keys = objectKeys(O);
+ var length = keys.length;
+ var i = 0;
+ var result = [];
+ var key;
+ while (length > i) {
+ key = keys[i++];
+ if (!descriptors || propertyIsEnumerable.call(O, key)) {
+ result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
+ }
}
- }
- return result;
+ return result;
+ };
};
+var objectToArray = {
+ // `Object.entries` method
+ // https://tc39.github.io/ecma262/#sec-object.entries
+ entries: createMethod$4(true),
+ // `Object.values` method
+ // https://tc39.github.io/ecma262/#sec-object.values
+ values: createMethod$4(false)
+};
+
+var $entries = objectToArray.entries;
+
// `Object.entries` method
// https://tc39.github.io/ecma262/#sec-object.entries
_export({ target: 'Object', stat: true }, {
entries: function entries(O) {
- return objectToArray(O, true);
+ return $entries(O);
}
});
+var $values = objectToArray.values;
+
// `Object.values` method
// https://tc39.github.io/ecma262/#sec-object.values
_export({ target: 'Object', stat: true }, {
values: function values(O) {
- return objectToArray(O);
+ return $values(O);
}
});
@@ -5433,24 +5565,18 @@ function () {
return RangeTouch;
}();
-var aFunction$1 = function (variable) {
- return typeof variable == 'function' ? variable : undefined;
-};
-
-var getBuiltIn = function (namespace, method) {
- return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
- : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
-};
-
var SPECIES$5 = wellKnownSymbol('species');
var setSpecies = function (CONSTRUCTOR_NAME) {
- var C = getBuiltIn(CONSTRUCTOR_NAME);
+ var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
var defineProperty = objectDefineProperty.f;
- if (descriptors && C && !C[SPECIES$5]) defineProperty(C, SPECIES$5, {
- configurable: true,
- get: function () { return this; }
- });
+
+ if (descriptors && Constructor && !Constructor[SPECIES$5]) {
+ defineProperty(Constructor, SPECIES$5, {
+ configurable: true,
+ get: function () { return this; }
+ });
+ }
};
var location = global_1.location;
@@ -5546,9 +5672,7 @@ var task = {
clear: clear
};
-var navigator$1 = global_1.navigator;
-
-var userAgent = navigator$1 && navigator$1.userAgent || '';
+var userAgent = getBuiltIn('navigator', 'userAgent') || '';
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
@@ -5634,8 +5758,8 @@ var PromiseCapability = function (C) {
resolve = $$resolve;
reject = $$reject;
});
- this.resolve = aFunction(resolve);
- this.reject = aFunction(reject);
+ this.resolve = aFunction$1(resolve);
+ this.reject = aFunction$1(reject);
};
// 25.4.1.5 NewPromiseCapability(C)
@@ -5689,7 +5813,7 @@ var setInternalState$6 = internalState.set;
var getInternalPromiseState = internalState.getterFor(PROMISE);
var PromiseConstructor = global_1[PROMISE];
var TypeError$1 = global_1.TypeError;
-var document$3 = global_1.document;
+var document$2 = global_1.document;
var process$2 = global_1.process;
var $fetch = global_1.fetch;
var versions = process$2 && process$2.versions;
@@ -5697,7 +5821,7 @@ var v8 = versions && versions.v8 || '';
var newPromiseCapability$1 = newPromiseCapability.f;
var newGenericPromiseCapability = newPromiseCapability$1;
var IS_NODE$1 = classofRaw(process$2) == 'process';
-var DISPATCH_EVENT = !!(document$3 && document$3.createEvent && global_1.dispatchEvent);
+var DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent);
var UNHANDLED_REJECTION = 'unhandledrejection';
var REJECTION_HANDLED = 'rejectionhandled';
var PENDING = 0;
@@ -5707,7 +5831,7 @@ var HANDLED = 1;
var UNHANDLED = 2;
var Internal, OwnPromiseCapability, PromiseWrapper;
-var FORCED$3 = isForced_1(PROMISE, function () {
+var FORCED$2 = isForced_1(PROMISE, function () {
// correct subclassing with @@species support
var promise = PromiseConstructor.resolve(1);
var empty = function () { /* empty */ };
@@ -5725,7 +5849,7 @@ var FORCED$3 = isForced_1(PROMISE, function () {
&& userAgent.indexOf('Chrome/66') === -1);
});
-var INCORRECT_ITERATION$1 = FORCED$3 || !checkCorrectnessOfIteration(function (iterable) {
+var INCORRECT_ITERATION$1 = FORCED$2 || !checkCorrectnessOfIteration(function (iterable) {
PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
});
@@ -5742,8 +5866,10 @@ var notify$1 = function (promise, state, isReject) {
microtask(function () {
var value = state.value;
var ok = state.state == FULFILLED;
- var i = 0;
- var run = function (reaction) {
+ var index = 0;
+ // variable length - can't use forEach
+ while (chain.length > index) {
+ var reaction = chain[index++];
var handler = ok ? reaction.ok : reaction.fail;
var resolve = reaction.resolve;
var reject = reaction.reject;
@@ -5758,7 +5884,7 @@ var notify$1 = function (promise, state, isReject) {
if (handler === true) result = value;
else {
if (domain) domain.enter();
- result = handler(value); // may throw
+ result = handler(value); // can throw
if (domain) {
domain.exit();
exited = true;
@@ -5774,8 +5900,7 @@ var notify$1 = function (promise, state, isReject) {
if (domain && !exited) domain.exit();
reject(error);
}
- };
- while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
+ }
state.reactions = [];
state.notified = false;
if (isReject && !state.rejection) onUnhandled(promise, state);
@@ -5785,7 +5910,7 @@ var notify$1 = function (promise, state, isReject) {
var dispatchEvent = function (name, promise, reason) {
var event, handler;
if (DISPATCH_EVENT) {
- event = document$3.createEvent('Event');
+ event = document$2.createEvent('Event');
event.promise = promise;
event.reason = reason;
event.initEvent(name, false, true);
@@ -5870,11 +5995,11 @@ var internalResolve = function (promise, state, value, unwrap) {
};
// constructor polyfill
-if (FORCED$3) {
+if (FORCED$2) {
// 25.4.3.1 Promise(executor)
PromiseConstructor = function Promise(executor) {
anInstance(this, PromiseConstructor, PROMISE);
- aFunction(executor);
+ aFunction$1(executor);
Internal.call(this);
var state = getInternalState$3(this);
try {
@@ -5938,7 +6063,7 @@ if (FORCED$3) {
});
}
-_export({ global: true, wrap: true, forced: FORCED$3 }, {
+_export({ global: true, wrap: true, forced: FORCED$2 }, {
Promise: PromiseConstructor
});
@@ -5948,7 +6073,7 @@ setSpecies(PROMISE);
PromiseWrapper = path[PROMISE];
// statics
-_export({ target: PROMISE, stat: true, forced: FORCED$3 }, {
+_export({ target: PROMISE, stat: true, forced: FORCED$2 }, {
// `Promise.reject` method
// https://tc39.github.io/ecma262/#sec-promise.reject
reject: function reject(r) {
@@ -5958,7 +6083,7 @@ _export({ target: PROMISE, stat: true, forced: FORCED$3 }, {
}
});
-_export({ target: PROMISE, stat: true, forced: FORCED$3 }, {
+_export({ target: PROMISE, stat: true, forced: FORCED$2 }, {
// `Promise.resolve` method
// https://tc39.github.io/ecma262/#sec-promise.resolve
resolve: function resolve(x) {
@@ -5975,11 +6100,11 @@ _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
var resolve = capability.resolve;
var reject = capability.reject;
var result = perform(function () {
- var $promiseResolve = aFunction(C.resolve);
+ var $promiseResolve = aFunction$1(C.resolve);
var values = [];
var counter = 0;
var remaining = 1;
- iterate(iterable, function (promise) {
+ iterate_1(iterable, function (promise) {
var index = counter++;
var alreadyCalled = false;
values.push(undefined);
@@ -6003,8 +6128,8 @@ _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
var capability = newPromiseCapability$1(C);
var reject = capability.reject;
var result = perform(function () {
- var $promiseResolve = aFunction(C.resolve);
- iterate(iterable, function (promise) {
+ var $promiseResolve = aFunction$1(C.resolve);
+ iterate_1(iterable, function (promise) {
$promiseResolve.call(C, promise).then(capability.resolve, reject);
});
});
@@ -6013,15 +6138,16 @@ _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
}
});
-var STARTS_WITH = 'startsWith';
-var nativeStartsWith = ''[STARTS_WITH];
+var nativeStartsWith = ''.startsWith;
+var min$4 = Math.min;
// `String.prototype.startsWith` method
// https://tc39.github.io/ecma262/#sec-string.prototype.startswith
-_export({ target: 'String', proto: true, forced: !correctIsRegexpLogic(STARTS_WITH) }, {
+_export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('startsWith') }, {
startsWith: function startsWith(searchString /* , position = 0 */) {
- var that = validateStringMethodArguments(this, searchString, STARTS_WITH);
- var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
+ var that = String(requireObjectCoercible(this));
+ notARegexp(searchString);
+ var index = toLength(min$4(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return nativeStartsWith
? nativeStartsWith.call(that, search, index)
@@ -6988,7 +7114,7 @@ var re2 = /a/g;
// "new" should create a new object, old webkit bug
var CORRECT_NEW = new NativeRegExp(re1) !== re1;
-var FORCED$4 = isForced_1('RegExp', descriptors && (!CORRECT_NEW || fails(function () {
+var FORCED$3 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || fails(function () {
re2[MATCH$2] = false;
// RegExp constructor can alter flags and IsRegExp works correct with @@match
return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
@@ -6996,7 +7122,7 @@ var FORCED$4 = isForced_1('RegExp', descriptors && (!CORRECT_NEW || fails(functi
// `RegExp` constructor
// https://tc39.github.io/ecma262/#sec-regexp-constructor
-if (FORCED$4) {
+if (FORCED$3) {
var RegExpWrapper = function RegExp(pattern, flags) {
var thisIsRegExp = this instanceof RegExpWrapper;
var patternIsRegExp = isRegexp(pattern);
@@ -7017,8 +7143,8 @@ if (FORCED$4) {
});
};
var keys$2 = getOwnPropertyNames$1(NativeRegExp);
- var i = 0;
- while (i < keys$2.length) proxy(keys$2[i++]);
+ var index = 0;
+ while (keys$2.length > index) proxy(keys$2[index++]);
RegExpPrototype$1.constructor = RegExpWrapper;
RegExpWrapper.prototype = RegExpPrototype$1;
redefine(global_1, 'RegExp', RegExpWrapper);
@@ -7324,13 +7450,13 @@ function loadSprite(url, id) {
}
var ceil$1 = Math.ceil;
-var floor$4 = Math.floor;
+var floor$5 = Math.floor;
// `Math.trunc` method
// https://tc39.github.io/ecma262/#sec-math.trunc
_export({ target: 'Math', stat: true }, {
trunc: function trunc(it) {
- return (it > 0 ? floor$4 : ceil$1)(it);
+ return (it > 0 ? floor$5 : ceil$1)(it);
}
});
@@ -9320,7 +9446,7 @@ var defaults$1 = {
// Sprite (for icons)
loadSprite: true,
iconPrefix: 'plyr',
- iconUrl: 'https://cdn.plyr.io/3.5.2/plyr.svg',
+ iconUrl: 'https://cdn.plyr.io/3.5.4/plyr.svg',
// Blank video (used to prevent errors on source change)
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
// Quality default
@@ -10998,16 +11124,14 @@ if (descriptors && !(NAME in FunctionPrototype)) {
}
var max$3 = Math.max;
-var min$4 = Math.min;
+var min$5 = Math.min;
var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
-var SPECIES_SUPPORT$4 = arrayMethodHasSpeciesSupport('splice');
-
// `Array.prototype.splice` method
// https://tc39.github.io/ecma262/#sec-array.prototype.splice
// with adding support of @@species
-_export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT$4 }, {
+_export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, {
splice: function splice(start, deleteCount /* , ...items */) {
var O = toObject(this);
var len = toLength(O.length);
@@ -11021,7 +11145,7 @@ _export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT$4 }, {
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
- actualDeleteCount = min$4(max$3(toInteger(deleteCount), 0), len - actualStart);
+ actualDeleteCount = min$5(max$3(toInteger(deleteCount), 0), len - actualStart);
}
if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) {
throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
@@ -12777,7 +12901,9 @@ function () {
return Ads;
}();
-var internalFindIndex = arrayMethods(6);
+var $findIndex = arrayIteration.findIndex;
+
+
var FIND_INDEX = 'findIndex';
var SKIPS_HOLES$1 = true;
@@ -12788,7 +12914,7 @@ if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES$1 = false;
// https://tc39.github.io/ecma262/#sec-array.prototype.findindex
_export({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
findIndex: function findIndex(callbackfn /* , that = undefined */) {
- return internalFindIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
+ return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});