New upstream version 12.6.3

This commit is contained in:
Sruthi Chandran 2020-01-12 00:16:45 +05:30
parent 86274ece36
commit 9d6df11a27
188 changed files with 579 additions and 529 deletions

View file

@ -1,5 +1,17 @@
Please view this file on the master branch, on stable branches it's out of date.
## 12.6.3
- No changes.
## 12.6.2
### Security (2 changes)
- Don't publish drafts if user can't create notes.
- Remove protected tag access when group is removed.
## 12.6.1
- No changes.

View file

@ -2,6 +2,26 @@
documentation](doc/development/changelog.md) for instructions on adding your own
entry.
## 12.6.3
- No changes.
### Security (1 change)
- Upgrade json-jwt to v1.11.0. !22440
### Fixed (9 changes)
- Fix RefreshMergeRequestsService raises an exception and unnecessary sidekiq retry. !22262
- Disable Prometheus metrics if initialization fails. !22355
- Fix bug when trying to expose artifacts and no artifacts are produced by the job. !22378
- Gracefully error handle CI lint errors in artifacts section. !22388
- Fix GitLab plugins not working without hooks configured. !22409
- Fix releases page when tag contains a slash. !22527
- Reverts Add RBAC permissions for getting knative version. !22560
- Remove unused keyword from EKS provision service. !22633
- Fix CAS users being signed out repeatedly. !22704
## 12.6.2
### Security (6 changes)

View file

@ -1 +1 @@
a4b6c71d4b7c1588587345e2dfe0c6bd7cc63a83
1.77.1

View file

@ -327,7 +327,7 @@ group :metrics do
gem 'influxdb', '~> 0.2', require: false
# Prometheus
gem 'prometheus-client-mmap', '~> 0.9.10'
gem 'prometheus-client-mmap', '~> 0.10.0'
gem 'raindrops', '~> 0.18'
end

View file

@ -531,8 +531,8 @@ GEM
regexp_parser (~> 1.1)
regexp_property_values (~> 0.3)
json (1.8.6)
json-jwt (1.9.4)
activesupport
json-jwt (1.11.0)
activesupport (>= 4.2)
aes_key_wrap
bindata
json-schema (2.8.0)
@ -746,7 +746,7 @@ GEM
parser
unparser
procto (0.0.3)
prometheus-client-mmap (0.9.10)
prometheus-client-mmap (0.10.0)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
@ -1283,7 +1283,7 @@ DEPENDENCIES
peek (~> 1.1)
pg (~> 1.1)
premailer-rails (~> 1.10.3)
prometheus-client-mmap (~> 0.9.10)
prometheus-client-mmap (~> 0.10.0)
pry-byebug (~> 3.5.1)
pry-rails (~> 0.3.4)
rack (~> 2.0.7)

View file

@ -1 +1 @@
12.6.2
12.6.3

View file

@ -1,25 +0,0 @@
# frozen_string_literal: true
module Clusters
class KnativeServingNamespaceFinder
attr_reader :cluster
def initialize(cluster)
@cluster = cluster
end
def execute
cluster.kubeclient&.get_namespace(Clusters::Kubernetes::KNATIVE_SERVING_NAMESPACE)
rescue Kubeclient::ResourceNotFoundError
nil
rescue Kubeclient::HttpError => e
# If the kubernetes auth engine is enabled, it will return 403
if e.error_code == 403
Gitlab::ErrorTracking.track_exception(e)
nil
else
raise
end
end
end
end

View file

@ -1,17 +0,0 @@
# frozen_string_literal: true
module Clusters
class KnativeVersionRoleBindingFinder
attr_reader :cluster
def initialize(cluster)
@cluster = cluster
end
def execute
cluster.kubeclient&.get_cluster_role_binding(Clusters::Kubernetes::GITLAB_KNATIVE_VERSION_ROLE_BINDING_NAME)
rescue Kubeclient::ResourceNotFoundError
nil
end
end
end

View file

@ -1320,7 +1320,7 @@ class Project < ApplicationRecord
end
def has_active_hooks?(hooks_scope = :push_hooks)
hooks.hooks_for(hooks_scope).any? || SystemHook.hooks_for(hooks_scope).any?
hooks.hooks_for(hooks_scope).any? || SystemHook.hooks_for(hooks_scope).any? || Gitlab::Plugin.any?
end
def has_active_services?(hooks_scope = :push_hooks)

View file

@ -40,7 +40,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
def evidence_file_path
return unless release.evidence.present?
evidence_project_release_url(project, tag, format: :json)
evidence_project_release_url(project, release.to_param, format: :json)
end
private

View file

@ -46,6 +46,8 @@ module Ci
# it could contain many. We only need to know whether it has 1 or more
# artifacts, so fetching the first 2 would be sufficient.
def first_2_metadata_entries_for_artifacts_paths(job)
return [] unless job.artifacts_metadata
job.artifacts_paths
.lazy
.map { |path| job.artifacts_metadata_entry(path, recursive: true) }

View file

@ -38,8 +38,7 @@ module Clusters
def credentials
@credentials ||= Clusters::Aws::FetchCredentialsService.new(
provision_role,
provider: provider,
region: provider.region
provider: provider
).execute
end

View file

@ -12,8 +12,5 @@ module Clusters
GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME = 'gitlab-knative-serving-rolebinding'
GITLAB_CROSSPLANE_DATABASE_ROLE_NAME = 'gitlab-crossplane-database-role'
GITLAB_CROSSPLANE_DATABASE_ROLE_BINDING_NAME = 'gitlab-crossplane-database-rolebinding'
GITLAB_KNATIVE_VERSION_ROLE_NAME = 'gitlab-knative-version-role'
GITLAB_KNATIVE_VERSION_ROLE_BINDING_NAME = 'gitlab-knative-version-rolebinding'
KNATIVE_SERVING_NAMESPACE = 'knative-serving'
end
end

View file

@ -49,14 +49,8 @@ module Clusters
create_or_update_knative_serving_role
create_or_update_knative_serving_role_binding
create_or_update_crossplane_database_role
create_or_update_crossplane_database_role_binding
return unless knative_serving_namespace
create_or_update_knative_version_role
create_or_update_knative_version_role_binding
end
private
@ -70,12 +64,6 @@ module Clusters
).ensure_exists!
end
def knative_serving_namespace
kubeclient.get_namespace(Clusters::Kubernetes::KNATIVE_SERVING_NAMESPACE)
rescue Kubeclient::ResourceNotFoundError
nil
end
def create_role_or_cluster_role_binding
if namespace_creator
kubeclient.create_or_update_role_binding(role_binding_resource)
@ -100,14 +88,6 @@ module Clusters
kubeclient.update_role_binding(crossplane_database_role_binding_resource)
end
def create_or_update_knative_version_role
kubeclient.update_cluster_role(knative_version_role_resource)
end
def create_or_update_knative_version_role_binding
kubeclient.update_cluster_role_binding(knative_version_role_binding_resource)
end
def service_account_resource
Gitlab::Kubernetes::ServiceAccount.new(
service_account_name,
@ -186,27 +166,6 @@ module Clusters
service_account_name: service_account_name
).generate
end
def knative_version_role_resource
Gitlab::Kubernetes::ClusterRole.new(
name: Clusters::Kubernetes::GITLAB_KNATIVE_VERSION_ROLE_NAME,
rules: [{
apiGroups: %w(apps),
resources: %w(deployments),
verbs: %w(list get)
}]
).generate
end
def knative_version_role_binding_resource
subjects = [{ kind: 'ServiceAccount', name: service_account_name, namespace: service_account_namespace }]
Gitlab::Kubernetes::ClusterRoleBinding.new(
Clusters::Kubernetes::GITLAB_KNATIVE_VERSION_ROLE_BINDING_NAME,
Clusters::Kubernetes::GITLAB_KNATIVE_VERSION_ROLE_NAME,
subjects
).generate
end
end
end
end

View file

@ -260,6 +260,10 @@ module Gitlab
caching_config_hash[:pool_timeout] = 1
end
# Overrides RedisCacheStore's default value of 0
# This makes the default value the same with Gitlab::Redis::Cache
caching_config_hash[:reconnect_attempts] ||= ::Redis::Client::DEFAULTS[:reconnect_attempts]
config.cache_store = :redis_cache_store, caching_config_hash
config.active_job.queue_adapter = :sidekiq

View file

@ -43,6 +43,9 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
defined?(::Prometheus::Client.reinitialize_on_pid_change) && Prometheus::Client.reinitialize_on_pid_change
Gitlab::Metrics::Samplers::RubySampler.initialize_instance(Settings.monitoring.ruby_sampler_interval).start
rescue IOError => e
Gitlab::ErrorTracking.track_exception(e)
Gitlab::Metrics.error_detected!
end
Gitlab::Cluster::LifecycleEvents.on_master_start do
@ -55,6 +58,9 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
end
Gitlab::Metrics::RequestsRackMiddleware.initialize_http_request_duration_seconds
rescue IOError => e
Gitlab::ErrorTracking.track_exception(e)
Gitlab::Metrics.error_detected!
end
end

View file

@ -1,4 +1,4 @@
Copyright (c) 2014-2019 Denis Pushkarev
Copyright (c) 2014-2020 Denis Pushkarev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,3 +1,4 @@
require('../../modules/es.regexp.exec');
require('../../modules/es.regexp.test');
module.exports = function (re, string) {

View file

@ -1,3 +1,4 @@
require('../../modules/es.regexp.exec');
require('../../modules/es.string.from-code-point');
require('../../modules/es.string.raw');
require('../../modules/es.string.code-point-at');

View file

@ -1,3 +1,4 @@
require('../../modules/es.regexp.exec');
require('../../modules/es.string.match');
var entryUnbind = require('../../internals/entry-unbind');

View file

@ -1,3 +1,4 @@
require('../../modules/es.regexp.exec');
require('../../modules/es.string.replace');
var entryUnbind = require('../../internals/entry-unbind');

View file

@ -1,3 +1,4 @@
require('../../modules/es.regexp.exec');
require('../../modules/es.string.search');
var entryUnbind = require('../../internals/entry-unbind');

View file

@ -1,3 +1,4 @@
require('../../modules/es.regexp.exec');
require('../../modules/es.string.split');
var entryUnbind = require('../../internals/entry-unbind');

View file

@ -1,4 +1,4 @@
require('../../modules/es.symbol.async-iterator');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('asyncIterator');

View file

@ -1,5 +1,5 @@
require('../../modules/es.symbol.has-instance');
require('../../modules/es.function.has-instance');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('hasInstance');

View file

@ -1,5 +1,5 @@
require('../../modules/es.symbol.is-concat-spreadable');
require('../../modules/es.array.concat');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('isConcatSpreadable');

View file

@ -1,6 +1,6 @@
require('../../modules/es.symbol.iterator');
require('../../modules/es.string.iterator');
require('../../modules/web.dom-collections.iterator');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('iterator');

View file

@ -1,5 +1,5 @@
require('../../modules/es.symbol.match-all');
require('../../modules/es.string.match-all');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('matchAll');

View file

@ -1,5 +1,5 @@
require('../../modules/es.symbol.match');
require('../../modules/es.string.match');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('match');

View file

@ -1,5 +1,5 @@
require('../../modules/es.symbol.replace');
require('../../modules/es.string.replace');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('replace');

View file

@ -1,5 +1,5 @@
require('../../modules/es.symbol.search');
require('../../modules/es.string.search');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('search');

View file

@ -1,4 +1,4 @@
require('../../modules/es.symbol.species');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('species');

View file

@ -1,5 +1,5 @@
require('../../modules/es.symbol.split');
require('../../modules/es.string.split');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('split');

View file

@ -1,4 +1,4 @@
require('../../modules/es.symbol.to-primitive');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('toPrimitive');

View file

@ -2,6 +2,6 @@ require('../../modules/es.symbol.to-string-tag');
require('../../modules/es.object.to-string');
require('../../modules/es.math.to-string-tag');
require('../../modules/es.json.to-string-tag');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('toStringTag');

View file

@ -1,4 +1,4 @@
require('../../modules/es.symbol.unscopables');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('unscopables');

View file

@ -1,4 +1,4 @@
require('../../modules/esnext.symbol.async-dispose');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('asyncDispose');

View file

@ -1,4 +1,4 @@
require('../../modules/esnext.symbol.dispose');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('dispose');

View file

@ -1,4 +1,4 @@
require('../../modules/esnext.symbol.observable');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('observable');

View file

@ -1,4 +1,4 @@
require('../../modules/esnext.symbol.pattern-match');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('patternMatch');

View file

@ -1,5 +1,5 @@
// TODO: Remove from `core-js@4`
require('../../modules/esnext.symbol.replace-all');
var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('replaceAll');

View file

@ -0,0 +1 @@
module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';

View file

@ -1,4 +1,5 @@
'use strict';
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');
var DESCRIPTORS = require('../internals/descriptors');
var global = require('../internals/global');
var isObject = require('../internals/is-object');
@ -12,8 +13,6 @@ var setPrototypeOf = require('../internals/object-set-prototype-of');
var wellKnownSymbol = require('../internals/well-known-symbol');
var uid = require('../internals/uid');
var DataView = global.DataView;
var DataViewPrototype = DataView && DataView.prototype;
var Int8Array = global.Int8Array;
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
var Uint8ClampedArray = global.Uint8ClampedArray;
@ -25,7 +24,6 @@ var isPrototypeOf = ObjectPrototype.isPrototypeOf;
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
var NATIVE_ARRAY_BUFFER = !!(global.ArrayBuffer && DataView);
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';
var TYPED_ARRAY_TAG_REQIRED = false;
@ -144,13 +142,7 @@ if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {
}
}
// WebKit bug - the same parent prototype for typed arrays and data view
if (NATIVE_ARRAY_BUFFER && setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
setPrototypeOf(DataViewPrototype, ObjectPrototype);
}
module.exports = {
NATIVE_ARRAY_BUFFER: NATIVE_ARRAY_BUFFER,
NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
aTypedArray: aTypedArray,

View file

@ -1,7 +1,7 @@
'use strict';
var global = require('../internals/global');
var DESCRIPTORS = require('../internals/descriptors');
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER;
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var redefineAll = require('../internals/redefine-all');
var fails = require('../internals/fails');
@ -10,6 +10,8 @@ var toInteger = require('../internals/to-integer');
var toLength = require('../internals/to-length');
var toIndex = require('../internals/to-index');
var IEEE754 = require('../internals/ieee754');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var setPrototypeOf = require('../internals/object-set-prototype-of');
var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
var defineProperty = require('../internals/object-define-property').f;
var arrayFill = require('../internals/array-fill');
@ -26,6 +28,8 @@ var WRONG_INDEX = 'Wrong index';
var NativeArrayBuffer = global[ARRAY_BUFFER];
var $ArrayBuffer = NativeArrayBuffer;
var $DataView = global[DATA_VIEW];
var $DataViewPrototype = $DataView && $DataView[PROTOTYPE];
var ObjectPrototype = Object.prototype;
var RangeError = global.RangeError;
var packIEEE754 = IEEE754.pack;
@ -192,12 +196,18 @@ if (!NATIVE_ARRAY_BUFFER) {
}
ArrayBufferPrototype.constructor = $ArrayBuffer;
}
// WebKit bug - the same parent prototype for typed arrays and data view
if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {
setPrototypeOf($DataViewPrototype, ObjectPrototype);
}
// iOS Safari 7.x bug
var testView = new $DataView(new $ArrayBuffer(2));
var nativeSetInt8 = $DataView[PROTOTYPE].setInt8;
var nativeSetInt8 = $DataViewPrototype.setInt8;
testView.setInt8(0, 2147483648);
testView.setInt8(1, 2147483649);
if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {
setInt8: function setInt8(byteOffset, value) {
nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
},

View file

@ -1,9 +1,13 @@
'use strict';
var $forEach = require('../internals/array-iteration').forEach;
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('forEach');
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
// `Array.prototype.forEach` method implementation
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
module.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
} : [].forEach;

View file

@ -1,5 +1,5 @@
'use strict';
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var toObject = require('../internals/to-object');
var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
@ -15,9 +15,9 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var index = 0;
var iteratorMethod = getIteratorMethod(O);
var length, result, step, iterator, next;
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))) {
@ -25,16 +25,15 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
next = iterator.next;
result = new C();
for (;!(step = next.call(iterator)).done; index++) {
createProperty(result, index, mapping
? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true)
: step.value
);
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
createProperty(result, index, value);
}
} else {
length = toLength(O.length);
result = new C(length);
for (;length > index; index++) {
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
value = mapping ? mapfn(O[index], index) : O[index];
createProperty(result, index, value);
}
}
result.length = index;

View file

@ -1,4 +1,4 @@
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var IndexedObject = require('../internals/indexed-object');
var toObject = require('../internals/to-object');
var toLength = require('../internals/to-length');

View file

@ -2,16 +2,19 @@
var toIndexedObject = require('../internals/to-indexed-object');
var toInteger = require('../internals/to-integer');
var toLength = require('../internals/to-length');
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var min = Math.min;
var nativeLastIndexOf = [].lastIndexOf;
var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
var SLOPPY_METHOD = sloppyArrayMethod('lastIndexOf');
var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
var USES_TO_LENGTH = arrayMethodUsesToLength('lastIndexOf', { ACCESSORS: true, 1: 2147483647 });
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
// `Array.prototype.lastIndexOf` method implementation
// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
module.exports = (NEGATIVE_ZERO || SLOPPY_METHOD) ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
// convert -0 to +0
if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
var O = toIndexedObject(this);

View file

@ -1,6 +1,6 @@
var fails = require('../internals/fails');
var wellKnownSymbol = require('../internals/well-known-symbol');
var V8_VERSION = require('../internals/v8-version');
var V8_VERSION = require('../internals/engine-v8-version');
var SPECIES = wellKnownSymbol('species');

View file

@ -3,7 +3,7 @@ var fails = require('../internals/fails');
module.exports = function (METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !method || !fails(function () {
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call,no-throw-literal
method.call(null, argument || function () { throw 1; }, 1);
});

View file

@ -0,0 +1,30 @@
var DESCRIPTORS = require('../internals/descriptors');
var fails = require('../internals/fails');
var has = require('../internals/has');
var defineProperty = Object.defineProperty;
var thrower = function (it) { throw it; };
module.exports = function (METHOD_NAME, options) {
if (!options) options = {};
var method = [][METHOD_NAME];
var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
var argument0 = has(options, 0) ? options[0] : thrower;
var argument1 = has(options, 1) ? options[1] : undefined;
return !!method && !fails(function () {
if (ACCESSORS && !DESCRIPTORS) return true;
var O = { length: -1 };
var addTrap = function (key) {
if (ACCESSORS) defineProperty(O, key, { enumerable: true, get: thrower });
else O[key] = 1;
};
addTrap(1);
addTrap(2147483646);
addTrap(4294967294);
method.call(O, argument0, argument1);
});
};

View file

@ -1,7 +1,7 @@
'use strict';
// https://tc39.github.io/proposal-setmap-offrom/
var aFunction = require('../internals/a-function');
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var iterate = require('../internals/iterate');
module.exports = function from(source /* , mapFn, thisArg */) {

View file

@ -2,7 +2,7 @@
var defineProperty = require('../internals/object-define-property').f;
var create = require('../internals/object-create');
var redefineAll = require('../internals/redefine-all');
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var anInstance = require('../internals/an-instance');
var iterate = require('../internals/iterate');
var defineIterator = require('../internals/define-iterator');

View file

@ -1,6 +1,6 @@
var path = require('../internals/path');
var has = require('../internals/has');
var wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol');
var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');
var defineProperty = require('../internals/object-define-property').f;
module.exports = function (NAME) {

View file

@ -2,5 +2,5 @@ var fails = require('../internals/fails');
// Thank's IE8 for his funny defineProperty
module.exports = !fails(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
});

View file

@ -1,3 +1,3 @@
var userAgent = require('../internals/user-agent');
var userAgent = require('../internals/engine-user-agent');
module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);

View file

@ -1,5 +1,5 @@
var global = require('../internals/global');
var userAgent = require('../internals/user-agent');
var userAgent = require('../internals/engine-user-agent');
var process = global.process;
var versions = process && process.versions;

View file

@ -1,5 +1,5 @@
var global = require('../internals/global');
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var call = Function.call;

View file

@ -1,4 +1,6 @@
'use strict';
// TODO: Remove from `core-js@4` since it's moved to entry points
require('../modules/es.regexp.exec');
var redefine = require('../internals/redefine');
var fails = require('../internals/fails');
var wellKnownSymbol = require('../internals/well-known-symbol');
@ -26,6 +28,15 @@ var REPLACE_KEEPS_$0 = (function () {
return 'a'.replace(/./, '$0') === '$0';
})();
var REPLACE = wellKnownSymbol('replace');
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
if (/./[REPLACE]) {
return /./[REPLACE]('a', '$0') === '';
}
return false;
})();
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
@ -73,7 +84,11 @@ module.exports = function (KEY, length, exec, sham) {
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
(KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
(KEY === 'replace' && !(
REPLACE_SUPPORTS_NAMED_GROUPS &&
REPLACE_KEEPS_$0 &&
!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
)) ||
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
) {
var nativeRegExpMethod = /./[SYMBOL];
@ -88,7 +103,10 @@ module.exports = function (KEY, length, exec, sham) {
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
}
return { done: false };
}, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
}, {
REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
});
var stringMethod = methods[0];
var regexMethod = methods[1];

View file

@ -1,7 +1,7 @@
'use strict';
var isArray = require('../internals/is-array');
var toLength = require('../internals/to-length');
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
// `FlattenIntoArray` abstract operation
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray

View file

@ -1,7 +1,7 @@
var anObject = require('../internals/an-object');
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
var toLength = require('../internals/to-length');
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var getIteratorMethod = require('../internals/get-iterator-method');
var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');

View file

@ -2,7 +2,7 @@ var global = require('../internals/global');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var classof = require('../internals/classof-raw');
var macrotask = require('../internals/task').set;
var IS_IOS = require('../internals/is-ios');
var IS_IOS = require('../internals/engine-is-ios');
var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;

View file

@ -2,13 +2,13 @@ var global = require('../internals/global');
var trim = require('../internals/string-trim').trim;
var whitespaces = require('../internals/whitespaces');
var nativeParseFloat = global.parseFloat;
var FORCED = 1 / nativeParseFloat(whitespaces + '-0') !== -Infinity;
var $parseFloat = global.parseFloat;
var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
// `parseFloat` method
// https://tc39.github.io/ecma262/#sec-parsefloat-string
module.exports = FORCED ? function parseFloat(string) {
var trimmedString = trim(String(string));
var result = nativeParseFloat(trimmedString);
var result = $parseFloat(trimmedString);
return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
} : nativeParseFloat;
} : $parseFloat;

View file

@ -2,13 +2,13 @@ var global = require('../internals/global');
var trim = require('../internals/string-trim').trim;
var whitespaces = require('../internals/whitespaces');
var nativeParseInt = global.parseInt;
var $parseInt = global.parseInt;
var hex = /^[+-]?0[Xx]/;
var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
// `parseInt` method
// https://tc39.github.io/ecma262/#sec-parseint-string-radix
module.exports = FORCED ? function parseInt(string, radix) {
var S = trim(String(string));
return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
} : nativeParseInt;
return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
} : $parseInt;

View file

@ -4,7 +4,7 @@ var store = require('../internals/shared-store');
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.6.1',
version: '3.6.3',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
});

View file

@ -1,5 +1,5 @@
// https://github.com/zloirock/core-js/issues/280
var userAgent = require('../internals/user-agent');
var userAgent = require('../internals/engine-user-agent');
// eslint-disable-next-line unicorn/no-unsafe-regex
module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);

View file

@ -1,10 +1,10 @@
var global = require('../internals/global');
var fails = require('../internals/fails');
var classof = require('../internals/classof-raw');
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var html = require('../internals/html');
var createElement = require('../internals/document-create-element');
var IS_IOS = require('../internals/is-ios');
var IS_IOS = require('../internals/engine-is-ios');
var location = global.location;
var set = global.setImmediate;

View file

@ -2,7 +2,7 @@
var $ = require('../internals/export');
var global = require('../internals/global');
var DESCRIPTORS = require('../internals/descriptors');
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-arrays-constructors-requires-wrappers');
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var ArrayBufferModule = require('../internals/array-buffer');
var anInstance = require('../internals/an-instance');

View file

@ -2,7 +2,7 @@ var toObject = require('../internals/to-object');
var toLength = require('../internals/to-length');
var getIteratorMethod = require('../internals/get-iterator-method');
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
var bind = require('../internals/bind-context');
var bind = require('../internals/function-bind-context');
var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;
module.exports = function from(source /* , mapfn, thisArg */) {

View file

@ -9,7 +9,7 @@ var createProperty = require('../internals/create-property');
var arraySpeciesCreate = require('../internals/array-species-create');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var wellKnownSymbol = require('../internals/well-known-symbol');
var V8_VERSION = require('../internals/v8-version');
var V8_VERSION = require('../internals/engine-v8-version');
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;

View file

@ -1,11 +1,15 @@
'use strict';
var $ = require('../internals/export');
var $every = require('../internals/array-iteration').every;
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('every');
var USES_TO_LENGTH = arrayMethodUsesToLength('every');
// `Array.prototype.every` method
// https://tc39.github.io/ecma262/#sec-array.prototype.every
$({ target: 'Array', proto: true, forced: sloppyArrayMethod('every') }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}

View file

@ -1,14 +1,12 @@
'use strict';
var $ = require('../internals/export');
var $filter = require('../internals/array-iteration').filter;
var fails = require('../internals/fails');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
// Edge 14- issue
var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
[].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
});
var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
// `Array.prototype.filter` method
// https://tc39.github.io/ecma262/#sec-array.prototype.filter

View file

@ -2,16 +2,19 @@
var $ = require('../internals/export');
var $findIndex = require('../internals/array-iteration').findIndex;
var addToUnscopables = require('../internals/add-to-unscopables');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var FIND_INDEX = 'findIndex';
var SKIPS_HOLES = true;
var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX);
// Shouldn't skip holes
if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
// `Array.prototype.findIndex` method
// https://tc39.github.io/ecma262/#sec-array.prototype.findindex
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
findIndex: function findIndex(callbackfn /* , that = undefined */) {
return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}

View file

@ -2,16 +2,19 @@
var $ = require('../internals/export');
var $find = require('../internals/array-iteration').find;
var addToUnscopables = require('../internals/add-to-unscopables');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var FIND = 'find';
var SKIPS_HOLES = true;
var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
// Shouldn't skip holes
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
// `Array.prototype.find` method
// https://tc39.github.io/ecma262/#sec-array.prototype.find
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
find: function find(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}

View file

@ -2,10 +2,13 @@
var $ = require('../internals/export');
var $includes = require('../internals/array-includes').includes;
var addToUnscopables = require('../internals/add-to-unscopables');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.includes` method
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
$({ target: 'Array', proto: true }, {
$({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}

View file

@ -1,16 +1,18 @@
'use strict';
var $ = require('../internals/export');
var $indexOf = require('../internals/array-includes').indexOf;
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var nativeIndexOf = [].indexOf;
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
var STRICT_METHOD = arrayMethodIsStrict('indexOf');
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.indexOf` method
// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
return NEGATIVE_ZERO
// convert -0 to +0

View file

@ -2,16 +2,16 @@
var $ = require('../internals/export');
var IndexedObject = require('../internals/indexed-object');
var toIndexedObject = require('../internals/to-indexed-object');
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var nativeJoin = [].join;
var ES3_STRINGS = IndexedObject != Object;
var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
var STRICT_METHOD = arrayMethodIsStrict('join', ',');
// `Array.prototype.join` method
// https://tc39.github.io/ecma262/#sec-array.prototype.join
$({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
join: function join(separator) {
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
}

View file

@ -1,14 +1,12 @@
'use strict';
var $ = require('../internals/export');
var $map = require('../internals/array-iteration').map;
var fails = require('../internals/fails');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
// FF49- issue
var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
[].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
});
var USES_TO_LENGTH = arrayMethodUsesToLength('map');
// `Array.prototype.map` method
// https://tc39.github.io/ecma262/#sec-array.prototype.map

View file

@ -1,11 +1,15 @@
'use strict';
var $ = require('../internals/export');
var $reduceRight = require('../internals/array-reduce').right;
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
var USES_TO_LENGTH = arrayMethodUsesToLength('reduceRight', { 1: 0 });
// `Array.prototype.reduceRight` method
// https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
$({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduceRight') }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
reduceRight: function reduceRight(callbackfn /* , initialValue */) {
return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
}

View file

@ -1,11 +1,15 @@
'use strict';
var $ = require('../internals/export');
var $reduce = require('../internals/array-reduce').left;
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('reduce');
var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
// `Array.prototype.reduce` method
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
$({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
reduce: function reduce(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
}

View file

@ -6,8 +6,12 @@ var toAbsoluteIndex = require('../internals/to-absolute-index');
var toLength = require('../internals/to-length');
var toIndexedObject = require('../internals/to-indexed-object');
var createProperty = require('../internals/create-property');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var wellKnownSymbol = require('../internals/well-known-symbol');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
var SPECIES = wellKnownSymbol('species');
var nativeSlice = [].slice;
@ -16,7 +20,7 @@ var max = Math.max;
// `Array.prototype.slice` method
// https://tc39.github.io/ecma262/#sec-array.prototype.slice
// fallback for not array-like ES3 strings and DOM objects
$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
slice: function slice(start, end) {
var O = toIndexedObject(this);
var length = toLength(O.length);

View file

@ -1,11 +1,15 @@
'use strict';
var $ = require('../internals/export');
var $some = require('../internals/array-iteration').some;
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('some');
var USES_TO_LENGTH = arrayMethodUsesToLength('some');
// `Array.prototype.some` method
// https://tc39.github.io/ecma262/#sec-array.prototype.some
$({ target: 'Array', proto: true, forced: sloppyArrayMethod('some') }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
some: function some(callbackfn /* , thisArg */) {
return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}

View file

@ -3,7 +3,7 @@ var $ = require('../internals/export');
var aFunction = require('../internals/a-function');
var toObject = require('../internals/to-object');
var fails = require('../internals/fails');
var sloppyArrayMethod = require('../internals/sloppy-array-method');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var test = [];
var nativeSort = test.sort;
@ -17,9 +17,9 @@ var FAILS_ON_NULL = fails(function () {
test.sort(null);
});
// Old WebKit
var SLOPPY_METHOD = sloppyArrayMethod('sort');
var STRICT_METHOD = arrayMethodIsStrict('sort');
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD;
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;
// `Array.prototype.sort` method
// https://tc39.github.io/ecma262/#sec-array.prototype.sort

View file

@ -7,6 +7,10 @@ var toObject = require('../internals/to-object');
var arraySpeciesCreate = require('../internals/array-species-create');
var createProperty = require('../internals/create-property');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
var max = Math.max;
var min = Math.min;
@ -16,7 +20,7 @@ var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
// `Array.prototype.splice` method
// https://tc39.github.io/ecma262/#sec-array.prototype.splice
// with adding support of @@species
$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, {
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
splice: function splice(start, deleteCount /* , ...items */) {
var O = toObject(this);
var len = toLength(O.length);

View file

@ -1,6 +1,6 @@
var $ = require('../internals/export');
var ArrayBufferModule = require('../internals/array-buffer');
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER;
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');
// `DataView` constructor
// https://tc39.github.io/ecma262/#sec-dataview-constructor

View file

@ -1,5 +1,5 @@
var $ = require('../internals/export');
var parseFloat = require('../internals/parse-float');
var parseFloat = require('../internals/number-parse-float');
// `Number.parseFloat` method
// https://tc39.github.io/ecma262/#sec-number.parseFloat

View file

@ -1,5 +1,5 @@
var $ = require('../internals/export');
var parseInt = require('../internals/parse-int');
var parseInt = require('../internals/number-parse-int');
// `Number.parseInt` method
// https://tc39.github.io/ecma262/#sec-number.parseint

View file

@ -1,7 +1,7 @@
'use strict';
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/forced-object-prototype-accessors-methods');
var FORCED = require('../internals/object-prototype-accessors-forced');
var toObject = require('../internals/to-object');
var aFunction = require('../internals/a-function');
var definePropertyModule = require('../internals/object-define-property');

View file

@ -1,7 +1,7 @@
'use strict';
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/forced-object-prototype-accessors-methods');
var FORCED = require('../internals/object-prototype-accessors-forced');
var toObject = require('../internals/to-object');
var aFunction = require('../internals/a-function');
var definePropertyModule = require('../internals/object-define-property');

View file

@ -1,7 +1,7 @@
'use strict';
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/forced-object-prototype-accessors-methods');
var FORCED = require('../internals/object-prototype-accessors-forced');
var toObject = require('../internals/to-object');
var toPrimitive = require('../internals/to-primitive');
var getPrototypeOf = require('../internals/object-get-prototype-of');

Some files were not shown because too many files have changed in this diff Show more