core-js-pure 3.8.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/LICENSE +1 -1
  2. package/es/json/stringify.js +1 -1
  3. package/es/promise/all-settled.js +2 -0
  4. package/es/promise/any.js +2 -0
  5. package/features/array/find-last-index.js +4 -0
  6. package/features/array/find-last.js +4 -0
  7. package/features/array/index.js +2 -0
  8. package/features/array/virtual/find-last-index.js +4 -0
  9. package/features/array/virtual/find-last.js +4 -0
  10. package/features/array/virtual/index.js +3 -0
  11. package/features/instance/find-last-index.js +8 -0
  12. package/features/instance/find-last.js +8 -0
  13. package/features/typed-array/find-last-index.js +1 -0
  14. package/features/typed-array/find-last.js +1 -0
  15. package/features/typed-array/index.js +4 -0
  16. package/features/typed-array/unique-by.js +2 -0
  17. package/internals/advance-string-index.js +1 -1
  18. package/internals/array-copy-within.js +1 -1
  19. package/internals/array-fill.js +1 -1
  20. package/internals/array-for-each.js +2 -4
  21. package/internals/array-from.js +1 -1
  22. package/internals/array-includes.js +4 -4
  23. package/internals/array-iteration-from-last.js +34 -0
  24. package/internals/array-iteration.js +7 -7
  25. package/internals/array-last-index-of.js +2 -5
  26. package/internals/array-method-is-strict.js +1 -1
  27. package/internals/array-reduce.js +2 -2
  28. package/internals/array-species-create.js +1 -1
  29. package/internals/array-unique-by.js +32 -0
  30. package/internals/async-iterator-prototype.js +1 -1
  31. package/internals/check-correctness-of-iteration.js +1 -1
  32. package/internals/create-html.js +1 -1
  33. package/internals/date-to-iso-string.js +1 -1
  34. package/internals/descriptors.js +1 -1
  35. package/internals/engine-is-webos-webkit.js +3 -0
  36. package/internals/function-bind.js +2 -2
  37. package/internals/get-map-iterator.js +1 -1
  38. package/internals/get-set-iterator.js +1 -1
  39. package/internals/get-substitution.js +40 -0
  40. package/internals/global.js +2 -2
  41. package/internals/ieee754.js +2 -4
  42. package/internals/indexed-object.js +1 -1
  43. package/internals/is-array.js +1 -1
  44. package/internals/is-integer.js +1 -1
  45. package/internals/is-iterable.js +1 -1
  46. package/internals/is-regexp.js +1 -1
  47. package/internals/iterators-core.js +10 -3
  48. package/internals/math-expm1.js +1 -1
  49. package/internals/math-fround.js +2 -2
  50. package/internals/math-log1p.js +1 -1
  51. package/internals/math-scale.js +2 -2
  52. package/internals/math-sign.js +2 -2
  53. package/internals/microtask.js +3 -1
  54. package/internals/native-symbol.js +1 -1
  55. package/internals/number-is-finite.js +1 -1
  56. package/internals/number-parse-float.js +1 -1
  57. package/internals/number-parse-int.js +1 -1
  58. package/internals/object-assign.js +3 -3
  59. package/internals/object-create.js +2 -2
  60. package/internals/object-define-properties.js +1 -1
  61. package/internals/object-define-property.js +1 -1
  62. package/internals/object-get-own-property-descriptor.js +1 -1
  63. package/internals/object-get-own-property-names.js +1 -1
  64. package/internals/object-get-prototype-of.js +1 -1
  65. package/internals/object-keys.js +1 -1
  66. package/internals/object-property-is-enumerable.js +1 -1
  67. package/internals/object-prototype-accessors-forced.js +1 -1
  68. package/internals/object-set-prototype-of.js +2 -2
  69. package/internals/object-to-array.js +2 -2
  70. package/internals/object-to-string.js +1 -1
  71. package/internals/range-iterator.js +1 -1
  72. package/internals/regexp-flags.js +1 -1
  73. package/internals/require-object-coercible.js +1 -1
  74. package/internals/same-value-zero.js +2 -2
  75. package/internals/same-value.js +2 -2
  76. package/internals/shared.js +2 -2
  77. package/internals/species-constructor.js +1 -1
  78. package/internals/string-multibyte.js +1 -1
  79. package/internals/string-pad-webkit-bug.js +1 -1
  80. package/internals/string-pad.js +2 -2
  81. package/internals/string-punycode-to-ascii.js +1 -1
  82. package/internals/string-repeat.js +1 -1
  83. package/internals/string-trim.js +3 -3
  84. package/internals/task.js +2 -2
  85. package/internals/this-number-value.js +1 -1
  86. package/internals/to-index.js +1 -1
  87. package/internals/to-integer.js +1 -1
  88. package/internals/to-length.js +1 -1
  89. package/internals/to-object.js +1 -1
  90. package/internals/to-primitive.js +1 -1
  91. package/internals/typed-array-constructors-require-wrappers.js +1 -22
  92. package/internals/typed-array-from-species-and-list.js +1 -0
  93. package/internals/use-symbol-as-uid.js +1 -2
  94. package/internals/whitespaces.js +2 -2
  95. package/modules/es.aggregate-error.js +3 -0
  96. package/modules/es.array.concat.js +3 -2
  97. package/modules/es.array.copy-within.js +2 -2
  98. package/modules/es.array.every.js +2 -4
  99. package/modules/es.array.fill.js +2 -2
  100. package/modules/es.array.filter.js +2 -5
  101. package/modules/es.array.find-index.js +3 -6
  102. package/modules/es.array.find.js +3 -6
  103. package/modules/es.array.flat-map.js +1 -1
  104. package/modules/es.array.flat.js +1 -1
  105. package/modules/es.array.for-each.js +1 -1
  106. package/modules/es.array.from.js +1 -1
  107. package/modules/es.array.includes.js +3 -6
  108. package/modules/es.array.index-of.js +2 -4
  109. package/modules/es.array.is-array.js +1 -1
  110. package/modules/es.array.iterator.js +9 -9
  111. package/modules/es.array.join.js +1 -1
  112. package/modules/es.array.last-index-of.js +1 -1
  113. package/modules/es.array.map.js +2 -5
  114. package/modules/es.array.of.js +1 -1
  115. package/modules/es.array.reduce-right.js +2 -5
  116. package/modules/es.array.reduce.js +2 -4
  117. package/modules/es.array.reverse.js +2 -2
  118. package/modules/es.array.slice.js +2 -4
  119. package/modules/es.array.some.js +2 -4
  120. package/modules/es.array.sort.js +1 -1
  121. package/modules/es.array.species.js +1 -1
  122. package/modules/es.array.splice.js +2 -4
  123. package/modules/es.array.unscopables.flat-map.js +1 -0
  124. package/modules/es.array.unscopables.flat.js +1 -0
  125. package/modules/es.date.now.js +1 -1
  126. package/modules/es.date.to-iso-string.js +1 -1
  127. package/modules/es.date.to-json.js +3 -1
  128. package/modules/es.function.bind.js +1 -1
  129. package/modules/es.function.has-instance.js +1 -1
  130. package/modules/es.global-this.js +1 -1
  131. package/modules/es.json.stringify.js +3 -1
  132. package/modules/es.json.to-string-tag.js +1 -1
  133. package/modules/es.map.js +1 -1
  134. package/modules/es.math.acosh.js +1 -1
  135. package/modules/es.math.asinh.js +1 -1
  136. package/modules/es.math.atanh.js +1 -1
  137. package/modules/es.math.cbrt.js +1 -1
  138. package/modules/es.math.clz32.js +1 -1
  139. package/modules/es.math.cosh.js +1 -1
  140. package/modules/es.math.expm1.js +1 -1
  141. package/modules/es.math.fround.js +1 -1
  142. package/modules/es.math.hypot.js +3 -2
  143. package/modules/es.math.imul.js +1 -1
  144. package/modules/es.math.log10.js +1 -1
  145. package/modules/es.math.log1p.js +1 -1
  146. package/modules/es.math.log2.js +1 -1
  147. package/modules/es.math.sign.js +1 -1
  148. package/modules/es.math.sinh.js +1 -1
  149. package/modules/es.math.tanh.js +1 -1
  150. package/modules/es.math.trunc.js +1 -1
  151. package/modules/es.number.epsilon.js +1 -1
  152. package/modules/es.number.is-finite.js +1 -1
  153. package/modules/es.number.is-integer.js +1 -1
  154. package/modules/es.number.is-nan.js +2 -2
  155. package/modules/es.number.is-safe-integer.js +1 -1
  156. package/modules/es.number.max-safe-integer.js +1 -1
  157. package/modules/es.number.min-safe-integer.js +1 -1
  158. package/modules/es.number.parse-float.js +1 -1
  159. package/modules/es.number.parse-int.js +1 -1
  160. package/modules/es.number.to-fixed.js +44 -45
  161. package/modules/es.number.to-precision.js +1 -1
  162. package/modules/es.object.assign.js +1 -1
  163. package/modules/es.object.create.js +1 -1
  164. package/modules/es.object.define-getter.js +1 -1
  165. package/modules/es.object.define-properties.js +1 -1
  166. package/modules/es.object.define-property.js +1 -1
  167. package/modules/es.object.define-setter.js +1 -1
  168. package/modules/es.object.entries.js +1 -1
  169. package/modules/es.object.freeze.js +1 -1
  170. package/modules/es.object.get-own-property-descriptor.js +1 -1
  171. package/modules/es.object.get-own-property-descriptors.js +1 -1
  172. package/modules/es.object.get-own-property-names.js +1 -1
  173. package/modules/es.object.get-prototype-of.js +1 -1
  174. package/modules/es.object.is-extensible.js +1 -1
  175. package/modules/es.object.is-frozen.js +1 -1
  176. package/modules/es.object.is-sealed.js +1 -1
  177. package/modules/es.object.is.js +1 -1
  178. package/modules/es.object.keys.js +1 -1
  179. package/modules/es.object.lookup-getter.js +1 -1
  180. package/modules/es.object.lookup-setter.js +1 -1
  181. package/modules/es.object.prevent-extensions.js +1 -1
  182. package/modules/es.object.seal.js +1 -1
  183. package/modules/es.object.set-prototype-of.js +1 -1
  184. package/modules/es.object.values.js +1 -1
  185. package/modules/es.parse-float.js +1 -1
  186. package/modules/es.parse-int.js +1 -1
  187. package/modules/es.promise.all-settled.js +1 -1
  188. package/modules/es.promise.any.js +1 -1
  189. package/modules/es.promise.finally.js +1 -1
  190. package/modules/es.promise.js +8 -8
  191. package/modules/es.reflect.apply.js +1 -1
  192. package/modules/es.reflect.construct.js +1 -1
  193. package/modules/es.reflect.define-property.js +2 -2
  194. package/modules/es.reflect.delete-property.js +1 -1
  195. package/modules/es.reflect.get-own-property-descriptor.js +1 -1
  196. package/modules/es.reflect.get-prototype-of.js +1 -1
  197. package/modules/es.reflect.get.js +1 -1
  198. package/modules/es.reflect.has.js +1 -1
  199. package/modules/es.reflect.is-extensible.js +1 -1
  200. package/modules/es.reflect.own-keys.js +1 -1
  201. package/modules/es.reflect.prevent-extensions.js +1 -1
  202. package/modules/es.reflect.set-prototype-of.js +1 -1
  203. package/modules/es.reflect.set.js +2 -2
  204. package/modules/es.set.js +1 -1
  205. package/modules/es.string.anchor.js +1 -1
  206. package/modules/es.string.big.js +1 -1
  207. package/modules/es.string.blink.js +1 -1
  208. package/modules/es.string.bold.js +1 -1
  209. package/modules/es.string.code-point-at.js +1 -1
  210. package/modules/es.string.ends-with.js +1 -1
  211. package/modules/es.string.fixed.js +1 -1
  212. package/modules/es.string.fontcolor.js +1 -1
  213. package/modules/es.string.fontsize.js +1 -1
  214. package/modules/es.string.from-code-point.js +3 -2
  215. package/modules/es.string.includes.js +1 -1
  216. package/modules/es.string.italics.js +1 -1
  217. package/modules/es.string.iterator.js +2 -2
  218. package/modules/es.string.link.js +1 -1
  219. package/modules/es.string.match-all.js +2 -2
  220. package/modules/es.string.pad-end.js +1 -1
  221. package/modules/es.string.pad-start.js +1 -1
  222. package/modules/es.string.raw.js +1 -1
  223. package/modules/es.string.repeat.js +1 -1
  224. package/modules/es.string.replace-all.js +29 -12
  225. package/modules/es.string.small.js +1 -1
  226. package/modules/es.string.starts-with.js +1 -1
  227. package/modules/es.string.strike.js +1 -1
  228. package/modules/es.string.sub.js +1 -1
  229. package/modules/es.string.sup.js +1 -1
  230. package/modules/es.string.trim-end.js +2 -1
  231. package/modules/es.string.trim-start.js +2 -1
  232. package/modules/es.string.trim.js +1 -1
  233. package/modules/es.symbol.async-iterator.js +1 -1
  234. package/modules/es.symbol.has-instance.js +1 -1
  235. package/modules/es.symbol.is-concat-spreadable.js +1 -1
  236. package/modules/es.symbol.iterator.js +1 -1
  237. package/modules/es.symbol.js +13 -13
  238. package/modules/es.symbol.match-all.js +1 -0
  239. package/modules/es.symbol.match.js +1 -1
  240. package/modules/es.symbol.replace.js +1 -1
  241. package/modules/es.symbol.search.js +1 -1
  242. package/modules/es.symbol.species.js +1 -1
  243. package/modules/es.symbol.split.js +1 -1
  244. package/modules/es.symbol.to-primitive.js +1 -1
  245. package/modules/es.symbol.to-string-tag.js +1 -1
  246. package/modules/es.symbol.unscopables.js +1 -1
  247. package/modules/es.weak-map.js +1 -1
  248. package/modules/es.weak-set.js +1 -1
  249. package/modules/esnext.array.find-last-index.js +14 -0
  250. package/modules/esnext.array.find-last.js +14 -0
  251. package/modules/esnext.array.unique-by.js +2 -28
  252. package/modules/esnext.bigint.range.js +1 -1
  253. package/modules/esnext.map.merge.js +1 -1
  254. package/modules/esnext.typed-array.find-last-index.js +1 -0
  255. package/modules/esnext.typed-array.find-last.js +1 -0
  256. package/modules/esnext.typed-array.unique-by.js +1 -0
  257. package/modules/web.timers.js +1 -1
  258. package/modules/web.url.js +9 -11
  259. package/package.json +3 -2
  260. package/postinstall.js +2 -2
  261. package/proposals/array-find-from-last.js +5 -0
  262. package/proposals/array-unique.js +1 -0
  263. package/stable/instance/entries.js +1 -1
  264. package/stable/instance/for-each.js +1 -1
  265. package/stable/instance/keys.js +1 -1
  266. package/stable/instance/values.js +1 -1
  267. package/stage/1.js +1 -0
  268. package/internals/array-method-uses-to-length.js +0 -27
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2020 Denis Pushkarev
1
+ Copyright (c) 2014-2021 Denis Pushkarev
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -3,7 +3,7 @@ var core = require('../../internals/path');
3
3
 
4
4
  if (!core.JSON) core.JSON = { stringify: JSON.stringify };
5
5
 
6
- // eslint-disable-next-line no-unused-vars
6
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
7
7
  module.exports = function stringify(it, replacer, space) {
8
8
  return core.JSON.stringify.apply(null, arguments);
9
9
  };
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
  require('../../modules/es.promise');
3
3
  require('../../modules/es.promise.all-settled');
4
+ require('../../modules/es.string.iterator');
5
+ require('../../modules/web.dom-collections.iterator');
4
6
  var path = require('../../internals/path');
5
7
 
6
8
  var Promise = path.Promise;
package/es/promise/any.js CHANGED
@@ -2,6 +2,8 @@
2
2
  require('../../modules/es.aggregate-error');
3
3
  require('../../modules/es.promise');
4
4
  require('../../modules/es.promise.any');
5
+ require('../../modules/es.string.iterator');
6
+ require('../../modules/web.dom-collections.iterator');
5
7
  var path = require('../../internals/path');
6
8
 
7
9
  var Promise = path.Promise;
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.array.find-last-index');
2
+ var entryUnbind = require('../../internals/entry-unbind');
3
+
4
+ module.exports = entryUnbind('Array', 'findLastIndex');
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.array.find-last');
2
+ var entryUnbind = require('../../internals/entry-unbind');
3
+
4
+ module.exports = entryUnbind('Array', 'findLast');
@@ -2,6 +2,8 @@ var parent = require('../../es/array');
2
2
  require('../../modules/es.map');
3
3
  require('../../modules/esnext.array.at');
4
4
  require('../../modules/esnext.array.filter-out');
5
+ require('../../modules/esnext.array.find-last');
6
+ require('../../modules/esnext.array.find-last-index');
5
7
  require('../../modules/esnext.array.is-template-object');
6
8
  require('../../modules/esnext.array.last-item');
7
9
  require('../../modules/esnext.array.last-index');
@@ -0,0 +1,4 @@
1
+ require('../../../modules/esnext.array.find-last-index');
2
+ var entryVirtual = require('../../../internals/entry-virtual');
3
+
4
+ module.exports = entryVirtual('Array').findLastIndex;
@@ -0,0 +1,4 @@
1
+ require('../../../modules/esnext.array.find-last');
2
+ var entryVirtual = require('../../../internals/entry-virtual');
3
+
4
+ module.exports = entryVirtual('Array').findLast;
@@ -1,6 +1,9 @@
1
1
  var parent = require('../../../es/array/virtual');
2
+ require('../../../modules/es.map');
2
3
  require('../../../modules/esnext.array.at');
3
4
  require('../../../modules/esnext.array.filter-out');
5
+ require('../../../modules/esnext.array.find-last');
6
+ require('../../../modules/esnext.array.find-last-index');
4
7
  require('../../../modules/esnext.array.unique-by');
5
8
 
6
9
  module.exports = parent;
@@ -0,0 +1,8 @@
1
+ var findLastIndex = require('../array/virtual/find-last-index');
2
+
3
+ var ArrayPrototype = Array.prototype;
4
+
5
+ module.exports = function (it) {
6
+ var own = it.findLastIndex;
7
+ return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLastIndex) ? findLastIndex : own;
8
+ };
@@ -0,0 +1,8 @@
1
+ var findLast = require('../array/virtual/find-last');
2
+
3
+ var ArrayPrototype = Array.prototype;
4
+
5
+ module.exports = function (it) {
6
+ var own = it.findLast;
7
+ return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLast) ? findLast : own;
8
+ };
@@ -0,0 +1 @@
1
+ require('../../modules/esnext.typed-array.find-last-index');
@@ -0,0 +1 @@
1
+ require('../../modules/esnext.typed-array.find-last');
@@ -1,5 +1,9 @@
1
1
  var parent = require('../../es/typed-array');
2
+ require('../../modules/es.map');
2
3
  require('../../modules/esnext.typed-array.at');
3
4
  require('../../modules/esnext.typed-array.filter-out');
5
+ require('../../modules/esnext.typed-array.find-last');
6
+ require('../../modules/esnext.typed-array.find-last-index');
7
+ require('../../modules/esnext.typed-array.unique-by');
4
8
 
5
9
  module.exports = parent;
@@ -0,0 +1,2 @@
1
+ require('../../modules/es.map');
2
+ require('../../modules/esnext.typed-array.unique-by');
@@ -2,7 +2,7 @@
2
2
  var charAt = require('../internals/string-multibyte').charAt;
3
3
 
4
4
  // `AdvanceStringIndex` abstract operation
5
- // https://tc39.github.io/ecma262/#sec-advancestringindex
5
+ // https://tc39.es/ecma262/#sec-advancestringindex
6
6
  module.exports = function (S, index, unicode) {
7
7
  return index + (unicode ? charAt(S, index).length : 1);
8
8
  };
@@ -6,7 +6,7 @@ var toLength = require('../internals/to-length');
6
6
  var min = Math.min;
7
7
 
8
8
  // `Array.prototype.copyWithin` method implementation
9
- // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin
9
+ // https://tc39.es/ecma262/#sec-array.prototype.copywithin
10
10
  module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
11
11
  var O = toObject(this);
12
12
  var len = toLength(O.length);
@@ -4,7 +4,7 @@ var toAbsoluteIndex = require('../internals/to-absolute-index');
4
4
  var toLength = require('../internals/to-length');
5
5
 
6
6
  // `Array.prototype.fill` method implementation
7
- // https://tc39.github.io/ecma262/#sec-array.prototype.fill
7
+ // https://tc39.es/ecma262/#sec-array.prototype.fill
8
8
  module.exports = function fill(value /* , start = 0, end = @length */) {
9
9
  var O = toObject(this);
10
10
  var length = toLength(O.length);
@@ -1,13 +1,11 @@
1
1
  'use strict';
2
2
  var $forEach = require('../internals/array-iteration').forEach;
3
3
  var arrayMethodIsStrict = require('../internals/array-method-is-strict');
4
- var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
5
4
 
6
5
  var STRICT_METHOD = arrayMethodIsStrict('forEach');
7
- var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
8
6
 
9
7
  // `Array.prototype.forEach` method implementation
10
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
11
- module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
8
+ // https://tc39.es/ecma262/#sec-array.prototype.foreach
9
+ module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
12
10
  return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
13
11
  } : [].forEach;
@@ -8,7 +8,7 @@ var createProperty = require('../internals/create-property');
8
8
  var getIteratorMethod = require('../internals/get-iterator-method');
9
9
 
10
10
  // `Array.from` method implementation
11
- // https://tc39.github.io/ecma262/#sec-array.from
11
+ // https://tc39.es/ecma262/#sec-array.from
12
12
  module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
13
13
  var O = toObject(arrayLike);
14
14
  var C = typeof this == 'function' ? this : Array;
@@ -10,10 +10,10 @@ var createMethod = function (IS_INCLUDES) {
10
10
  var index = toAbsoluteIndex(fromIndex, length);
11
11
  var value;
12
12
  // Array#includes uses SameValueZero equality algorithm
13
- // eslint-disable-next-line no-self-compare
13
+ // eslint-disable-next-line no-self-compare -- NaN check
14
14
  if (IS_INCLUDES && el != el) while (length > index) {
15
15
  value = O[index++];
16
- // eslint-disable-next-line no-self-compare
16
+ // eslint-disable-next-line no-self-compare -- NaN check
17
17
  if (value != value) return true;
18
18
  // Array#indexOf ignores holes, Array#includes - not
19
19
  } else for (;length > index; index++) {
@@ -24,9 +24,9 @@ var createMethod = function (IS_INCLUDES) {
24
24
 
25
25
  module.exports = {
26
26
  // `Array.prototype.includes` method
27
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
27
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
28
28
  includes: createMethod(true),
29
29
  // `Array.prototype.indexOf` method
30
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
30
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
31
31
  indexOf: createMethod(false)
32
32
  };
@@ -0,0 +1,34 @@
1
+ var bind = require('../internals/function-bind-context');
2
+ var IndexedObject = require('../internals/indexed-object');
3
+ var toObject = require('../internals/to-object');
4
+ var toLength = require('../internals/to-length');
5
+
6
+ // `Array.prototype.{ findLast, findLastIndex }` methods implementation
7
+ var createMethod = function (TYPE) {
8
+ var IS_FIND_INDEX = TYPE == 6;
9
+ return function ($this, callbackfn, that) {
10
+ var O = toObject($this);
11
+ var self = IndexedObject(O);
12
+ var boundFunction = bind(callbackfn, that, 3);
13
+ var index = toLength(self.length);
14
+ var value, result;
15
+ while (index-- > 0) {
16
+ value = self[index];
17
+ result = boundFunction(value, index, O);
18
+ if (result) switch (TYPE) {
19
+ case 5: return value; // find
20
+ case 6: return index; // findIndex
21
+ }
22
+ }
23
+ return IS_FIND_INDEX ? -1 : undefined;
24
+ };
25
+ };
26
+
27
+ module.exports = {
28
+ // `Array.prototype.findLast` method
29
+ // https://github.com/tc39/proposal-array-find-from-last
30
+ findLast: createMethod(5),
31
+ // `Array.prototype.findLastIndex` method
32
+ // https://github.com/tc39/proposal-array-find-from-last
33
+ findLastIndex: createMethod(6)
34
+ };
@@ -46,25 +46,25 @@ var createMethod = function (TYPE) {
46
46
 
47
47
  module.exports = {
48
48
  // `Array.prototype.forEach` method
49
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
49
+ // https://tc39.es/ecma262/#sec-array.prototype.foreach
50
50
  forEach: createMethod(0),
51
51
  // `Array.prototype.map` method
52
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
52
+ // https://tc39.es/ecma262/#sec-array.prototype.map
53
53
  map: createMethod(1),
54
54
  // `Array.prototype.filter` method
55
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
55
+ // https://tc39.es/ecma262/#sec-array.prototype.filter
56
56
  filter: createMethod(2),
57
57
  // `Array.prototype.some` method
58
- // https://tc39.github.io/ecma262/#sec-array.prototype.some
58
+ // https://tc39.es/ecma262/#sec-array.prototype.some
59
59
  some: createMethod(3),
60
60
  // `Array.prototype.every` method
61
- // https://tc39.github.io/ecma262/#sec-array.prototype.every
61
+ // https://tc39.es/ecma262/#sec-array.prototype.every
62
62
  every: createMethod(4),
63
63
  // `Array.prototype.find` method
64
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
64
+ // https://tc39.es/ecma262/#sec-array.prototype.find
65
65
  find: createMethod(5),
66
66
  // `Array.prototype.findIndex` method
67
- // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
67
+ // https://tc39.es/ecma262/#sec-array.prototype.findIndex
68
68
  findIndex: createMethod(6),
69
69
  // `Array.prototype.filterOut` method
70
70
  // https://github.com/tc39/proposal-array-filtering
@@ -3,18 +3,15 @@ var toIndexedObject = require('../internals/to-indexed-object');
3
3
  var toInteger = require('../internals/to-integer');
4
4
  var toLength = require('../internals/to-length');
5
5
  var arrayMethodIsStrict = require('../internals/array-method-is-strict');
6
- var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
7
6
 
8
7
  var min = Math.min;
9
8
  var nativeLastIndexOf = [].lastIndexOf;
10
9
  var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
11
10
  var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
12
- // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
13
- var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
14
- var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
11
+ var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
15
12
 
16
13
  // `Array.prototype.lastIndexOf` method implementation
17
- // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
14
+ // https://tc39.es/ecma262/#sec-array.prototype.lastindexof
18
15
  module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
19
16
  // convert -0 to +0
20
17
  if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
@@ -4,7 +4,7 @@ var fails = require('../internals/fails');
4
4
  module.exports = function (METHOD_NAME, argument) {
5
5
  var method = [][METHOD_NAME];
6
6
  return !!method && fails(function () {
7
- // eslint-disable-next-line no-useless-call,no-throw-literal
7
+ // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
8
8
  method.call(null, argument || function () { throw 1; }, 1);
9
9
  });
10
10
  };
@@ -32,9 +32,9 @@ var createMethod = function (IS_RIGHT) {
32
32
 
33
33
  module.exports = {
34
34
  // `Array.prototype.reduce` method
35
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
35
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
36
36
  left: createMethod(false),
37
37
  // `Array.prototype.reduceRight` method
38
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
38
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
39
39
  right: createMethod(true)
40
40
  };
@@ -5,7 +5,7 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
5
5
  var SPECIES = wellKnownSymbol('species');
6
6
 
7
7
  // `ArraySpeciesCreate` abstract operation
8
- // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
8
+ // https://tc39.es/ecma262/#sec-arrayspeciescreate
9
9
  module.exports = function (originalArray, length) {
10
10
  var C;
11
11
  if (isArray(originalArray)) {
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+ var toLength = require('../internals/to-length');
3
+ var toObject = require('../internals/to-object');
4
+ var getBuiltIn = require('../internals/get-built-in');
5
+ var arraySpeciesCreate = require('../internals/array-species-create');
6
+
7
+ var push = [].push;
8
+
9
+ // `Array.prototype.uniqueBy` method
10
+ // https://github.com/tc39/proposal-array-unique
11
+ module.exports = function uniqueBy(resolver) {
12
+ var that = toObject(this);
13
+ var length = toLength(that.length);
14
+ var result = arraySpeciesCreate(that, 0);
15
+ var Map = getBuiltIn('Map');
16
+ var map = new Map();
17
+ var resolverFunction, index, item, key;
18
+ if (typeof resolver == 'function') resolverFunction = resolver;
19
+ else if (resolver == null) resolverFunction = function (value) {
20
+ return value;
21
+ };
22
+ else throw new TypeError('Incorrect resolver!');
23
+ for (index = 0; index < length; index++) {
24
+ item = that[index];
25
+ key = resolverFunction(item);
26
+ if (!map.has(key)) map.set(key, item);
27
+ }
28
+ map.forEach(function (value) {
29
+ push.call(result, value);
30
+ });
31
+ return result;
32
+ };
@@ -19,7 +19,7 @@ if (!IS_PURE) {
19
19
  AsyncIteratorPrototype = AsyncIterator.prototype;
20
20
  } else if (shared[USE_FUNCTION_CONSTRUCTOR] || global[USE_FUNCTION_CONSTRUCTOR]) {
21
21
  try {
22
- // eslint-disable-next-line no-new-func
22
+ // eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax
23
23
  prototype = getPrototypeOf(getPrototypeOf(getPrototypeOf(Function('return async function*(){}()')())));
24
24
  if (getPrototypeOf(prototype) === Object.prototype) AsyncIteratorPrototype = prototype;
25
25
  } catch (error) { /* empty */ }
@@ -16,7 +16,7 @@ try {
16
16
  iteratorWithReturn[ITERATOR] = function () {
17
17
  return this;
18
18
  };
19
- // eslint-disable-next-line no-throw-literal
19
+ // eslint-disable-next-line no-throw-literal -- required for testing
20
20
  Array.from(iteratorWithReturn, function () { throw 2; });
21
21
  } catch (error) { /* empty */ }
22
22
 
@@ -3,7 +3,7 @@ var requireObjectCoercible = require('../internals/require-object-coercible');
3
3
  var quot = /"/g;
4
4
 
5
5
  // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
6
- // https://tc39.github.io/ecma262/#sec-createhtml
6
+ // https://tc39.es/ecma262/#sec-createhtml
7
7
  module.exports = function (string, tag, attribute, value) {
8
8
  var S = String(requireObjectCoercible(string));
9
9
  var p1 = '<' + tag;
@@ -8,7 +8,7 @@ var getTime = DatePrototype.getTime;
8
8
  var nativeDateToISOString = DatePrototype.toISOString;
9
9
 
10
10
  // `Date.prototype.toISOString` method implementation
11
- // https://tc39.github.io/ecma262/#sec-date.prototype.toisostring
11
+ // https://tc39.es/ecma262/#sec-date.prototype.toisostring
12
12
  // PhantomJS / old WebKit fails here:
13
13
  module.exports = (fails(function () {
14
14
  return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
@@ -1,6 +1,6 @@
1
1
  var fails = require('../internals/fails');
2
2
 
3
- // Thank's IE8 for his funny defineProperty
3
+ // Detect IE8's incomplete defineProperty implementation
4
4
  module.exports = !fails(function () {
5
5
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
6
6
  });
@@ -0,0 +1,3 @@
1
+ var userAgent = require('../internals/engine-user-agent');
2
+
3
+ module.exports = /web0s(?!.*chrome)/i.test(userAgent);
@@ -8,13 +8,13 @@ var factories = {};
8
8
  var construct = function (C, argsLength, args) {
9
9
  if (!(argsLength in factories)) {
10
10
  for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
11
- // eslint-disable-next-line no-new-func
11
+ // eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only
12
12
  factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
13
13
  } return factories[argsLength](C, args);
14
14
  };
15
15
 
16
16
  // `Function.prototype.bind` method implementation
17
- // https://tc39.github.io/ecma262/#sec-function.prototype.bind
17
+ // https://tc39.es/ecma262/#sec-function.prototype.bind
18
18
  module.exports = Function.bind || function bind(that /* , ...args */) {
19
19
  var fn = aFunction(this);
20
20
  var partArgs = slice.call(arguments, 1);
@@ -2,6 +2,6 @@ var IS_PURE = require('../internals/is-pure');
2
2
  var getIterator = require('../internals/get-iterator');
3
3
 
4
4
  module.exports = IS_PURE ? getIterator : function (it) {
5
- // eslint-disable-next-line no-undef
5
+ // eslint-disable-next-line no-undef -- safe
6
6
  return Map.prototype.entries.call(it);
7
7
  };
@@ -2,6 +2,6 @@ var IS_PURE = require('../internals/is-pure');
2
2
  var getIterator = require('../internals/get-iterator');
3
3
 
4
4
  module.exports = IS_PURE ? getIterator : function (it) {
5
- // eslint-disable-next-line no-undef
5
+ // eslint-disable-next-line no-undef -- safe
6
6
  return Set.prototype.values.call(it);
7
7
  };
@@ -0,0 +1,40 @@
1
+ var toObject = require('../internals/to-object');
2
+
3
+ var floor = Math.floor;
4
+ var replace = ''.replace;
5
+ var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
6
+ var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
7
+
8
+ // https://tc39.es/ecma262/#sec-getsubstitution
9
+ module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
10
+ var tailPos = position + matched.length;
11
+ var m = captures.length;
12
+ var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
13
+ if (namedCaptures !== undefined) {
14
+ namedCaptures = toObject(namedCaptures);
15
+ symbols = SUBSTITUTION_SYMBOLS;
16
+ }
17
+ return replace.call(replacement, symbols, function (match, ch) {
18
+ var capture;
19
+ switch (ch.charAt(0)) {
20
+ case '$': return '$';
21
+ case '&': return matched;
22
+ case '`': return str.slice(0, position);
23
+ case "'": return str.slice(tailPos);
24
+ case '<':
25
+ capture = namedCaptures[ch.slice(1, -1)];
26
+ break;
27
+ default: // \d\d?
28
+ var n = +ch;
29
+ if (n === 0) return match;
30
+ if (n > m) {
31
+ var f = floor(n / 10);
32
+ if (f === 0) return match;
33
+ if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
34
+ return match;
35
+ }
36
+ capture = captures[n - 1];
37
+ }
38
+ return capture === undefined ? '' : capture;
39
+ });
40
+ };
@@ -4,10 +4,10 @@ var check = function (it) {
4
4
 
5
5
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
6
6
  module.exports =
7
- // eslint-disable-next-line no-undef
7
+ /* global globalThis -- safe */
8
8
  check(typeof globalThis == 'object' && globalThis) ||
9
9
  check(typeof window == 'object' && window) ||
10
10
  check(typeof self == 'object' && self) ||
11
11
  check(typeof global == 'object' && global) ||
12
- // eslint-disable-next-line no-new-func
12
+ // eslint-disable-next-line no-new-func -- fallback
13
13
  (function () { return this; })() || Function('return this')();
@@ -1,6 +1,4 @@
1
1
  // IEEE754 conversions based on https://github.com/feross/ieee754
2
- // eslint-disable-next-line no-shadow-restricted-names
3
- var Infinity = 1 / 0;
4
2
  var abs = Math.abs;
5
3
  var pow = Math.pow;
6
4
  var floor = Math.floor;
@@ -17,9 +15,9 @@ var pack = function (number, mantissaLength, bytes) {
17
15
  var index = 0;
18
16
  var exponent, mantissa, c;
19
17
  number = abs(number);
20
- // eslint-disable-next-line no-self-compare
18
+ // eslint-disable-next-line no-self-compare -- NaN check
21
19
  if (number != number || number === Infinity) {
22
- // eslint-disable-next-line no-self-compare
20
+ // eslint-disable-next-line no-self-compare -- NaN check
23
21
  mantissa = number != number ? 1 : 0;
24
22
  exponent = eMax;
25
23
  } else {
@@ -6,7 +6,7 @@ var split = ''.split;
6
6
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
7
7
  module.exports = fails(function () {
8
8
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
9
- // eslint-disable-next-line no-prototype-builtins
9
+ // eslint-disable-next-line no-prototype-builtins -- safe
10
10
  return !Object('z').propertyIsEnumerable(0);
11
11
  }) ? function (it) {
12
12
  return classof(it) == 'String' ? split.call(it, '') : Object(it);
@@ -1,7 +1,7 @@
1
1
  var classof = require('../internals/classof-raw');
2
2
 
3
3
  // `IsArray` abstract operation
4
- // https://tc39.github.io/ecma262/#sec-isarray
4
+ // https://tc39.es/ecma262/#sec-isarray
5
5
  module.exports = Array.isArray || function isArray(arg) {
6
6
  return classof(arg) == 'Array';
7
7
  };
@@ -3,7 +3,7 @@ var isObject = require('../internals/is-object');
3
3
  var floor = Math.floor;
4
4
 
5
5
  // `Number.isInteger` method implementation
6
- // https://tc39.github.io/ecma262/#sec-number.isinteger
6
+ // https://tc39.es/ecma262/#sec-number.isinteger
7
7
  module.exports = function isInteger(it) {
8
8
  return !isObject(it) && isFinite(it) && floor(it) === it;
9
9
  };
@@ -8,6 +8,6 @@ module.exports = function (it) {
8
8
  var O = Object(it);
9
9
  return O[ITERATOR] !== undefined
10
10
  || '@@iterator' in O
11
- // eslint-disable-next-line no-prototype-builtins
11
+ // eslint-disable-next-line no-prototype-builtins -- safe
12
12
  || Iterators.hasOwnProperty(classof(O));
13
13
  };
@@ -5,7 +5,7 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
5
5
  var MATCH = wellKnownSymbol('match');
6
6
 
7
7
  // `IsRegExp` abstract operation
8
- // https://tc39.github.io/ecma262/#sec-isregexp
8
+ // https://tc39.es/ecma262/#sec-isregexp
9
9
  module.exports = function (it) {
10
10
  var isRegExp;
11
11
  return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ var fails = require('../internals/fails');
2
3
  var getPrototypeOf = require('../internals/object-get-prototype-of');
3
4
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
4
5
  var has = require('../internals/has');
@@ -11,7 +12,7 @@ var BUGGY_SAFARI_ITERATORS = false;
11
12
  var returnThis = function () { return this; };
12
13
 
13
14
  // `%IteratorPrototype%` object
14
- // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
15
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
15
16
  var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
16
17
 
17
18
  if ([].keys) {
@@ -24,10 +25,16 @@ if ([].keys) {
24
25
  }
25
26
  }
26
27
 
27
- if (IteratorPrototype == undefined) IteratorPrototype = {};
28
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
29
+ var test = {};
30
+ // FF44- legacy iterators case
31
+ return IteratorPrototype[ITERATOR].call(test) !== test;
32
+ });
33
+
34
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
28
35
 
29
36
  // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
30
- if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
37
+ if ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {
31
38
  createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
32
39
  }
33
40
 
@@ -2,7 +2,7 @@ var nativeExpm1 = Math.expm1;
2
2
  var exp = Math.exp;
3
3
 
4
4
  // `Math.expm1` method implementation
5
- // https://tc39.github.io/ecma262/#sec-math.expm1
5
+ // https://tc39.es/ecma262/#sec-math.expm1
6
6
  module.exports = (!nativeExpm1
7
7
  // Old FF bug
8
8
  || nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168