core-js-pure
Advanced tools
Comparing version 3.17.3 to 3.18.0
@@ -7,2 +7,3 @@ 'use strict'; | ||
require('../../modules/es.string.iterator'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -14,3 +15,3 @@ | ||
module.exports = function allSettled(iterable) { | ||
return $allSettled.call(typeof this === 'function' ? this : Promise, iterable); | ||
return $allSettled.call(isCallable(this) ? this : Promise, iterable); | ||
}; |
@@ -8,2 +8,3 @@ 'use strict'; | ||
require('../../modules/es.string.iterator'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -15,3 +16,3 @@ | ||
module.exports = function any(iterable) { | ||
return $any.call(typeof this === 'function' ? this : Promise, iterable); | ||
return $any.call(isCallable(this) ? this : Promise, iterable); | ||
}; |
var parent = require('../../stable/array'); | ||
require('../../modules/es.map'); | ||
require('../../modules/es.promise'); | ||
require('../../modules/esnext.array.from-async'); | ||
// TODO: Remove from `core-js@4` | ||
@@ -4,0 +6,0 @@ require('../../modules/esnext.array.at'); |
@@ -224,2 +224,3 @@ require('../modules/es.symbol'); | ||
require('../modules/esnext.aggregate-error'); | ||
require('../modules/esnext.array.from-async'); | ||
require('../modules/esnext.array.at'); | ||
@@ -348,2 +349,3 @@ require('../modules/esnext.array.filter-out'); | ||
require('../modules/esnext.symbol.replace-all'); | ||
require('../modules/esnext.typed-array.from-async'); | ||
require('../modules/esnext.typed-array.at'); | ||
@@ -350,0 +352,0 @@ require('../modules/esnext.typed-array.filter-out'); |
@@ -7,2 +7,3 @@ 'use strict'; | ||
require('../../modules/web.dom-collections.iterator'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -14,3 +15,3 @@ | ||
module.exports = function from(source, mapFn, thisArg) { | ||
return mapFrom.call(typeof this === 'function' ? this : Map, source, mapFn, thisArg); | ||
return mapFrom.call(isCallable(this) ? this : Map, source, mapFn, thisArg); | ||
}; |
'use strict'; | ||
require('../../modules/es.map'); | ||
require('../../modules/esnext.map.group-by'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -10,3 +11,3 @@ | ||
module.exports = function groupBy(source, iterable, keyDerivative) { | ||
return mapGroupBy.call(typeof this === 'function' ? this : Map, source, iterable, keyDerivative); | ||
return mapGroupBy.call(isCallable(this) ? this : Map, source, iterable, keyDerivative); | ||
}; |
'use strict'; | ||
require('../../modules/es.map'); | ||
require('../../modules/esnext.map.key-by'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -10,3 +11,3 @@ | ||
module.exports = function keyBy(source, iterable, keyDerivative) { | ||
return mapKeyBy.call(typeof this === 'function' ? this : Map, source, iterable, keyDerivative); | ||
return mapKeyBy.call(isCallable(this) ? this : Map, source, iterable, keyDerivative); | ||
}; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
require('../../modules/esnext.map.of'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -12,3 +13,3 @@ | ||
module.exports = function of() { | ||
return mapOf.apply(typeof this === 'function' ? this : Map, arguments); | ||
return mapOf.apply(isCallable(this) ? this : Map, arguments); | ||
}; |
'use strict'; | ||
require('../../modules/es.promise'); | ||
require('../../modules/esnext.promise.try'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -10,3 +11,3 @@ | ||
module.exports = { 'try': function (callbackfn) { | ||
return promiseTry.call(typeof this === 'function' ? this : Promise, callbackfn); | ||
return promiseTry.call(isCallable(this) ? this : Promise, callbackfn); | ||
} }['try']; |
@@ -7,2 +7,3 @@ 'use strict'; | ||
require('../../modules/web.dom-collections.iterator'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -14,3 +15,3 @@ | ||
module.exports = function from(source, mapFn, thisArg) { | ||
return setFrom.call(typeof this === 'function' ? this : Set, source, mapFn, thisArg); | ||
return setFrom.call(isCallable(this) ? this : Set, source, mapFn, thisArg); | ||
}; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
require('../../modules/esnext.set.of'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -12,3 +13,3 @@ | ||
module.exports = function of() { | ||
return setOf.apply(typeof this === 'function' ? this : Set, arguments); | ||
return setOf.apply(isCallable(this) ? this : Set, arguments); | ||
}; |
var parent = require('../../stable/typed-array'); | ||
require('../../modules/es.map'); | ||
require('../../modules/es.promise'); | ||
require('../../modules/esnext.typed-array.from-async'); | ||
// TODO: Remove from `core-js@4` | ||
@@ -4,0 +6,0 @@ require('../../modules/esnext.typed-array.at'); |
@@ -7,2 +7,3 @@ 'use strict'; | ||
require('../../modules/web.dom-collections.iterator'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -14,3 +15,3 @@ | ||
module.exports = function from(source, mapFn, thisArg) { | ||
return weakMapFrom.call(typeof this === 'function' ? this : WeakMap, source, mapFn, thisArg); | ||
return weakMapFrom.call(isCallable(this) ? this : WeakMap, source, mapFn, thisArg); | ||
}; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
require('../../modules/esnext.weak-map.of'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -12,3 +13,3 @@ | ||
module.exports = function of() { | ||
return weakMapOf.apply(typeof this === 'function' ? this : WeakMap, arguments); | ||
return weakMapOf.apply(isCallable(this) ? this : WeakMap, arguments); | ||
}; |
@@ -7,2 +7,3 @@ 'use strict'; | ||
require('../../modules/web.dom-collections.iterator'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -14,3 +15,3 @@ | ||
module.exports = function from(source, mapFn, thisArg) { | ||
return weakSetfrom.call(typeof this === 'function' ? this : WeakSet, source, mapFn, thisArg); | ||
return weakSetfrom.call(isCallable(this) ? this : WeakSet, source, mapFn, thisArg); | ||
}; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
require('../../modules/esnext.weak-set.of'); | ||
var isCallable = require('../../internals/is-callable'); | ||
var path = require('../../internals/path'); | ||
@@ -12,3 +13,3 @@ | ||
module.exports = function of() { | ||
return weakSetOf.apply(typeof this === 'function' ? this : WeakSet, arguments); | ||
return weakSetOf.apply(isCallable(this) ? this : WeakSet, arguments); | ||
}; |
@@ -1,7 +0,6 @@ | ||
var isObject = require('../internals/is-object'); | ||
var isCallable = require('../internals/is-callable'); | ||
module.exports = function (it) { | ||
if (!isObject(it) && it !== null) { | ||
throw TypeError("Can't set " + String(it) + ' as a prototype'); | ||
} return it; | ||
module.exports = function (argument) { | ||
if (typeof argument === 'object' || isCallable(argument)) return argument; | ||
throw TypeError("Can't set " + String(argument) + ' as a prototype'); | ||
}; |
module.exports = function (it, Constructor, name) { | ||
if (!(it instanceof Constructor)) { | ||
throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); | ||
} return it; | ||
if (it instanceof Constructor) return it; | ||
throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); | ||
}; |
var isObject = require('../internals/is-object'); | ||
module.exports = function (it) { | ||
if (!isObject(it)) { | ||
throw TypeError(String(it) + ' is not an object'); | ||
} return it; | ||
// `Assert: Type(argument) is Object` | ||
module.exports = function (argument) { | ||
if (isObject(argument)) return argument; | ||
throw TypeError(String(argument) + ' is not an object'); | ||
}; |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); | ||
var isConstructor = require('../internals/is-constructor'); | ||
var toLength = require('../internals/to-length'); | ||
@@ -16,15 +17,15 @@ var createProperty = require('../internals/create-property'); | ||
var O = toObject(arrayLike); | ||
var C = typeof this == 'function' ? this : Array; | ||
var IS_CONSTRUCTOR = isConstructor(this); | ||
var argumentsLength = arguments.length; | ||
var mapfn = argumentsLength > 1 ? arguments[1] : undefined; | ||
var mapping = mapfn !== undefined; | ||
if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); | ||
var iteratorMethod = getIteratorMethod(O); | ||
var index = 0; | ||
var length, result, step, iterator, next, value; | ||
if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); | ||
// if the target is not iterable or it's an array with the default iterator - use a simple case | ||
if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { | ||
if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) { | ||
iterator = getIterator(O, iteratorMethod); | ||
next = iterator.next; | ||
result = new C(); | ||
result = IS_CONSTRUCTOR ? new this() : []; | ||
for (;!(step = next.call(iterator)).done; index++) { | ||
@@ -36,3 +37,3 @@ value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; | ||
length = toLength(O.length); | ||
result = new C(length); | ||
result = IS_CONSTRUCTOR ? new this(length) : Array(length); | ||
for (;length > index; index++) { | ||
@@ -39,0 +40,0 @@ value = mapping ? mapfn(O[index], index) : O[index]; |
@@ -1,2 +0,2 @@ | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var toObject = require('../internals/to-object'); | ||
@@ -9,3 +9,3 @@ var IndexedObject = require('../internals/indexed-object'); | ||
return function (that, callbackfn, argumentsLength, memo) { | ||
aFunction(callbackfn); | ||
aCallable(callbackfn); | ||
var O = toObject(that); | ||
@@ -12,0 +12,0 @@ var self = IndexedObject(O); |
@@ -0,3 +1,4 @@ | ||
var isArray = require('../internals/is-array'); | ||
var isConstructor = require('../internals/is-constructor'); | ||
var isObject = require('../internals/is-object'); | ||
var isArray = require('../internals/is-array'); | ||
var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
@@ -14,3 +15,3 @@ | ||
// cross-realm fallback | ||
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; | ||
if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined; | ||
else if (isObject(C)) { | ||
@@ -17,0 +18,0 @@ C = C[SPECIES]; |
'use strict'; | ||
var aCallable = require('../internals/a-callable'); | ||
var toLength = require('../internals/to-length'); | ||
@@ -18,7 +19,6 @@ var toObject = require('../internals/to-object'); | ||
var resolverFunction, index, item, key; | ||
if (typeof resolver == 'function') resolverFunction = resolver; | ||
else if (resolver == null) resolverFunction = function (value) { | ||
if (resolver != null) resolverFunction = aCallable(resolver); | ||
else resolverFunction = function (value) { | ||
return value; | ||
}; | ||
else throw new TypeError('Incorrect resolver!'); | ||
for (index = 0; index < length; index++) { | ||
@@ -25,0 +25,0 @@ item = that[index]; |
@@ -42,3 +42,3 @@ 'use strict'; | ||
return new Promise(function (resolve, reject) { | ||
var $return = getMethod(iterator['return']); | ||
var $return = getMethod(iterator, 'return'); | ||
if ($return === undefined) return resolve({ done: true, value: arg }); | ||
@@ -53,3 +53,3 @@ var result = anObject($return.apply(iterator, hasArg ? [arg] : [])); | ||
return new Promise(function (resolve, reject) { | ||
var $throw = getMethod(iterator['throw']); | ||
var $throw = getMethod(iterator, 'throw'); | ||
if ($throw === undefined) return reject(arg); | ||
@@ -56,0 +56,0 @@ var result = anObject($throw.apply(iterator, hasArg ? [arg] : [])); |
'use strict'; | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -10,2 +10,3 @@ var create = require('../internals/object-create'); | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var getMethod = require('../internals/get-method'); | ||
var AsyncIteratorPrototype = require('../internals/async-iterator-prototype'); | ||
@@ -22,3 +23,3 @@ | ||
var AsyncIteratorProxy = function AsyncIterator(state) { | ||
state.next = aFunction(state.iterator.next); | ||
state.next = aCallable(state.iterator.next); | ||
state.done = false; | ||
@@ -46,3 +47,3 @@ state.ignoreArgument = !IS_ITERATOR; | ||
state.done = true; | ||
var $$return = iterator['return']; | ||
var $$return = getMethod(iterator, 'return'); | ||
if ($$return === undefined) return resolve({ done: true, value: value }); | ||
@@ -61,3 +62,3 @@ Promise.resolve($$return.call(iterator, value)).then(function (result) { | ||
state.done = true; | ||
var $$throw = iterator['throw']; | ||
var $$throw = getMethod(iterator, 'throw'); | ||
if ($$throw === undefined) return reject(value); | ||
@@ -64,0 +65,0 @@ resolve($$throw.call(iterator, value)); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var getMethod = require('../internals/get-method'); | ||
var Promise = getBuiltIn('Promise'); | ||
var push = [].push; | ||
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; | ||
@@ -15,7 +15,9 @@ var createMethod = function (TYPE) { | ||
var IS_SOME = TYPE == 3; | ||
return function (iterator, fn) { | ||
return function (iterator, fn, target) { | ||
anObject(iterator); | ||
var next = aFunction(iterator.next); | ||
var array = IS_TO_ARRAY ? [] : undefined; | ||
if (!IS_TO_ARRAY) aFunction(fn); | ||
var Promise = getBuiltIn('Promise'); | ||
var next = aCallable(iterator.next); | ||
var index = 0; | ||
var MAPPING = fn !== undefined; | ||
if (MAPPING || !IS_TO_ARRAY) aCallable(fn); | ||
@@ -25,4 +27,4 @@ return new Promise(function (resolve, reject) { | ||
try { | ||
var returnMethod = iterator['return']; | ||
if (returnMethod !== undefined) { | ||
var returnMethod = getMethod(iterator, 'return'); | ||
if (returnMethod) { | ||
return Promise.resolve(returnMethod.call(iterator)).then(function () { | ||
@@ -45,13 +47,16 @@ method(argument); | ||
try { | ||
if (IS_TO_ARRAY && (index > MAX_SAFE_INTEGER) && MAPPING) { | ||
throw TypeError('The allowed number of iterations has been exceeded'); | ||
} | ||
Promise.resolve(anObject(next.call(iterator))).then(function (step) { | ||
try { | ||
if (anObject(step).done) { | ||
resolve(IS_TO_ARRAY ? array : IS_SOME ? false : IS_EVERY || undefined); | ||
if (IS_TO_ARRAY) { | ||
target.length = index; | ||
resolve(target); | ||
} else resolve(IS_SOME ? false : IS_EVERY || undefined); | ||
} else { | ||
var value = step.value; | ||
if (IS_TO_ARRAY) { | ||
push.call(array, value); | ||
loop(); | ||
} else { | ||
Promise.resolve(fn(value)).then(function (result) { | ||
if (MAPPING) { | ||
Promise.resolve(IS_TO_ARRAY ? fn(value, index) : fn(value)).then(function (result) { | ||
if (IS_FOR_EACH) { | ||
@@ -61,2 +66,5 @@ loop(); | ||
result ? loop() : closeIteration(resolve, false); | ||
} else if (IS_TO_ARRAY) { | ||
target[index++] = result; | ||
loop(); | ||
} else { | ||
@@ -66,2 +74,5 @@ result ? closeIteration(resolve, IS_SOME || value) : loop(); | ||
}, onError); | ||
} else { | ||
target[index++] = value; | ||
loop(); | ||
} | ||
@@ -68,0 +79,0 @@ } |
var global = require('../internals/global'); | ||
var shared = require('../internals/shared-store'); | ||
var isCallable = require('../internals/is-callable'); | ||
var create = require('../internals/object-create'); | ||
var getPrototypeOf = require('../internals/object-get-prototype-of'); | ||
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); | ||
var redefine = require('../internals/redefine'); | ||
var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
@@ -17,3 +18,3 @@ var IS_PURE = require('../internals/is-pure'); | ||
AsyncIteratorPrototype = PassedAsyncIteratorPrototype; | ||
} else if (typeof AsyncIterator == 'function') { | ||
} else if (isCallable(AsyncIterator)) { | ||
AsyncIteratorPrototype = AsyncIterator.prototype; | ||
@@ -31,4 +32,4 @@ } else if (shared[USE_FUNCTION_CONSTRUCTOR] || global[USE_FUNCTION_CONSTRUCTOR]) { | ||
if (typeof AsyncIteratorPrototype[ASYNC_ITERATOR] !== 'function') { | ||
createNonEnumerableProperty(AsyncIteratorPrototype, ASYNC_ITERATOR, function () { | ||
if (!isCallable(AsyncIteratorPrototype[ASYNC_ITERATOR])) { | ||
redefine(AsyncIteratorPrototype, ASYNC_ITERATOR, function () { | ||
return this; | ||
@@ -35,0 +36,0 @@ }); |
var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); | ||
var isCallable = require('../internals/is-callable'); | ||
var classofRaw = require('../internals/classof-raw'); | ||
@@ -25,3 +26,3 @@ var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
// ES3 arguments fallback | ||
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; | ||
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result; | ||
}; |
'use strict'; | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
@@ -8,3 +8,3 @@ // https://github.com/tc39/collection-methods | ||
var set = anObject(this); | ||
var adder = aFunction(set.add); | ||
var adder = aCallable(set.add); | ||
for (var k = 0, len = arguments.length; k < len; k++) { | ||
@@ -11,0 +11,0 @@ adder.call(set, arguments[k]); |
'use strict'; | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
@@ -8,3 +8,3 @@ // https://github.com/tc39/collection-methods | ||
var collection = anObject(this); | ||
var remover = aFunction(collection['delete']); | ||
var remover = aCallable(collection['delete']); | ||
var allDeleted = true; | ||
@@ -11,0 +11,0 @@ var wasDeleted; |
'use strict'; | ||
// https://tc39.github.io/proposal-setmap-offrom/ | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var aConstructor = require('../internals/a-constructor'); | ||
var bind = require('../internals/function-bind-context'); | ||
@@ -11,5 +12,5 @@ var iterate = require('../internals/iterate'); | ||
var mapping, array, n, boundFunction; | ||
aFunction(this); | ||
aConstructor(this); | ||
mapping = mapFn !== undefined; | ||
if (mapping) aFunction(mapFn); | ||
if (mapping) aCallable(mapFn); | ||
if (source == undefined) return new this(); | ||
@@ -16,0 +17,0 @@ array = []; |
'use strict'; | ||
var $ = require('./export'); | ||
var $ = require('../internals/export'); | ||
var global = require('../internals/global'); | ||
@@ -9,2 +9,3 @@ var InternalMetadataModule = require('../internals/internal-metadata'); | ||
var anInstance = require('../internals/an-instance'); | ||
var isCallable = require('../internals/is-callable'); | ||
var isObject = require('../internals/is-object'); | ||
@@ -29,3 +30,3 @@ var setToStringTag = require('../internals/set-to-string-tag'); | ||
if (!DESCRIPTORS || typeof NativeConstructor != 'function' | ||
if (!DESCRIPTORS || !isCallable(NativeConstructor) | ||
|| !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); })) | ||
@@ -32,0 +33,0 @@ ) { |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var IS_PURE = require('../internals/is-pure'); | ||
var FunctionName = require('../internals/function-name'); | ||
var isCallable = require('../internals/is-callable'); | ||
var createIteratorConstructor = require('../internals/create-iterator-constructor'); | ||
@@ -10,6 +13,7 @@ var getPrototypeOf = require('../internals/object-get-prototype-of'); | ||
var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
var IS_PURE = require('../internals/is-pure'); | ||
var Iterators = require('../internals/iterators'); | ||
var IteratorsCore = require('../internals/iterators-core'); | ||
var PROPER_FUNCTION_NAME = FunctionName.PROPER; | ||
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; | ||
var IteratorPrototype = IteratorsCore.IteratorPrototype; | ||
@@ -54,4 +58,4 @@ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; | ||
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); | ||
} else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { | ||
createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); | ||
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { | ||
redefine(CurrentIteratorPrototype, ITERATOR, returnThis); | ||
} | ||
@@ -66,13 +70,11 @@ } | ||
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF | ||
if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { | ||
INCORRECT_VALUES_NAME = true; | ||
defaultIterator = function values() { return nativeIterator.call(this); }; | ||
if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { | ||
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { | ||
createNonEnumerableProperty(IterablePrototype, 'name', VALUES); | ||
} else { | ||
INCORRECT_VALUES_NAME = true; | ||
defaultIterator = function values() { return nativeIterator.call(this); }; | ||
} | ||
} | ||
// define iterator | ||
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { | ||
createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); | ||
} | ||
Iterators[NAME] = defaultIterator; | ||
// export additional methods | ||
@@ -92,3 +94,9 @@ if (DEFAULT) { | ||
// define iterator | ||
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { | ||
redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); | ||
} | ||
Iterators[NAME] = defaultIterator; | ||
return methods; | ||
}; |
'use strict'; | ||
var global = require('../internals/global'); | ||
var isCallable = require('../internals/is-callable'); | ||
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; | ||
@@ -37,2 +38,3 @@ var isForced = require('../internals/is-forced'); | ||
options.noTargetGet - prevent calling a getter on target | ||
options.name - the .name of the function if it does not match the key | ||
*/ | ||
@@ -75,3 +77,3 @@ module.exports = function (options, source) { | ||
// make static versions for prototype methods | ||
else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty); | ||
else if (PROTO && isCallable(sourceProperty)) resultProperty = bind(Function.call, sourceProperty); | ||
// default case | ||
@@ -78,0 +80,0 @@ else resultProperty = sourceProperty; |
@@ -1,6 +0,6 @@ | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
// optional / simple context binding | ||
module.exports = function (fn, that, length) { | ||
aFunction(fn); | ||
aCallable(fn); | ||
if (that === undefined) return fn; | ||
@@ -7,0 +7,0 @@ switch (length) { |
'use strict'; | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var isObject = require('../internals/is-object'); | ||
@@ -19,3 +19,3 @@ | ||
module.exports = Function.bind || function bind(that /* , ...args */) { | ||
var fn = aFunction(this); | ||
var fn = aCallable(this); | ||
var partArgs = slice.call(arguments, 1); | ||
@@ -22,0 +22,0 @@ var boundFunction = function bound(/* args... */) { |
var AsyncFromSyncIterator = require('../internals/async-from-sync-iterator'); | ||
var aFunction = require('../internals/a-function'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -11,6 +10,4 @@ var getIterator = require('../internals/get-iterator'); | ||
module.exports = function (it, usingIterator) { | ||
var method = arguments.length < 2 ? getMethod(it[ASYNC_ITERATOR]) : usingIterator; | ||
if (method === undefined) { | ||
return new AsyncFromSyncIterator(getIterator(it)); | ||
} return anObject(aFunction(method).call(it)); | ||
var method = arguments.length < 2 ? getMethod(it, ASYNC_ITERATOR) : usingIterator; | ||
return method ? anObject(method.call(it)) : new AsyncFromSyncIterator(getIterator(it)); | ||
}; |
var path = require('../internals/path'); | ||
var global = require('../internals/global'); | ||
var isCallable = require('../internals/is-callable'); | ||
var aFunction = function (variable) { | ||
return typeof variable == 'function' ? variable : undefined; | ||
return isCallable(variable) ? variable : undefined; | ||
}; | ||
@@ -7,0 +8,0 @@ |
var classof = require('../internals/classof'); | ||
var getMethod = require('../internals/get-method'); | ||
var Iterators = require('../internals/iterators'); | ||
@@ -8,5 +9,5 @@ var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
module.exports = function (it) { | ||
if (it != undefined) return it[ITERATOR] | ||
|| it['@@iterator'] | ||
if (it != undefined) return getMethod(it, ITERATOR) | ||
|| getMethod(it, '@@iterator') | ||
|| Iterators[classof(it)]; | ||
}; |
@@ -0,9 +1,9 @@ | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var getIteratorMethod = require('../internals/get-iterator-method'); | ||
module.exports = function (it, usingIterator) { | ||
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(it) : usingIterator; | ||
if (typeof iteratorMethod != 'function') { | ||
throw TypeError(String(it) + ' is not iterable'); | ||
} return anObject(iteratorMethod.call(it)); | ||
module.exports = function (argument, usingIterator) { | ||
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; | ||
if (aCallable(iteratorMethod)) return anObject(iteratorMethod.call(argument)); | ||
throw TypeError(String(argument) + ' is not iterable'); | ||
}; |
@@ -1,7 +0,8 @@ | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
// `GetMethod` abstract operation | ||
// https://tc39.es/ecma262/#sec-getmethod | ||
module.exports = function (fn) { | ||
return fn == null ? undefined : aFunction(fn); | ||
module.exports = function (V, P) { | ||
var func = V[P]; | ||
return func == null ? undefined : aCallable(func); | ||
}; |
@@ -0,1 +1,2 @@ | ||
var isCallable = require('../internals/is-callable'); | ||
var isObject = require('../internals/is-object'); | ||
@@ -11,3 +12,3 @@ var setPrototypeOf = require('../internals/object-set-prototype-of'); | ||
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this | ||
typeof (NewTarget = dummy.constructor) == 'function' && | ||
isCallable(NewTarget = dummy.constructor) && | ||
NewTarget !== Wrapper && | ||
@@ -14,0 +15,0 @@ isObject(NewTargetPrototype = NewTarget.prototype) && |
@@ -0,1 +1,2 @@ | ||
var isCallable = require('../internals/is-callable'); | ||
var store = require('../internals/shared-store'); | ||
@@ -6,3 +7,3 @@ | ||
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper | ||
if (typeof store.inspectSource != 'function') { | ||
if (!isCallable(store.inspectSource)) { | ||
store.inspectSource = function (it) { | ||
@@ -9,0 +10,0 @@ return functionToString.call(it); |
@@ -6,4 +6,4 @@ var classof = require('../internals/classof-raw'); | ||
// eslint-disable-next-line es/no-array-isarray -- safe | ||
module.exports = Array.isArray || function isArray(arg) { | ||
return classof(arg) == 'Array'; | ||
module.exports = Array.isArray || function isArray(argument) { | ||
return classof(argument) == 'Array'; | ||
}; |
var fails = require('../internals/fails'); | ||
var isCallable = require('../internals/is-callable'); | ||
@@ -9,3 +10,3 @@ var replacement = /#|\.prototype\./; | ||
: value == NATIVE ? false | ||
: typeof detection == 'function' ? fails(detection) | ||
: isCallable(detection) ? fails(detection) | ||
: !!detection; | ||
@@ -12,0 +13,0 @@ }; |
@@ -0,3 +1,5 @@ | ||
var isCallable = require('../internals/is-callable'); | ||
module.exports = function (it) { | ||
return typeof it === 'object' ? it !== null : typeof it === 'function'; | ||
return typeof it === 'object' ? it !== null : isCallable(it); | ||
}; |
@@ -0,1 +1,2 @@ | ||
var isCallable = require('../internals/is-callable'); | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
@@ -8,3 +9,3 @@ var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); | ||
var $Symbol = getBuiltIn('Symbol'); | ||
return typeof $Symbol == 'function' && Object(it) instanceof $Symbol; | ||
return isCallable($Symbol) && Object(it) instanceof $Symbol; | ||
}; |
@@ -38,3 +38,3 @@ var anObject = require('../internals/an-object'); | ||
iterFn = getIteratorMethod(iterable); | ||
if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); | ||
if (!iterFn) throw TypeError(String(iterable) + ' is not iterable'); | ||
// optimisation for array iterators | ||
@@ -41,0 +41,0 @@ if (isArrayIteratorMethod(iterFn)) { |
var anObject = require('../internals/an-object'); | ||
var getMethod = require('../internals/get-method'); | ||
@@ -7,4 +8,4 @@ module.exports = function (iterator, kind, value) { | ||
try { | ||
innerResult = iterator['return']; | ||
if (innerResult === undefined) { | ||
innerResult = getMethod(iterator, 'return'); | ||
if (!innerResult) { | ||
if (kind === 'throw') throw value; | ||
@@ -11,0 +12,0 @@ return value; |
'use strict'; | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -9,2 +9,3 @@ var create = require('../internals/object-create'); | ||
var InternalStateModule = require('../internals/internal-state'); | ||
var getMethod = require('../internals/get-method'); | ||
var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; | ||
@@ -19,3 +20,3 @@ | ||
var IteratorProxy = function Iterator(state) { | ||
state.next = aFunction(state.iterator.next); | ||
state.next = aCallable(state.iterator.next); | ||
state.done = false; | ||
@@ -38,4 +39,4 @@ state.ignoreArg = !IS_ITERATOR; | ||
state.done = true; | ||
var $$return = iterator['return']; | ||
return { done: true, value: $$return === undefined ? value : anObject($$return.call(iterator, value)).value }; | ||
var $$return = getMethod(iterator, 'return'); | ||
return { done: true, value: $$return ? anObject($$return.call(iterator, value)).value : value }; | ||
}, | ||
@@ -46,5 +47,5 @@ 'throw': function (value) { | ||
state.done = true; | ||
var $$throw = iterator['throw']; | ||
if ($$throw === undefined) throw value; | ||
return $$throw.call(iterator, value); | ||
var $$throw = getMethod(iterator, 'throw'); | ||
if ($$throw) return $$throw.call(iterator, value); | ||
throw value; | ||
} | ||
@@ -51,0 +52,0 @@ }); |
'use strict'; | ||
var fails = require('../internals/fails'); | ||
var isCallable = require('../internals/is-callable'); | ||
var create = require('../internals/object-create'); | ||
var getPrototypeOf = require('../internals/object-get-prototype-of'); | ||
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); | ||
var redefine = require('../internals/redefine'); | ||
var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
@@ -38,4 +39,4 @@ var IS_PURE = require('../internals/is-pure'); | ||
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator | ||
if (typeof IteratorPrototype[ITERATOR] !== 'function') { | ||
createNonEnumerableProperty(IteratorPrototype, ITERATOR, function () { | ||
if (!isCallable(IteratorPrototype[ITERATOR])) { | ||
redefine(IteratorPrototype, ITERATOR, function () { | ||
return this; | ||
@@ -42,0 +43,0 @@ }); |
'use strict'; | ||
var isCallable = require('../internals/is-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -10,3 +11,3 @@ | ||
var value; | ||
if (typeof updateFn != 'function' && typeof insertFn != 'function') { | ||
if (!isCallable(updateFn) && !isCallable(insertFn)) { | ||
throw TypeError('At least one callback required'); | ||
@@ -16,7 +17,7 @@ } | ||
value = map.get(key); | ||
if (typeof updateFn == 'function') { | ||
if (isCallable(updateFn)) { | ||
value = updateFn(value); | ||
map.set(key, value); | ||
} | ||
} else if (typeof insertFn == 'function') { | ||
} else if (isCallable(insertFn)) { | ||
value = insertFn(); | ||
@@ -23,0 +24,0 @@ map.set(key, value); |
var global = require('../internals/global'); | ||
var isCallable = require('../internals/is-callable'); | ||
var inspectSource = require('../internals/inspect-source'); | ||
@@ -6,2 +7,2 @@ | ||
module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); | ||
module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap)); |
'use strict'; | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
@@ -11,4 +11,4 @@ var PromiseCapability = function (C) { | ||
}); | ||
this.resolve = aFunction(resolve); | ||
this.reject = aFunction(reject); | ||
this.resolve = aCallable(resolve); | ||
this.reject = aCallable(reject); | ||
}; | ||
@@ -15,0 +15,0 @@ |
var global = require('../internals/global'); | ||
var fails = require('../internals/fails'); | ||
var toString = require('../internals/to-string'); | ||
@@ -7,3 +8,7 @@ var trim = require('../internals/string-trim').trim; | ||
var $parseFloat = global.parseFloat; | ||
var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity; | ||
var Symbol = global.Symbol; | ||
var ITERATOR = Symbol && Symbol.iterator; | ||
var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity | ||
// MS Edge 18- broken with boxed symbols | ||
|| (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); })); | ||
@@ -10,0 +15,0 @@ // `parseFloat` method |
var global = require('../internals/global'); | ||
var fails = require('../internals/fails'); | ||
var toString = require('../internals/to-string'); | ||
@@ -7,4 +8,8 @@ var trim = require('../internals/string-trim').trim; | ||
var $parseInt = global.parseInt; | ||
var Symbol = global.Symbol; | ||
var ITERATOR = Symbol && Symbol.iterator; | ||
var hex = /^[+-]?0[Xx]/; | ||
var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22; | ||
var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22 | ||
// MS Edge 18- broken with boxed symbols | ||
|| (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); })); | ||
@@ -11,0 +16,0 @@ // `parseInt` method |
var has = require('../internals/has'); | ||
var isCallable = require('../internals/is-callable'); | ||
var toObject = require('../internals/to-object'); | ||
@@ -13,7 +14,8 @@ var sharedKey = require('../internals/shared-key'); | ||
module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { | ||
O = toObject(O); | ||
if (has(O, IE_PROTO)) return O[IE_PROTO]; | ||
if (typeof O.constructor == 'function' && O instanceof O.constructor) { | ||
return O.constructor.prototype; | ||
} return O instanceof Object ? ObjectPrototype : null; | ||
var object = toObject(O); | ||
if (has(object, IE_PROTO)) return object[IE_PROTO]; | ||
var constructor = object.constructor; | ||
if (isCallable(constructor) && object instanceof constructor) { | ||
return constructor.prototype; | ||
} return object instanceof Object ? ObjectPrototype : null; | ||
}; |
@@ -0,1 +1,2 @@ | ||
var isCallable = require('../internals/is-callable'); | ||
var isObject = require('../internals/is-object'); | ||
@@ -7,6 +8,6 @@ | ||
var fn, val; | ||
if (pref === '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 (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; | ||
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val; | ||
if (isCallable(fn = input.valueOf) && !isObject(val = fn.call(input))) return val; | ||
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val; | ||
throw TypeError("Can't convert object to primitive value"); | ||
}; |
@@ -1,1 +0,17 @@ | ||
// empty | ||
var anObject = require('../internals/an-object'); | ||
var isCallable = require('../internals/is-callable'); | ||
var classof = require('../internals/classof-raw'); | ||
var regexpExec = require('../internals/regexp-exec'); | ||
// `RegExpExec` abstract operation | ||
// https://tc39.es/ecma262/#sec-regexpexec | ||
module.exports = function (R, S) { | ||
var exec = R.exec; | ||
if (isCallable(exec)) { | ||
var result = exec.call(R, S); | ||
if (result !== null) anObject(result); | ||
return result; | ||
} | ||
if (classof(R) === 'RegExp') return regexpExec.call(R, S); | ||
throw TypeError('RegExp#exec called on incompatible receiver'); | ||
}; |
@@ -1,1 +0,1 @@ | ||
// empty | ||
module.exports = /./.exec; |
@@ -1,2 +0,2 @@ | ||
var fails = require('./fails'); | ||
var fails = require('../internals/fails'); | ||
var global = require('../internals/global'); | ||
@@ -3,0 +3,0 @@ |
@@ -7,5 +7,5 @@ var IS_PURE = require('../internals/is-pure'); | ||
})('versions', []).push({ | ||
version: '3.17.3', | ||
version: '3.18.0', | ||
mode: IS_PURE ? 'pure' : 'global', | ||
copyright: '© 2021 Denis Pushkarev (zloirock.ru)' | ||
}); |
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var aConstructor = require('../internals/a-constructor'); | ||
var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
@@ -12,3 +12,3 @@ | ||
var S; | ||
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S); | ||
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S); | ||
}; |
@@ -0,1 +1,2 @@ | ||
var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER; | ||
var fails = require('../internals/fails'); | ||
@@ -10,4 +11,6 @@ var whitespaces = require('../internals/whitespaces'); | ||
return fails(function () { | ||
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME; | ||
return !!whitespaces[METHOD_NAME]() | ||
|| non[METHOD_NAME]() !== non | ||
|| (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME); | ||
}); | ||
}; |
var global = require('../internals/global'); | ||
var isCallable = require('../internals/is-callable'); | ||
var fails = require('../internals/fails'); | ||
@@ -57,3 +58,3 @@ var bind = require('../internals/function-bind-context'); | ||
// eslint-disable-next-line no-new-func -- spec requirement | ||
(typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args); | ||
(isCallable(fn) ? fn : Function(fn)).apply(undefined, args); | ||
}; | ||
@@ -87,3 +88,3 @@ defer(counter); | ||
global.addEventListener && | ||
typeof postMessage == 'function' && | ||
isCallable(global.postMessage) && | ||
!global.importScripts && | ||
@@ -90,0 +91,0 @@ location && location.protocol !== 'file:' && |
var isObject = require('../internals/is-object'); | ||
var isSymbol = require('../internals/is-symbol'); | ||
var getMethod = require('../internals/get-method'); | ||
var ordinaryToPrimitive = require('../internals/ordinary-to-primitive'); | ||
@@ -12,5 +13,5 @@ var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
if (!isObject(input) || isSymbol(input)) return input; | ||
var exoticToPrim = input[TO_PRIMITIVE]; | ||
var exoticToPrim = getMethod(input, TO_PRIMITIVE); | ||
var result; | ||
if (exoticToPrim !== undefined) { | ||
if (exoticToPrim) { | ||
if (pref === undefined) pref = 'default'; | ||
@@ -17,0 +18,0 @@ result = exoticToPrim.call(input, pref); |
@@ -1,6 +0,6 @@ | ||
var isSymbol = require('../internals/is-symbol'); | ||
var classof = require('../internals/classof'); | ||
module.exports = function (argument) { | ||
if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string'); | ||
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); | ||
return String(argument); | ||
}; |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var flattenIntoArray = require('../internals/flatten-into-array'); | ||
var aCallable = require('../internals/a-callable'); | ||
var toObject = require('../internals/to-object'); | ||
var toLength = require('../internals/to-length'); | ||
var aFunction = require('../internals/a-function'); | ||
var arraySpeciesCreate = require('../internals/array-species-create'); | ||
@@ -16,3 +16,3 @@ | ||
var A; | ||
aFunction(callbackfn); | ||
aCallable(callbackfn); | ||
A = arraySpeciesCreate(O, 0); | ||
@@ -19,0 +19,0 @@ A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var fails = require('../internals/fails'); | ||
var isConstructor = require('../internals/is-constructor'); | ||
var createProperty = require('../internals/create-property'); | ||
@@ -19,3 +20,3 @@ | ||
var argumentsLength = arguments.length; | ||
var result = new (typeof this == 'function' ? this : Array)(argumentsLength); | ||
var result = new (isConstructor(this) ? this : Array)(argumentsLength); | ||
while (argumentsLength > index) createProperty(result, index, arguments[index++]); | ||
@@ -22,0 +23,0 @@ result.length = argumentsLength; |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var isArray = require('../internals/is-array'); | ||
var isConstructor = require('../internals/is-constructor'); | ||
var isObject = require('../internals/is-object'); | ||
var isArray = require('../internals/is-array'); | ||
var toAbsoluteIndex = require('../internals/to-absolute-index'); | ||
@@ -32,3 +33,3 @@ var toLength = require('../internals/to-length'); | ||
// cross-realm fallback | ||
if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { | ||
if (isConstructor(Constructor) && (Constructor === Array || isArray(Constructor.prototype))) { | ||
Constructor = undefined; | ||
@@ -35,0 +36,0 @@ } else if (isObject(Constructor)) { |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var toObject = require('../internals/to-object'); | ||
@@ -79,3 +79,3 @@ var toLength = require('../internals/to-length'); | ||
sort: function sort(comparefn) { | ||
if (comparefn !== undefined) aFunction(comparefn); | ||
if (comparefn !== undefined) aCallable(comparefn); | ||
@@ -82,0 +82,0 @@ var array = toObject(this); |
'use strict'; | ||
var isCallable = require('../internals/is-callable'); | ||
var isObject = require('../internals/is-object'); | ||
@@ -14,3 +15,3 @@ var definePropertyModule = require('../internals/object-define-property'); | ||
definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: function (O) { | ||
if (typeof this != 'function' || !isObject(O)) return false; | ||
if (!isCallable(this) || !isObject(O)) return false; | ||
if (!isObject(this.prototype)) return O instanceof this; | ||
@@ -17,0 +18,0 @@ // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var FORCED = require('../internals/object-prototype-accessors-forced'); | ||
var aCallable = require('../internals/a-callable'); | ||
var toObject = require('../internals/to-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var definePropertyModule = require('../internals/object-define-property'); | ||
@@ -15,5 +15,5 @@ | ||
__defineGetter__: function __defineGetter__(P, getter) { | ||
definePropertyModule.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); | ||
definePropertyModule.f(toObject(this), P, { get: aCallable(getter), enumerable: true, configurable: true }); | ||
} | ||
}); | ||
} |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var FORCED = require('../internals/object-prototype-accessors-forced'); | ||
var aCallable = require('../internals/a-callable'); | ||
var toObject = require('../internals/to-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var definePropertyModule = require('../internals/object-define-property'); | ||
@@ -15,5 +15,5 @@ | ||
__defineSetter__: function __defineSetter__(P, setter) { | ||
definePropertyModule.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); | ||
definePropertyModule.f(toObject(this), P, { set: aCallable(setter), enumerable: true, configurable: true }); | ||
} | ||
}); | ||
} |
var $ = require('../internals/export'); | ||
var parseFloatImplementation = require('../internals/number-parse-float'); | ||
var $parseFloat = require('../internals/number-parse-float'); | ||
// `parseFloat` method | ||
// https://tc39.es/ecma262/#sec-parsefloat-string | ||
$({ global: true, forced: parseFloat != parseFloatImplementation }, { | ||
parseFloat: parseFloatImplementation | ||
$({ global: true, forced: parseFloat != $parseFloat }, { | ||
parseFloat: $parseFloat | ||
}); |
var $ = require('../internals/export'); | ||
var parseIntImplementation = require('../internals/number-parse-int'); | ||
var $parseInt = require('../internals/number-parse-int'); | ||
// `parseInt` method | ||
// https://tc39.es/ecma262/#sec-parseint-string-radix | ||
$({ global: true, forced: parseInt != parseIntImplementation }, { | ||
parseInt: parseIntImplementation | ||
$({ global: true, forced: parseInt != $parseInt }, { | ||
parseInt: $parseInt | ||
}); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var newPromiseCapabilityModule = require('../internals/new-promise-capability'); | ||
@@ -17,3 +17,3 @@ var perform = require('../internals/perform'); | ||
var result = perform(function () { | ||
var promiseResolve = aFunction(C.resolve); | ||
var promiseResolve = aCallable(C.resolve); | ||
var values = []; | ||
@@ -20,0 +20,0 @@ var counter = 0; |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
@@ -20,3 +20,3 @@ var newPromiseCapabilityModule = require('../internals/new-promise-capability'); | ||
var result = perform(function () { | ||
var promiseResolve = aFunction(C.resolve); | ||
var promiseResolve = aCallable(C.resolve); | ||
var errors = []; | ||
@@ -23,0 +23,0 @@ var counter = 0; |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var isCallable = require('../internals/is-callable'); | ||
var speciesConstructor = require('../internals/species-constructor'); | ||
@@ -22,3 +23,3 @@ var promiseResolve = require('../internals/promise-resolve'); | ||
var C = speciesConstructor(this, getBuiltIn('Promise')); | ||
var isFunction = typeof onFinally == 'function'; | ||
var isFunction = isCallable(onFinally); | ||
return this.then( | ||
@@ -36,3 +37,3 @@ isFunction ? function (x) { | ||
// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then` | ||
if (!IS_PURE && typeof NativePromise == 'function') { | ||
if (!IS_PURE && isCallable(NativePromise)) { | ||
var method = getBuiltIn('Promise').prototype['finally']; | ||
@@ -39,0 +40,0 @@ if (NativePromise.prototype['finally'] !== method) { |
@@ -12,4 +12,5 @@ 'use strict'; | ||
var setSpecies = require('../internals/set-species'); | ||
var aCallable = require('../internals/a-callable'); | ||
var isCallable = require('../internals/is-callable'); | ||
var isObject = require('../internals/is-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var anInstance = require('../internals/an-instance'); | ||
@@ -47,3 +48,3 @@ var inspectSource = require('../internals/inspect-source'); | ||
var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); | ||
var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function'; | ||
var NATIVE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent); | ||
var UNHANDLED_REJECTION = 'unhandledrejection'; | ||
@@ -92,3 +93,3 @@ var REJECTION_HANDLED = 'rejectionhandled'; | ||
var then; | ||
return isObject(it) && typeof (then = it.then) == 'function' ? then : false; | ||
return isObject(it) && isCallable(then = it.then) ? then : false; | ||
}; | ||
@@ -238,3 +239,3 @@ | ||
anInstance(this, PromiseConstructor, PROMISE); | ||
aFunction(executor); | ||
aCallable(executor); | ||
Internal.call(this); | ||
@@ -268,4 +269,4 @@ var state = getInternalState(this); | ||
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); | ||
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; | ||
reaction.fail = typeof onRejected == 'function' && onRejected; | ||
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true; | ||
reaction.fail = isCallable(onRejected) && onRejected; | ||
reaction.domain = IS_NODE ? process.domain : undefined; | ||
@@ -296,3 +297,3 @@ state.parent = true; | ||
if (!IS_PURE && typeof NativePromise == 'function' && NativePromisePrototype !== Object.prototype) { | ||
if (!IS_PURE && isCallable(NativePromise) && NativePromisePrototype !== Object.prototype) { | ||
nativeThen = NativePromisePrototype.then; | ||
@@ -363,3 +364,3 @@ | ||
var result = perform(function () { | ||
var $promiseResolve = aFunction(C.resolve); | ||
var $promiseResolve = aCallable(C.resolve); | ||
var values = []; | ||
@@ -392,3 +393,3 @@ var counter = 0; | ||
var result = perform(function () { | ||
var $promiseResolve = aFunction(C.resolve); | ||
var $promiseResolve = aCallable(C.resolve); | ||
iterate(iterable, function (promise) { | ||
@@ -395,0 +396,0 @@ $promiseResolve.call(C, promise).then(capability.resolve, reject); |
var $ = require('../internals/export'); | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -19,3 +19,3 @@ var fails = require('../internals/fails'); | ||
apply: function apply(target, thisArgument, argumentsList) { | ||
aFunction(target); | ||
aCallable(target); | ||
anObject(argumentsList); | ||
@@ -22,0 +22,0 @@ return nativeApply |
var $ = require('../internals/export'); | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aFunction = require('../internals/a-function'); | ||
var aConstructor = require('../internals/a-constructor'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -27,5 +27,5 @@ var isObject = require('../internals/is-object'); | ||
construct: function construct(Target, args /* , newTarget */) { | ||
aFunction(Target); | ||
aConstructor(Target); | ||
anObject(args); | ||
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); | ||
var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]); | ||
if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); | ||
@@ -32,0 +32,0 @@ if (Target == newTarget) { |
@@ -8,3 +8,2 @@ 'use strict'; | ||
var toString = require('../internals/to-string'); | ||
var aFunction = require('../internals/a-function'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -14,3 +13,4 @@ var classof = require('../internals/classof-raw'); | ||
var getRegExpFlags = require('../internals/regexp-flags'); | ||
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); | ||
var getMethod = require('../internals/get-method'); | ||
var redefine = require('../internals/redefine'); | ||
var fails = require('../internals/fails'); | ||
@@ -20,2 +20,3 @@ var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
var advanceStringIndex = require('../internals/advance-string-index'); | ||
var regExpExec = require('../internals/regexp-exec-abstract'); | ||
var InternalStateModule = require('../internals/internal-state'); | ||
@@ -30,3 +31,2 @@ var IS_PURE = require('../internals/is-pure'); | ||
var RegExpPrototype = RegExp.prototype; | ||
var regExpBuiltinExec = RegExpPrototype.exec; | ||
var nativeMatchAll = ''.matchAll; | ||
@@ -38,12 +38,2 @@ | ||
var regExpExec = function (R, S) { | ||
var exec = R.exec; | ||
var result; | ||
if (typeof exec == 'function') { | ||
result = exec.call(R, S); | ||
if (typeof result != 'object') throw TypeError('Incorrect exec result'); | ||
return result; | ||
} return regExpBuiltinExec.call(R, S); | ||
}; | ||
// eslint-disable-next-line max-len -- ignore | ||
@@ -106,5 +96,5 @@ var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) { | ||
if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments); | ||
matcher = regexp[MATCH_ALL]; | ||
matcher = getMethod(regexp, MATCH_ALL); | ||
if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll; | ||
if (matcher != null) return aFunction(matcher).call(regexp, O); | ||
if (matcher) return matcher.call(regexp, O); | ||
} else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments); | ||
@@ -117,2 +107,2 @@ S = toString(O); | ||
IS_PURE || MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll); | ||
IS_PURE || MATCH_ALL in RegExpPrototype || redefine(RegExpPrototype, MATCH_ALL, $matchAll); |
var $ = require('../internals/export'); | ||
var toIndexedObject = require('../internals/to-indexed-object'); | ||
var toObject = require('../internals/to-object'); | ||
var toLength = require('../internals/to-length'); | ||
var toString = require('../internals/to-string'); | ||
var ArrayPrototype = Array.prototype; | ||
var push = ArrayPrototype.push; | ||
var join = ArrayPrototype.join; | ||
// `String.raw` method | ||
@@ -10,3 +15,3 @@ // https://tc39.es/ecma262/#sec-string.raw | ||
raw: function raw(template) { | ||
var rawTemplate = toIndexedObject(template.raw); | ||
var rawTemplate = toIndexedObject(toObject(template).raw); | ||
var literalSegments = toLength(rawTemplate.length); | ||
@@ -17,6 +22,6 @@ var argumentsLength = arguments.length; | ||
while (literalSegments > i) { | ||
elements.push(toString(rawTemplate[i++])); | ||
if (i < argumentsLength) elements.push(toString(arguments[i])); | ||
} return elements.join(''); | ||
push.call(elements, toString(rawTemplate[i++])); | ||
if (i < argumentsLength) push.call(elements, toString(arguments[i])); | ||
} return join.call(elements, ''); | ||
} | ||
}); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var requireObjectCoercible = require('../internals/require-object-coercible'); | ||
var isCallable = require('../internals/is-callable'); | ||
var isRegExp = require('../internals/is-regexp'); | ||
var toString = require('../internals/to-string'); | ||
var getMethod = require('../internals/get-method'); | ||
var getRegExpFlags = require('../internals/regexp-flags'); | ||
@@ -39,4 +41,4 @@ var getSubstitution = require('../internals/get-substitution'); | ||
} | ||
replacer = searchValue[REPLACE]; | ||
if (replacer !== undefined) { | ||
replacer = getMethod(searchValue, REPLACE); | ||
if (replacer) { | ||
return replacer.call(searchValue, O, replaceValue); | ||
@@ -49,3 +51,3 @@ } else if (IS_PURE && IS_REG_EXP) { | ||
searchString = toString(searchValue); | ||
functionalReplace = typeof replaceValue === 'function'; | ||
functionalReplace = isCallable(replaceValue); | ||
if (!functionalReplace) replaceValue = toString(replaceValue); | ||
@@ -52,0 +54,0 @@ searchLength = searchString.length; |
@@ -16,5 +16,5 @@ 'use strict'; | ||
// https://tc39.es/ecma262/#String.prototype.trimright | ||
$({ target: 'String', proto: true, forced: FORCED }, { | ||
$({ target: 'String', proto: true, name: 'trimEnd', forced: FORCED }, { | ||
trimEnd: trimEnd, | ||
trimRight: trimEnd | ||
}); |
@@ -16,5 +16,5 @@ 'use strict'; | ||
// https://tc39.es/ecma262/#String.prototype.trimleft | ||
$({ target: 'String', proto: true, forced: FORCED }, { | ||
$({ target: 'String', proto: true, name: 'trimStart', forced: FORCED }, { | ||
trimStart: trimStart, | ||
trimLeft: trimStart | ||
}); |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var isArray = require('../internals/is-array'); | ||
var isCallable = require('../internals/is-callable'); | ||
var isObject = require('../internals/is-object'); | ||
@@ -28,3 +29,2 @@ var isSymbol = require('../internals/is-symbol'); | ||
var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); | ||
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); | ||
var redefine = require('../internals/redefine'); | ||
@@ -290,3 +290,3 @@ var shared = require('../internals/shared'); | ||
if (!isArray(replacer)) replacer = function (key, value) { | ||
if (typeof $replacer == 'function') value = $replacer.call(this, key, value); | ||
if (isCallable($replacer)) value = $replacer.call(this, key, value); | ||
if (!isSymbol(value)) return value; | ||
@@ -303,3 +303,6 @@ }; | ||
if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) { | ||
createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); | ||
var valueOf = $Symbol[PROTOTYPE].valueOf; | ||
redefine($Symbol[PROTOTYPE], TO_PRIMITIVE, function () { | ||
return valueOf.apply(this, arguments); | ||
}); | ||
} | ||
@@ -306,0 +309,0 @@ // `Symbol.prototype[@@toStringTag]` property |
// TODO: Remove from `core-js@4` | ||
require('./es.aggregate-error'); | ||
require('../modules/es.aggregate-error'); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -39,5 +39,5 @@ var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy'); | ||
iterator: anObject(this), | ||
filterer: aFunction(filterer) | ||
filterer: aCallable(filterer) | ||
}); | ||
} | ||
}); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -26,3 +26,3 @@ var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy'); | ||
state.innerIterator = innerIterator = getAsyncIterator(mapped); | ||
state.innerNext = aFunction(innerIterator.next); | ||
state.innerNext = aCallable(innerIterator.next); | ||
return innerLoop(); | ||
@@ -60,3 +60,3 @@ } catch (error2) { reject(error2); } | ||
iterator: anObject(this), | ||
mapper: aFunction(mapper), | ||
mapper: aCallable(mapper), | ||
innerIterator: null, | ||
@@ -63,0 +63,0 @@ innerNext: null |
@@ -25,5 +25,5 @@ // https://github.com/tc39/proposal-iterator-helpers | ||
var object = toObject(O); | ||
var usingIterator = getMethod(object[ASYNC_ITERATOR]); | ||
var usingIterator = getMethod(object, ASYNC_ITERATOR); | ||
var iterator; | ||
if (usingIterator !== undefined) { | ||
if (usingIterator) { | ||
iterator = getAsyncIterator(object, usingIterator); | ||
@@ -34,8 +34,6 @@ if (isPrototypeOf.call(AsyncIteratorPrototype, iterator)) return iterator; | ||
usingIterator = getIteratorMethod(object); | ||
if (usingIterator !== undefined) return new AsyncFromSyncIterator(getIterator(object, usingIterator)); | ||
if (usingIterator) return new AsyncFromSyncIterator(getIterator(object, usingIterator)); | ||
} | ||
return new AsyncIteratorProxy({ | ||
iterator: iterator !== undefined ? iterator : object | ||
}); | ||
return new AsyncIteratorProxy({ iterator: iterator !== undefined ? iterator : object }); | ||
} | ||
}); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -27,5 +27,5 @@ var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy'); | ||
iterator: anObject(this), | ||
mapper: aFunction(mapper) | ||
mapper: aCallable(mapper) | ||
}); | ||
} | ||
}); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -13,6 +13,6 @@ var getBuiltIn = require('../internals/get-built-in'); | ||
var iterator = anObject(this); | ||
var next = aFunction(iterator.next); | ||
var next = aCallable(iterator.next); | ||
var noInitial = arguments.length < 2; | ||
var accumulator = noInitial ? undefined : arguments[1]; | ||
aFunction(reducer); | ||
aCallable(reducer); | ||
@@ -19,0 +19,0 @@ return new Promise(function (resolve, reject) { |
@@ -8,4 +8,4 @@ 'use strict'; | ||
toArray: function toArray() { | ||
return $toArray(this); | ||
return $toArray(this, undefined, []); | ||
} | ||
}); |
// TODO: Remove from `core-js@4` | ||
require('./es.global-this'); | ||
require('../modules/es.global-this'); |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var anInstance = require('../internals/an-instance'); | ||
var isCallable = require('../internals/is-callable'); | ||
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); | ||
@@ -20,3 +21,3 @@ var fails = require('../internals/fails'); | ||
var FORCED = IS_PURE | ||
|| typeof NativeIterator != 'function' | ||
|| !isCallable(NativeIterator) | ||
|| NativeIterator.prototype !== IteratorPrototype | ||
@@ -23,0 +24,0 @@ // FF44- non-standard `Iterator` passes previous tests |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var iterate = require('../internals/iterate'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -12,3 +12,3 @@ | ||
anObject(this); | ||
aFunction(fn); | ||
aCallable(fn); | ||
return !iterate(this, function (value, stop) { | ||
@@ -15,0 +15,0 @@ if (!fn(value)) return stop(); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -27,5 +27,5 @@ var createIteratorProxy = require('../internals/iterator-create-proxy'); | ||
iterator: anObject(this), | ||
filterer: aFunction(filterer) | ||
filterer: aCallable(filterer) | ||
}); | ||
} | ||
}); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var iterate = require('../internals/iterate'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -12,3 +12,3 @@ | ||
anObject(this); | ||
aFunction(fn); | ||
aCallable(fn); | ||
return iterate(this, function (value, stop) { | ||
@@ -15,0 +15,0 @@ if (fn(value)) return stop(value); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -30,3 +30,3 @@ var getIteratorMethod = require('../internals/get-iterator-method'); | ||
if (iteratorMethod === undefined) { | ||
if (!iteratorMethod) { | ||
throw TypeError('.flatMap callback should return an iterable object'); | ||
@@ -36,3 +36,3 @@ } | ||
this.innerIterator = innerIterator = anObject(iteratorMethod.call(mapped)); | ||
this.innerNext = aFunction(innerIterator.next); | ||
this.innerNext = aCallable(innerIterator.next); | ||
} catch (error) { | ||
@@ -48,3 +48,3 @@ iteratorClose(iterator, 'throw', error); | ||
iterator: anObject(this), | ||
mapper: aFunction(mapper), | ||
mapper: aCallable(mapper), | ||
innerIterator: null, | ||
@@ -51,0 +51,0 @@ innerNext: null |
@@ -23,3 +23,3 @@ // https://github.com/tc39/proposal-iterator-helpers | ||
var iterator; | ||
if (usingIterator != null) { | ||
if (usingIterator) { | ||
iterator = getIterator(object, usingIterator); | ||
@@ -29,6 +29,4 @@ if (isPrototypeOf.call(IteratorPrototype, iterator)) return iterator; | ||
iterator = object; | ||
} return new IteratorProxy({ | ||
iterator: iterator | ||
}); | ||
} return new IteratorProxy({ iterator: iterator }); | ||
} | ||
}); |
'use strict'; | ||
// https://github.com/tc39/proposal-iterator-helpers | ||
var $ = require('../internals/export'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -20,5 +20,5 @@ var createIteratorProxy = require('../internals/iterator-create-proxy'); | ||
iterator: anObject(this), | ||
mapper: aFunction(mapper) | ||
mapper: aCallable(mapper) | ||
}); | ||
} | ||
}); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var iterate = require('../internals/iterate'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -12,3 +12,3 @@ | ||
anObject(this); | ||
aFunction(reducer); | ||
aCallable(reducer); | ||
var noInitial = arguments.length < 2; | ||
@@ -15,0 +15,0 @@ var accumulator = noInitial ? undefined : arguments[1]; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var iterate = require('../internals/iterate'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -12,3 +12,3 @@ | ||
anObject(this); | ||
aFunction(fn); | ||
aCallable(fn); | ||
return iterate(this, function (value, stop) { | ||
@@ -15,0 +15,0 @@ if (fn(value)) return stop(); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var bind = require('../internals/function-bind-context'); | ||
@@ -21,3 +21,3 @@ var speciesConstructor = require('../internals/species-constructor'); | ||
var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); | ||
var setter = aFunction(newMap.set); | ||
var setter = aCallable(newMap.set); | ||
iterate(iterator, function (key, value) { | ||
@@ -24,0 +24,0 @@ if (boundFunction(value, key, map)) setter.call(newMap, key, value); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var aCallable = require('../internals/a-callable'); | ||
var getIterator = require('../internals/get-iterator'); | ||
var iterate = require('../internals/iterate'); | ||
var aFunction = require('../internals/a-function'); | ||
@@ -10,14 +11,15 @@ // `Map.groupBy` method | ||
groupBy: function groupBy(iterable, keyDerivative) { | ||
aCallable(keyDerivative); | ||
var iterator = getIterator(iterable); | ||
var newMap = new this(); | ||
aFunction(keyDerivative); | ||
var has = aFunction(newMap.has); | ||
var get = aFunction(newMap.get); | ||
var set = aFunction(newMap.set); | ||
iterate(iterable, function (element) { | ||
var has = aCallable(newMap.has); | ||
var get = aCallable(newMap.get); | ||
var set = aCallable(newMap.set); | ||
iterate(iterator, function (element) { | ||
var derivedKey = keyDerivative(element); | ||
if (!has.call(newMap, derivedKey)) set.call(newMap, derivedKey, [element]); | ||
else get.call(newMap, derivedKey).push(element); | ||
}); | ||
}, { IS_ITERATOR: true }); | ||
return newMap; | ||
} | ||
}); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var iterate = require('../internals/iterate'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
@@ -11,4 +11,4 @@ // `Map.keyBy` method | ||
var newMap = new this(); | ||
aFunction(keyDerivative); | ||
var setter = aFunction(newMap.set); | ||
aCallable(keyDerivative); | ||
var setter = aCallable(newMap.set); | ||
iterate(iterable, function (element) { | ||
@@ -15,0 +15,0 @@ setter.call(newMap, keyDerivative(element), element); |
@@ -8,3 +8,3 @@ 'use strict'; | ||
// `Map.prototype.includes` method | ||
// `Map.prototype.keyOf` method | ||
// https://github.com/tc39/proposal-collection-methods | ||
@@ -11,0 +11,0 @@ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var bind = require('../internals/function-bind-context'); | ||
@@ -21,3 +21,3 @@ var speciesConstructor = require('../internals/species-constructor'); | ||
var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); | ||
var setter = aFunction(newMap.set); | ||
var setter = aCallable(newMap.set); | ||
iterate(iterator, function (key, value) { | ||
@@ -24,0 +24,0 @@ setter.call(newMap, boundFunction(value, key, map), value); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var bind = require('../internals/function-bind-context'); | ||
@@ -21,3 +21,3 @@ var speciesConstructor = require('../internals/species-constructor'); | ||
var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); | ||
var setter = aFunction(newMap.set); | ||
var setter = aCallable(newMap.set); | ||
iterate(iterator, function (key, value) { | ||
@@ -24,0 +24,0 @@ setter.call(newMap, key, boundFunction(value, key, map)); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var IS_PURE = require('../internals/is-pure'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var iterate = require('../internals/iterate'); | ||
@@ -14,3 +14,3 @@ | ||
var map = anObject(this); | ||
var setter = aFunction(map.set); | ||
var setter = aCallable(map.set); | ||
var argumentsLength = arguments.length; | ||
@@ -17,0 +17,0 @@ var i = 0; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var getMapIterator = require('../internals/get-map-iterator'); | ||
@@ -18,3 +18,3 @@ var iterate = require('../internals/iterate'); | ||
var accumulator = noInitial ? undefined : arguments[1]; | ||
aFunction(callbackfn); | ||
aCallable(callbackfn); | ||
iterate(iterator, function (key, value) { | ||
@@ -21,0 +21,0 @@ if (noInitial) { |
@@ -9,4 +9,4 @@ 'use strict'; | ||
// https://github.com/thumbsupep/proposal-upsert | ||
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { | ||
$({ target: 'Map', proto: true, real: true, name: 'upsert', forced: IS_PURE }, { | ||
updateOrInsert: $upsert | ||
}); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
@@ -14,3 +14,3 @@ // `Set.prototype.update` method | ||
var length = arguments.length; | ||
aFunction(callback); | ||
aCallable(callback); | ||
var isPresentInMap = map.has(key); | ||
@@ -20,3 +20,3 @@ if (!isPresentInMap && length < 3) { | ||
} | ||
var value = isPresentInMap ? map.get(key) : aFunction(length > 2 ? arguments[2] : undefined)(key, map); | ||
var value = isPresentInMap ? map.get(key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map); | ||
map.set(key, callback(value, key, map)); | ||
@@ -23,0 +23,0 @@ return map; |
@@ -6,3 +6,5 @@ 'use strict'; | ||
var setSpecies = require('../internals/set-species'); | ||
var aFunction = require('../internals/a-function'); | ||
var aCallable = require('../internals/a-callable'); | ||
var isCallable = require('../internals/is-callable'); | ||
var isConstructor = require('../internals/is-constructor'); | ||
var anObject = require('../internals/an-object'); | ||
@@ -12,3 +14,3 @@ var isObject = require('../internals/is-object'); | ||
var defineProperty = require('../internals/object-define-property').f; | ||
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); | ||
var redefine = require('../internals/redefine'); | ||
var redefineAll = require('../internals/redefine-all'); | ||
@@ -60,3 +62,3 @@ var getIterator = require('../internals/get-iterator'); | ||
try { | ||
if (start = getMethod(observer.start)) start.call(observer, this); | ||
if (start = getMethod(observer, 'start')) start.call(observer, this); | ||
} catch (error) { | ||
@@ -70,5 +72,5 @@ hostReportErrors(error); | ||
var subscription = cleanup; | ||
if (cleanup != null) subscriptionState.cleanup = typeof cleanup.unsubscribe === 'function' | ||
if (cleanup != null) subscriptionState.cleanup = isCallable(cleanup.unsubscribe) | ||
? function () { subscription.unsubscribe(); } | ||
: aFunction(cleanup); | ||
: aCallable(cleanup); | ||
} catch (error) { | ||
@@ -108,3 +110,3 @@ subscriptionObserver.error(error); | ||
try { | ||
var nextMethod = getMethod(observer.next); | ||
var nextMethod = getMethod(observer, 'next'); | ||
if (nextMethod) nextMethod.call(observer, value); | ||
@@ -122,3 +124,3 @@ } catch (error) { | ||
try { | ||
var errorMethod = getMethod(observer.error); | ||
var errorMethod = getMethod(observer, 'error'); | ||
if (errorMethod) errorMethod.call(observer, value); | ||
@@ -137,3 +139,3 @@ else hostReportErrors(value); | ||
try { | ||
var completeMethod = getMethod(observer.complete); | ||
var completeMethod = getMethod(observer, 'complete'); | ||
if (completeMethod) completeMethod.call(observer); | ||
@@ -156,3 +158,3 @@ } catch (error) { | ||
anInstance(this, $Observable, 'Observable'); | ||
setInternalState(this, { subscriber: aFunction(subscriber) }); | ||
setInternalState(this, { subscriber: aCallable(subscriber) }); | ||
}; | ||
@@ -163,3 +165,3 @@ | ||
var length = arguments.length; | ||
return new Subscription(typeof observer === 'function' ? { | ||
return new Subscription(isCallable(observer) ? { | ||
next: observer, | ||
@@ -174,4 +176,4 @@ error: length > 1 ? arguments[1] : undefined, | ||
from: function from(x) { | ||
var C = typeof this === 'function' ? this : $Observable; | ||
var observableMethod = getMethod(anObject(x)[OBSERVABLE]); | ||
var C = isConstructor(this) ? this : $Observable; | ||
var observableMethod = getMethod(anObject(x), OBSERVABLE); | ||
if (observableMethod) { | ||
@@ -193,3 +195,3 @@ var observable = anObject(observableMethod.call(x)); | ||
of: function of() { | ||
var C = typeof this === 'function' ? this : $Observable; | ||
var C = isConstructor(this) ? this : $Observable; | ||
var length = arguments.length; | ||
@@ -208,3 +210,3 @@ var items = new Array(length); | ||
createNonEnumerableProperty($Observable.prototype, OBSERVABLE, function () { return this; }); | ||
redefine($Observable.prototype, OBSERVABLE, function () { return this; }); | ||
@@ -211,0 +213,0 @@ $({ global: true }, { |
// TODO: Remove from `core-js@4` | ||
require('./es.promise.all-settled.js'); | ||
require('../modules/es.promise.all-settled.js'); |
// TODO: Remove from `core-js@4` | ||
require('./es.promise.any'); | ||
require('../modules/es.promise.any'); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var speciesConstructor = require('../internals/species-constructor'); | ||
@@ -17,3 +17,3 @@ var iterate = require('../internals/iterate'); | ||
var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); | ||
var remover = aFunction(newSet['delete']); | ||
var remover = aCallable(newSet['delete']); | ||
iterate(iterable, function (value) { | ||
@@ -20,0 +20,0 @@ remover.call(newSet, value); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var bind = require('../internals/function-bind-context'); | ||
@@ -21,3 +21,3 @@ var speciesConstructor = require('../internals/species-constructor'); | ||
var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); | ||
var adder = aFunction(newSet.add); | ||
var adder = aCallable(newSet.add); | ||
iterate(iterator, function (value) { | ||
@@ -24,0 +24,0 @@ if (boundFunction(value, value, set)) adder.call(newSet, value); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var speciesConstructor = require('../internals/species-constructor'); | ||
@@ -17,4 +17,4 @@ var iterate = require('../internals/iterate'); | ||
var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); | ||
var hasCheck = aFunction(set.has); | ||
var adder = aFunction(newSet.add); | ||
var hasCheck = aCallable(set.has); | ||
var adder = aCallable(newSet.add); | ||
iterate(iterable, function (value) { | ||
@@ -21,0 +21,0 @@ if (hasCheck.call(set, value)) adder.call(newSet, value); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var IS_PURE = require('../internals/is-pure'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var iterate = require('../internals/iterate'); | ||
@@ -13,3 +13,3 @@ | ||
var set = anObject(this); | ||
var hasCheck = aFunction(set.has); | ||
var hasCheck = aCallable(set.has); | ||
return !iterate(iterable, function (value, stop) { | ||
@@ -16,0 +16,0 @@ if (hasCheck.call(set, value) === true) return stop(); |
@@ -5,4 +5,5 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var isCallable = require('../internals/is-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var getIterator = require('../internals/get-iterator'); | ||
@@ -18,5 +19,5 @@ var iterate = require('../internals/iterate'); | ||
var hasCheck = otherSet.has; | ||
if (typeof hasCheck != 'function') { | ||
if (!isCallable(hasCheck)) { | ||
otherSet = new (getBuiltIn('Set'))(iterable); | ||
hasCheck = aFunction(otherSet.has); | ||
hasCheck = aCallable(otherSet.has); | ||
} | ||
@@ -23,0 +24,0 @@ return !iterate(iterator, function (value, stop) { |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var IS_PURE = require('../internals/is-pure'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var iterate = require('../internals/iterate'); | ||
@@ -13,3 +13,3 @@ | ||
var set = anObject(this); | ||
var hasCheck = aFunction(set.has); | ||
var hasCheck = aCallable(set.has); | ||
return !iterate(iterable, function (value, stop) { | ||
@@ -16,0 +16,0 @@ if (hasCheck.call(set, value) === false) return stop(); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var bind = require('../internals/function-bind-context'); | ||
@@ -21,3 +21,3 @@ var speciesConstructor = require('../internals/species-constructor'); | ||
var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); | ||
var adder = aFunction(newSet.add); | ||
var adder = aCallable(newSet.add); | ||
iterate(iterator, function (value) { | ||
@@ -24,0 +24,0 @@ adder.call(newSet, boundFunction(value, value, set)); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var IS_PURE = require('../internals/is-pure'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var getSetIterator = require('../internals/get-set-iterator'); | ||
@@ -17,3 +17,3 @@ var iterate = require('../internals/iterate'); | ||
var accumulator = noInitial ? undefined : arguments[1]; | ||
aFunction(callbackfn); | ||
aCallable(callbackfn); | ||
iterate(iterator, function (value) { | ||
@@ -20,0 +20,0 @@ if (noInitial) { |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var speciesConstructor = require('../internals/species-constructor'); | ||
@@ -17,4 +17,4 @@ var iterate = require('../internals/iterate'); | ||
var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); | ||
var remover = aFunction(newSet['delete']); | ||
var adder = aFunction(newSet.add); | ||
var remover = aCallable(newSet['delete']); | ||
var adder = aCallable(newSet.add); | ||
iterate(iterable, function (value) { | ||
@@ -21,0 +21,0 @@ remover.call(newSet, value) || adder.call(newSet, value); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var aCallable = require('../internals/a-callable'); | ||
var anObject = require('../internals/an-object'); | ||
var aFunction = require('../internals/a-function'); | ||
var speciesConstructor = require('../internals/species-constructor'); | ||
@@ -17,5 +17,5 @@ var iterate = require('../internals/iterate'); | ||
var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); | ||
iterate(iterable, aFunction(newSet.add), { that: newSet }); | ||
iterate(iterable, aCallable(newSet.add), { that: newSet }); | ||
return newSet; | ||
} | ||
}); |
// TODO: Remove from `core-js@4` | ||
require('./es.string.match-all'); | ||
require('../modules/es.string.match-all'); |
// TODO: Remove from `core-js@4` | ||
require('./es.string.replace-all'); | ||
require('../modules/es.string.replace-all'); |
@@ -1,2 +0,2 @@ | ||
require('./es.array.iterator'); | ||
require('../modules/es.array.iterator'); | ||
var DOMIterables = require('../internals/dom-iterables'); | ||
@@ -3,0 +3,0 @@ var global = require('../internals/global'); |
var $ = require('../internals/export'); | ||
var global = require('../internals/global'); | ||
var isCallable = require('../internals/is-callable'); | ||
var userAgent = require('../internals/engine-user-agent'); | ||
@@ -14,3 +15,3 @@ | ||
// eslint-disable-next-line no-new-func -- spec requirement | ||
(typeof handler == 'function' ? handler : Function(handler)).apply(this, args); | ||
(isCallable(handler) ? handler : Function(handler)).apply(this, args); | ||
} : handler, timeout); | ||
@@ -17,0 +18,0 @@ }; |
@@ -13,2 +13,3 @@ 'use strict'; | ||
var anInstance = require('../internals/an-instance'); | ||
var isCallable = require('../internals/is-callable'); | ||
var hasOwn = require('../internals/has'); | ||
@@ -146,3 +147,3 @@ var bind = require('../internals/function-bind-context'); | ||
iteratorMethod = getIteratorMethod(init); | ||
if (typeof iteratorMethod === 'function') { | ||
if (iteratorMethod) { | ||
iterator = getIterator(init, iteratorMethod); | ||
@@ -303,3 +304,3 @@ next = iterator.next; | ||
// `URLSearchParams.prototype[@@iterator]` method | ||
redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries); | ||
redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' }); | ||
@@ -326,3 +327,3 @@ // `URLSearchParams.prototype.toString` method | ||
// Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams` | ||
if (!USE_NATIVE_URL && typeof Headers == 'function') { | ||
if (!USE_NATIVE_URL && isCallable(Headers)) { | ||
var wrapRequestOptions = function (init) { | ||
@@ -345,3 +346,3 @@ if (isObject(init)) { | ||
if (typeof nativeFetch == 'function') { | ||
if (isCallable(nativeFetch)) { | ||
$({ global: true, enumerable: true, forced: true }, { | ||
@@ -354,3 +355,3 @@ fetch: function fetch(input /* , init */) { | ||
if (typeof NativeRequest == 'function') { | ||
if (isCallable(NativeRequest)) { | ||
var RequestConstructor = function Request(input /* , init */) { | ||
@@ -357,0 +358,0 @@ anInstance(this, RequestConstructor, 'Request'); |
{ | ||
"name": "core-js-pure", | ||
"description": "Standard library", | ||
"version": "3.17.3", | ||
"version": "3.18.0", | ||
"repository": { | ||
@@ -57,3 +57,3 @@ "type": "git", | ||
}, | ||
"gitHead": "c65f52bdd73b4ff6eee0bd3ec39ddad901dbfa49" | ||
"gitHead": "272ac1b4515c5cfbf348b069f1da829165a7181e" | ||
} |
require('../proposals/array-filtering'); | ||
require('../proposals/array-from-async'); | ||
require('../proposals/array-grouping'); | ||
@@ -3,0 +4,0 @@ require('../proposals/array-last'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
676043
1879
16279