core-js 3.18.3 → 3.19.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 (325) hide show
  1. package/es/date/to-primitive.js +2 -3
  2. package/es/date/to-string.js +2 -4
  3. package/es/instance/at.js +6 -5
  4. package/es/instance/bind.js +3 -2
  5. package/es/instance/code-point-at.js +4 -3
  6. package/es/instance/concat.js +3 -2
  7. package/es/instance/copy-within.js +3 -2
  8. package/es/instance/ends-with.js +4 -3
  9. package/es/instance/entries.js +3 -2
  10. package/es/instance/every.js +3 -2
  11. package/es/instance/fill.js +3 -2
  12. package/es/instance/filter.js +3 -2
  13. package/es/instance/find-index.js +3 -2
  14. package/es/instance/find.js +3 -2
  15. package/es/instance/flags.js +2 -1
  16. package/es/instance/flat-map.js +3 -2
  17. package/es/instance/flat.js +3 -2
  18. package/es/instance/for-each.js +3 -2
  19. package/es/instance/includes.js +6 -5
  20. package/es/instance/index-of.js +3 -2
  21. package/es/instance/keys.js +3 -2
  22. package/es/instance/last-index-of.js +3 -2
  23. package/es/instance/map.js +3 -2
  24. package/es/instance/match-all.js +4 -3
  25. package/es/instance/pad-end.js +4 -3
  26. package/es/instance/pad-start.js +4 -3
  27. package/es/instance/reduce-right.js +3 -2
  28. package/es/instance/reduce.js +3 -2
  29. package/es/instance/repeat.js +4 -3
  30. package/es/instance/replace-all.js +4 -3
  31. package/es/instance/reverse.js +3 -2
  32. package/es/instance/slice.js +3 -2
  33. package/es/instance/some.js +3 -2
  34. package/es/instance/sort.js +3 -2
  35. package/es/instance/splice.js +3 -2
  36. package/es/instance/starts-with.js +4 -3
  37. package/es/instance/trim-end.js +4 -3
  38. package/es/instance/trim-left.js +4 -3
  39. package/es/instance/trim-right.js +4 -3
  40. package/es/instance/trim-start.js +4 -3
  41. package/es/instance/trim.js +4 -3
  42. package/es/instance/values.js +3 -2
  43. package/es/json/stringify.js +4 -3
  44. package/es/promise/all-settled.js +2 -1
  45. package/es/promise/any.js +2 -1
  46. package/es/regexp/flags.js +3 -4
  47. package/es/regexp/match.js +2 -1
  48. package/es/regexp/replace.js +2 -1
  49. package/es/regexp/search.js +2 -1
  50. package/es/regexp/split.js +2 -1
  51. package/es/regexp/test.js +2 -3
  52. package/es/regexp/to-string.js +2 -3
  53. package/es/string/iterator.js +2 -5
  54. package/features/instance/at.js +6 -5
  55. package/features/instance/code-points.js +4 -3
  56. package/features/instance/filter-out.js +3 -2
  57. package/features/instance/filter-reject.js +3 -2
  58. package/features/instance/find-last-index.js +3 -2
  59. package/features/instance/find-last.js +3 -2
  60. package/features/instance/group-by.js +3 -2
  61. package/features/instance/unique-by.js +3 -2
  62. package/features/map/from.js +3 -2
  63. package/features/map/group-by.js +2 -1
  64. package/features/map/key-by.js +2 -1
  65. package/features/map/of.js +3 -2
  66. package/features/promise/try.js +2 -1
  67. package/features/set/from.js +3 -2
  68. package/features/set/of.js +3 -2
  69. package/features/weak-map/from.js +3 -2
  70. package/features/weak-map/of.js +3 -2
  71. package/features/weak-set/from.js +3 -2
  72. package/features/weak-set/of.js +3 -2
  73. package/internals/a-callable.js +3 -0
  74. package/internals/a-constructor.js +3 -0
  75. package/internals/a-possible-prototype.js +5 -1
  76. package/internals/an-instance.js +8 -3
  77. package/internals/an-object.js +4 -0
  78. package/internals/array-buffer-native.js +1 -1
  79. package/internals/array-buffer-view-core.js +3 -2
  80. package/internals/array-buffer.js +29 -16
  81. package/internals/array-from-async.js +1 -1
  82. package/internals/array-from.js +6 -2
  83. package/internals/array-group-by.js +6 -3
  84. package/internals/array-iteration-from-last.js +1 -1
  85. package/internals/array-iteration.js +5 -4
  86. package/internals/array-last-index-of.js +2 -1
  87. package/internals/array-reduce.js +3 -0
  88. package/internals/array-slice.js +3 -0
  89. package/internals/array-sort.js +10 -11
  90. package/internals/array-species-constructor.js +2 -0
  91. package/internals/array-unique-by.js +13 -9
  92. package/internals/async-from-sync-iterator.js +4 -3
  93. package/internals/async-iterator-create-proxy.js +4 -3
  94. package/internals/async-iterator-iteration.js +5 -2
  95. package/internals/classof-raw.js +5 -2
  96. package/internals/classof.js +3 -0
  97. package/internals/clear-error-stack.js +20 -0
  98. package/internals/collection-add-all.js +3 -2
  99. package/internals/collection-delete-all.js +3 -2
  100. package/internals/collection-from.js +7 -4
  101. package/internals/collection-of.js +3 -4
  102. package/internals/collection-strong.js +11 -9
  103. package/internals/collection-weak.js +10 -6
  104. package/internals/collection.js +8 -7
  105. package/internals/composite-key.js +9 -2
  106. package/internals/create-html.js +3 -1
  107. package/internals/date-to-iso-string.js +23 -13
  108. package/internals/date-to-primitive.js +3 -0
  109. package/internals/define-iterator.js +2 -1
  110. package/internals/engine-v8-version.js +10 -4
  111. package/internals/entry-unbind.js +3 -5
  112. package/internals/error-stack-installable.js +10 -0
  113. package/internals/export.js +1 -1
  114. package/internals/fix-regexp-well-known-symbol-logic.js +5 -3
  115. package/internals/flatten-into-array.js +4 -1
  116. package/internals/function-apply.js +9 -0
  117. package/internals/function-bind-context.js +5 -17
  118. package/internals/function-bind.js +15 -9
  119. package/internals/function-call.js +5 -0
  120. package/internals/function-uncurry-this.js +12 -0
  121. package/internals/get-async-iterator.js +2 -1
  122. package/internals/get-iterator.js +7 -2
  123. package/internals/get-map-iterator.js +3 -1
  124. package/internals/get-set-iterator.js +3 -1
  125. package/internals/get-substitution.js +10 -7
  126. package/internals/has-own-property.js +3 -2
  127. package/internals/host-report-errors.js +1 -1
  128. package/internals/ieee754.js +4 -1
  129. package/internals/indexed-object.js +5 -2
  130. package/internals/inspect-source.js +3 -2
  131. package/internals/internal-metadata.js +3 -2
  132. package/internals/internal-state.js +9 -7
  133. package/internals/is-callable.js +1 -1
  134. package/internals/is-constructor.js +6 -4
  135. package/internals/is-iterable.js +4 -2
  136. package/internals/is-object.js +1 -1
  137. package/internals/is-symbol.js +6 -2
  138. package/internals/iterate.js +14 -6
  139. package/internals/iterator-close.js +2 -1
  140. package/internals/iterator-create-proxy.js +4 -3
  141. package/internals/map-emplace.js +8 -3
  142. package/internals/map-upsert.js +12 -4
  143. package/internals/math-scale.js +9 -12
  144. package/internals/microtask.js +6 -4
  145. package/internals/normalize-string-argument.js +5 -0
  146. package/internals/not-a-regexp.js +3 -0
  147. package/internals/number-parse-float.js +8 -6
  148. package/internals/number-parse-int.js +3 -1
  149. package/internals/numeric-range-iterator.js +4 -0
  150. package/internals/object-assign.js +5 -2
  151. package/internals/object-define-properties.js +3 -1
  152. package/internals/object-define-property.js +2 -0
  153. package/internals/object-get-own-property-descriptor.js +2 -1
  154. package/internals/object-get-own-property-names-external.js +4 -4
  155. package/internals/object-get-prototype-of.js +2 -1
  156. package/internals/object-is-prototype-of.js +3 -0
  157. package/internals/object-keys-internal.js +5 -2
  158. package/internals/object-set-prototype-of.js +4 -3
  159. package/internals/object-to-array.js +7 -3
  160. package/internals/ordinary-to-primitive.js +7 -3
  161. package/internals/own-keys.js +4 -1
  162. package/internals/reflect-metadata.js +9 -3
  163. package/internals/regexp-exec-abstract.js +6 -2
  164. package/internals/regexp-exec.js +19 -14
  165. package/internals/require-object-coercible.js +4 -0
  166. package/internals/set-global.js +4 -2
  167. package/internals/shared.js +1 -1
  168. package/internals/string-multibyte.js +13 -4
  169. package/internals/string-pad.js +6 -3
  170. package/internals/string-punycode-to-ascii.js +26 -14
  171. package/internals/string-repeat.js +3 -0
  172. package/internals/string-trim.js +4 -2
  173. package/internals/task.js +11 -11
  174. package/internals/this-number-value.js +2 -4
  175. package/internals/to-index.js +3 -0
  176. package/internals/to-object.js +3 -0
  177. package/internals/to-offset.js +3 -0
  178. package/internals/to-positive-integer.js +3 -0
  179. package/internals/to-primitive.js +4 -1
  180. package/internals/to-property-key.js +1 -1
  181. package/internals/to-string.js +3 -0
  182. package/internals/try-to-string.js +4 -0
  183. package/internals/typed-array-constructor.js +10 -6
  184. package/internals/typed-array-from.js +4 -3
  185. package/internals/uid.js +4 -1
  186. package/internals/well-known-symbol.js +5 -1
  187. package/modules/es.aggregate-error.js +13 -7
  188. package/modules/es.array-buffer.slice.js +8 -4
  189. package/modules/es.array.concat.js +2 -0
  190. package/modules/es.array.index-of.js +7 -5
  191. package/modules/es.array.join.js +3 -2
  192. package/modules/es.array.of.js +3 -1
  193. package/modules/es.array.reduce.js +2 -1
  194. package/modules/es.array.reverse.js +3 -2
  195. package/modules/es.array.slice.js +4 -2
  196. package/modules/es.array.sort.js +7 -4
  197. package/modules/es.array.splice.js +2 -0
  198. package/modules/es.date.get-year.js +3 -2
  199. package/modules/es.date.now.js +6 -1
  200. package/modules/es.date.set-year.js +6 -4
  201. package/modules/es.date.to-primitive.js +2 -1
  202. package/modules/es.date.to-string.js +5 -4
  203. package/modules/es.escape.js +12 -5
  204. package/modules/es.function.has-instance.js +3 -2
  205. package/modules/es.function.name.js +4 -2
  206. package/modules/es.json.stringify.js +18 -7
  207. package/modules/es.map.js +1 -1
  208. package/modules/es.number.constructor.js +12 -7
  209. package/modules/es.number.to-fixed.js +19 -13
  210. package/modules/es.number.to-precision.js +6 -5
  211. package/modules/es.promise.all-settled.js +2 -2
  212. package/modules/es.promise.any.js +5 -4
  213. package/modules/es.promise.js +22 -18
  214. package/modules/es.reflect.apply.js +4 -10
  215. package/modules/es.reflect.construct.js +10 -5
  216. package/modules/es.reflect.get.js +2 -1
  217. package/modules/es.reflect.set.js +2 -1
  218. package/modules/es.regexp.constructor.js +23 -14
  219. package/modules/es.regexp.dot-all.js +5 -1
  220. package/modules/es.regexp.flags.js +4 -2
  221. package/modules/es.regexp.sticky.js +5 -1
  222. package/modules/es.regexp.test.js +7 -3
  223. package/modules/es.regexp.to-string.js +8 -5
  224. package/modules/es.set.js +1 -1
  225. package/modules/es.string.at-alternative.js +4 -1
  226. package/modules/es.string.ends-with.js +6 -4
  227. package/modules/es.string.from-code-point.js +7 -4
  228. package/modules/es.string.includes.js +8 -2
  229. package/modules/es.string.match-all.js +25 -19
  230. package/modules/es.string.match.js +2 -1
  231. package/modules/es.string.raw.js +6 -6
  232. package/modules/es.string.replace-all.js +19 -13
  233. package/modules/es.string.replace.js +19 -12
  234. package/modules/es.string.search.js +2 -1
  235. package/modules/es.string.split.js +23 -16
  236. package/modules/es.string.starts-with.js +6 -4
  237. package/modules/es.string.substr.js +3 -2
  238. package/modules/es.symbol.description.js +20 -12
  239. package/modules/es.symbol.js +34 -21
  240. package/modules/es.typed-array.copy-within.js +4 -2
  241. package/modules/es.typed-array.fill.js +9 -2
  242. package/modules/es.typed-array.iterator.js +7 -6
  243. package/modules/es.typed-array.join.js +3 -3
  244. package/modules/es.typed-array.last-index-of.js +3 -2
  245. package/modules/es.typed-array.reduce-right.js +2 -1
  246. package/modules/es.typed-array.reduce.js +2 -1
  247. package/modules/es.typed-array.set.js +2 -0
  248. package/modules/es.typed-array.slice.js +2 -2
  249. package/modules/es.typed-array.sort.js +13 -28
  250. package/modules/es.typed-array.to-locale-string.js +7 -2
  251. package/modules/es.typed-array.to-string.js +3 -2
  252. package/modules/es.unescape.js +14 -9
  253. package/modules/es.weak-map.js +14 -13
  254. package/modules/esnext.array.is-template-object.js +1 -1
  255. package/modules/esnext.async-iterator.as-indexed-pairs.js +2 -1
  256. package/modules/esnext.async-iterator.constructor.js +1 -1
  257. package/modules/esnext.async-iterator.drop.js +2 -1
  258. package/modules/esnext.async-iterator.filter.js +2 -1
  259. package/modules/esnext.async-iterator.flat-map.js +3 -2
  260. package/modules/esnext.async-iterator.from.js +4 -4
  261. package/modules/esnext.async-iterator.map.js +2 -1
  262. package/modules/esnext.async-iterator.reduce.js +4 -1
  263. package/modules/esnext.async-iterator.take.js +4 -2
  264. package/modules/esnext.composite-key.js +5 -1
  265. package/modules/esnext.composite-symbol.js +3 -2
  266. package/modules/esnext.iterator.as-indexed-pairs.js +2 -1
  267. package/modules/esnext.iterator.constructor.js +1 -1
  268. package/modules/esnext.iterator.drop.js +4 -2
  269. package/modules/esnext.iterator.filter.js +2 -1
  270. package/modules/esnext.iterator.flat-map.js +7 -3
  271. package/modules/esnext.iterator.from.js +4 -4
  272. package/modules/esnext.iterator.map.js +2 -1
  273. package/modules/esnext.iterator.reduce.js +3 -0
  274. package/modules/esnext.iterator.take.js +2 -1
  275. package/modules/esnext.map.delete-all.js +2 -4
  276. package/modules/esnext.map.emplace.js +2 -2
  277. package/modules/esnext.map.every.js +1 -1
  278. package/modules/esnext.map.filter.js +5 -4
  279. package/modules/esnext.map.find-key.js +1 -1
  280. package/modules/esnext.map.find.js +1 -1
  281. package/modules/esnext.map.group-by.js +6 -2
  282. package/modules/esnext.map.includes.js +1 -1
  283. package/modules/esnext.map.key-by.js +2 -1
  284. package/modules/esnext.map.map-keys.js +5 -4
  285. package/modules/esnext.map.map-values.js +5 -4
  286. package/modules/esnext.map.reduce.js +3 -0
  287. package/modules/esnext.map.some.js +1 -1
  288. package/modules/esnext.map.update-or-insert.js +2 -2
  289. package/modules/esnext.map.update.js +11 -4
  290. package/modules/esnext.map.upsert.js +2 -2
  291. package/modules/esnext.math.seeded-prng.js +3 -1
  292. package/modules/esnext.number.from-string.js +12 -3
  293. package/modules/esnext.observable.js +14 -9
  294. package/modules/esnext.reflect.get-metadata-keys.js +5 -10
  295. package/modules/esnext.set.add-all.js +2 -4
  296. package/modules/esnext.set.delete-all.js +2 -4
  297. package/modules/esnext.set.difference.js +3 -2
  298. package/modules/esnext.set.every.js +1 -1
  299. package/modules/esnext.set.filter.js +4 -3
  300. package/modules/esnext.set.find.js +1 -1
  301. package/modules/esnext.set.intersection.js +3 -2
  302. package/modules/esnext.set.is-disjoint-from.js +3 -2
  303. package/modules/esnext.set.is-subset-of.js +3 -2
  304. package/modules/esnext.set.is-superset-of.js +3 -2
  305. package/modules/esnext.set.join.js +9 -4
  306. package/modules/esnext.set.map.js +5 -4
  307. package/modules/esnext.set.reduce.js +3 -0
  308. package/modules/esnext.set.some.js +1 -1
  309. package/modules/esnext.set.symmetric-difference.js +3 -2
  310. package/modules/esnext.typed-array.from-async.js +0 -1
  311. package/modules/esnext.typed-array.unique-by.js +4 -2
  312. package/modules/esnext.weak-map.delete-all.js +2 -4
  313. package/modules/esnext.weak-map.emplace.js +2 -2
  314. package/modules/esnext.weak-map.upsert.js +2 -2
  315. package/modules/esnext.weak-set.add-all.js +2 -4
  316. package/modules/esnext.weak-set.delete-all.js +2 -4
  317. package/modules/web.timers.js +5 -4
  318. package/modules/web.url-search-params.js +62 -53
  319. package/modules/web.url.js +103 -89
  320. package/modules/web.url.to-json.js +2 -1
  321. package/package.json +2 -2
  322. package/stable/instance/entries.js +6 -4
  323. package/stable/instance/for-each.js +6 -4
  324. package/stable/instance/keys.js +6 -4
  325. package/stable/instance/values.js +6 -4
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var global = require('../internals/global');
4
+ var uncurryThis = require('../internals/function-uncurry-this');
4
5
  var isForced = require('../internals/is-forced');
5
6
  var redefine = require('../internals/redefine');
6
7
  var InternalMetadataModule = require('../internals/internal-metadata');
@@ -23,19 +24,19 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
23
24
  var exported = {};
24
25
 
25
26
  var fixMethod = function (KEY) {
26
- var nativeMethod = NativePrototype[KEY];
27
+ var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);
27
28
  redefine(NativePrototype, KEY,
28
29
  KEY == 'add' ? function add(value) {
29
- nativeMethod.call(this, value === 0 ? 0 : value);
30
+ uncurriedNativeMethod(this, value === 0 ? 0 : value);
30
31
  return this;
31
32
  } : KEY == 'delete' ? function (key) {
32
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
33
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
33
34
  } : KEY == 'get' ? function get(key) {
34
- return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
35
+ return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
35
36
  } : KEY == 'has' ? function has(key) {
36
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
37
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
37
38
  } : function set(key, value) {
38
- nativeMethod.call(this, key === 0 ? 0 : key, value);
39
+ uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
39
40
  return this;
40
41
  }
41
42
  );
@@ -72,7 +73,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
72
73
 
73
74
  if (!ACCEPT_ITERABLES) {
74
75
  Constructor = wrapper(function (dummy, iterable) {
75
- anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
76
+ anInstance(dummy, NativePrototype);
76
77
  var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
77
78
  if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
78
79
  return that;
@@ -1,9 +1,16 @@
1
1
  // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
2
- var Map = require('../modules/es.map');
3
- var WeakMap = require('../modules/es.weak-map');
2
+ require('../modules/es.map');
3
+ require('../modules/es.weak-map');
4
+ var global = require('../internals/global');
5
+ var getBuiltIn = require('../internals/get-built-in');
4
6
  var create = require('../internals/object-create');
5
7
  var isObject = require('../internals/is-object');
6
8
 
9
+ var Object = global.Object;
10
+ var TypeError = global.TypeError;
11
+ var Map = getBuiltIn('Map');
12
+ var WeakMap = getBuiltIn('WeakMap');
13
+
7
14
  var Node = function () {
8
15
  // keys
9
16
  this.object = null;
@@ -1,13 +1,15 @@
1
+ var uncurryThis = require('../internals/function-uncurry-this');
1
2
  var requireObjectCoercible = require('../internals/require-object-coercible');
2
3
  var toString = require('../internals/to-string');
3
4
 
4
5
  var quot = /"/g;
6
+ var replace = uncurryThis(''.replace);
5
7
 
6
8
  // `CreateHTML` abstract operation
7
9
  // https://tc39.es/ecma262/#sec-createhtml
8
10
  module.exports = function (string, tag, attribute, value) {
9
11
  var S = toString(requireObjectCoercible(string));
10
12
  var p1 = '<' + tag;
11
- if (attribute !== '') p1 += ' ' + attribute + '="' + toString(value).replace(quot, '&quot;') + '"';
13
+ if (attribute !== '') p1 += ' ' + attribute + '="' + replace(toString(value), quot, '&quot;') + '"';
12
14
  return p1 + '>' + S + '</' + tag + '>';
13
15
  };
@@ -1,31 +1,41 @@
1
1
  'use strict';
2
+ var global = require('../internals/global');
3
+ var uncurryThis = require('../internals/function-uncurry-this');
2
4
  var fails = require('../internals/fails');
3
5
  var padStart = require('../internals/string-pad').start;
4
6
 
7
+ var RangeError = global.RangeError;
5
8
  var abs = Math.abs;
6
9
  var DatePrototype = Date.prototype;
7
- var getTime = DatePrototype.getTime;
8
- var nativeDateToISOString = DatePrototype.toISOString;
10
+ var n$DateToISOString = DatePrototype.toISOString;
11
+ var getTime = uncurryThis(DatePrototype.getTime);
12
+ var getUTCDate = uncurryThis(DatePrototype.getUTCDate);
13
+ var getUTCFullYear = uncurryThis(DatePrototype.getUTCFullYear);
14
+ var getUTCHours = uncurryThis(DatePrototype.getUTCHours);
15
+ var getUTCMilliseconds = uncurryThis(DatePrototype.getUTCMilliseconds);
16
+ var getUTCMinutes = uncurryThis(DatePrototype.getUTCMinutes);
17
+ var getUTCMonth = uncurryThis(DatePrototype.getUTCMonth);
18
+ var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
9
19
 
10
20
  // `Date.prototype.toISOString` method implementation
11
21
  // https://tc39.es/ecma262/#sec-date.prototype.toisostring
12
22
  // PhantomJS / old WebKit fails here:
13
23
  module.exports = (fails(function () {
14
- return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
24
+ return n$DateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
15
25
  }) || !fails(function () {
16
- nativeDateToISOString.call(new Date(NaN));
26
+ n$DateToISOString.call(new Date(NaN));
17
27
  })) ? function toISOString() {
18
- if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
28
+ if (!isFinite(getTime(this))) throw RangeError('Invalid time value');
19
29
  var date = this;
20
- var year = date.getUTCFullYear();
21
- var milliseconds = date.getUTCMilliseconds();
30
+ var year = getUTCFullYear(date);
31
+ var milliseconds = getUTCMilliseconds(date);
22
32
  var sign = year < 0 ? '-' : year > 9999 ? '+' : '';
23
33
  return sign + padStart(abs(year), sign ? 6 : 4, 0) +
24
- '-' + padStart(date.getUTCMonth() + 1, 2, 0) +
25
- '-' + padStart(date.getUTCDate(), 2, 0) +
26
- 'T' + padStart(date.getUTCHours(), 2, 0) +
27
- ':' + padStart(date.getUTCMinutes(), 2, 0) +
28
- ':' + padStart(date.getUTCSeconds(), 2, 0) +
34
+ '-' + padStart(getUTCMonth(date) + 1, 2, 0) +
35
+ '-' + padStart(getUTCDate(date), 2, 0) +
36
+ 'T' + padStart(getUTCHours(date), 2, 0) +
37
+ ':' + padStart(getUTCMinutes(date), 2, 0) +
38
+ ':' + padStart(getUTCSeconds(date), 2, 0) +
29
39
  '.' + padStart(milliseconds, 3, 0) +
30
40
  'Z';
31
- } : nativeDateToISOString;
41
+ } : n$DateToISOString;
@@ -1,7 +1,10 @@
1
1
  'use strict';
2
+ var global = require('../internals/global');
2
3
  var anObject = require('../internals/an-object');
3
4
  var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
4
5
 
6
+ var TypeError = global.TypeError;
7
+
5
8
  // `Date.prototype[@@toPrimitive](hint)` method implementation
6
9
  // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
7
10
  module.exports = function (hint) {
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
+ var call = require('../internals/function-call');
3
4
  var IS_PURE = require('../internals/is-pure');
4
5
  var FunctionName = require('../internals/function-name');
5
6
  var isCallable = require('../internals/is-callable');
@@ -70,7 +71,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
70
71
  createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
71
72
  } else {
72
73
  INCORRECT_VALUES_NAME = true;
73
- defaultIterator = function values() { return nativeIterator.call(this); };
74
+ defaultIterator = function values() { return call(nativeIterator, this); };
74
75
  }
75
76
  }
76
77
 
@@ -9,13 +9,19 @@ var match, version;
9
9
 
10
10
  if (v8) {
11
11
  match = v8.split('.');
12
- version = match[0] < 4 ? 1 : match[0] + match[1];
13
- } else if (userAgent) {
12
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
13
+ // but their correct versions are not interesting for us
14
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
15
+ }
16
+
17
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
18
+ // so check `userAgent` even if `.v8` exists, but 0
19
+ if (!version && userAgent) {
14
20
  match = userAgent.match(/Edge\/(\d+)/);
15
21
  if (!match || match[1] >= 74) {
16
22
  match = userAgent.match(/Chrome\/(\d+)/);
17
- if (match) version = match[1];
23
+ if (match) version = +match[1];
18
24
  }
19
25
  }
20
26
 
21
- module.exports = version && +version;
27
+ module.exports = version;
@@ -1,8 +1,6 @@
1
1
  var global = require('../internals/global');
2
- var bind = require('../internals/function-bind-context');
2
+ var uncurryThis = require('../internals/function-uncurry-this');
3
3
 
4
- var call = Function.call;
5
-
6
- module.exports = function (CONSTRUCTOR, METHOD, length) {
7
- return bind(call, global[CONSTRUCTOR].prototype[METHOD], length);
4
+ module.exports = function (CONSTRUCTOR, METHOD) {
5
+ return uncurryThis(global[CONSTRUCTOR].prototype[METHOD]);
8
6
  };
@@ -0,0 +1,10 @@
1
+ var fails = require('../internals/fails');
2
+ var createPropertyDescriptor = require('../internals/create-property-descriptor');
3
+
4
+ module.exports = !fails(function () {
5
+ var error = Error('a');
6
+ if (!('stack' in error)) return true;
7
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
8
+ Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
9
+ return error.stack !== 7;
10
+ });
@@ -42,7 +42,7 @@ module.exports = function (options, source) {
42
42
  FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
43
43
  // contained in target
44
44
  if (!FORCED && targetProperty !== undefined) {
45
- if (typeof sourceProperty === typeof targetProperty) continue;
45
+ if (typeof sourceProperty == typeof targetProperty) continue;
46
46
  copyConstructorProperties(sourceProperty, targetProperty);
47
47
  }
48
48
  // add a flag to not completely full polyfills
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  // TODO: Remove from `core-js@4` since it's moved to entry points
3
3
  require('../modules/es.regexp.exec');
4
+ var uncurryThis = require('../internals/function-uncurry-this');
4
5
  var redefine = require('../internals/redefine');
5
6
  var regexpExec = require('../internals/regexp-exec');
6
7
  var fails = require('../internals/fails');
@@ -49,17 +50,18 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
49
50
  !DELEGATES_TO_EXEC ||
50
51
  FORCED
51
52
  ) {
52
- var nativeRegExpMethod = /./[SYMBOL];
53
+ var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);
53
54
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
55
+ var uncurriedNativeMethod = uncurryThis(nativeMethod);
54
56
  var $exec = regexp.exec;
55
57
  if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
56
58
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
57
59
  // The native String method already delegates to @@method (this
58
60
  // polyfilled function), leasing to infinite recursion.
59
61
  // We avoid it by directly calling the native @@method method.
60
- return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
62
+ return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
61
63
  }
62
- return { done: true, value: nativeMethod.call(str, regexp, arg2) };
64
+ return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
63
65
  }
64
66
  return { done: false };
65
67
  });
@@ -1,14 +1,17 @@
1
1
  'use strict';
2
+ var global = require('../internals/global');
2
3
  var isArray = require('../internals/is-array');
3
4
  var lengthOfArrayLike = require('../internals/length-of-array-like');
4
5
  var bind = require('../internals/function-bind-context');
5
6
 
7
+ var TypeError = global.TypeError;
8
+
6
9
  // `FlattenIntoArray` abstract operation
7
10
  // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
8
11
  var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
9
12
  var targetIndex = start;
10
13
  var sourceIndex = 0;
11
- var mapFn = mapper ? bind(mapper, thisArg, 3) : false;
14
+ var mapFn = mapper ? bind(mapper, thisArg) : false;
12
15
  var element, elementLen;
13
16
 
14
17
  while (sourceIndex < sourceLen) {
@@ -0,0 +1,9 @@
1
+ var FunctionPrototype = Function.prototype;
2
+ var apply = FunctionPrototype.apply;
3
+ var bind = FunctionPrototype.bind;
4
+ var call = FunctionPrototype.call;
5
+
6
+ // eslint-disable-next-line es/no-reflect -- safe
7
+ module.exports = typeof Reflect == 'object' && Reflect.apply || (bind ? call.bind(apply) : function () {
8
+ return call.apply(apply, arguments);
9
+ });
@@ -1,24 +1,12 @@
1
+ var uncurryThis = require('../internals/function-uncurry-this');
1
2
  var aCallable = require('../internals/a-callable');
2
3
 
4
+ var bind = uncurryThis(uncurryThis.bind);
5
+
3
6
  // optional / simple context binding
4
- module.exports = function (fn, that, length) {
7
+ module.exports = function (fn, that) {
5
8
  aCallable(fn);
6
- if (that === undefined) return fn;
7
- switch (length) {
8
- case 0: return function () {
9
- return fn.call(that);
10
- };
11
- case 1: return function (a) {
12
- return fn.call(that, a);
13
- };
14
- case 2: return function (a, b) {
15
- return fn.call(that, a, b);
16
- };
17
- case 3: return function (a, b, c) {
18
- return fn.call(that, a, b, c);
19
- };
20
- }
21
- return function (/* ...args */) {
9
+ return that === undefined ? fn : bind ? bind(fn, that) : function (/* ...args */) {
22
10
  return fn.apply(that, arguments);
23
11
  };
24
12
  };
@@ -1,27 +1,33 @@
1
1
  'use strict';
2
+ var global = require('../internals/global');
3
+ var uncurryThis = require('../internals/function-uncurry-this');
2
4
  var aCallable = require('../internals/a-callable');
3
5
  var isObject = require('../internals/is-object');
6
+ var hasOwn = require('../internals/has-own-property');
7
+ var arraySlice = require('../internals/array-slice');
4
8
 
5
- var slice = [].slice;
9
+ var Function = global.Function;
10
+ var concat = uncurryThis([].concat);
11
+ var join = uncurryThis([].join);
6
12
  var factories = {};
7
13
 
8
14
  var construct = function (C, argsLength, args) {
9
- if (!(argsLength in factories)) {
15
+ if (!hasOwn(factories, argsLength)) {
10
16
  for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
11
- // eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only
12
- factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
17
+ factories[argsLength] = Function('C,a', 'return new C(' + join(list, ',') + ')');
13
18
  } return factories[argsLength](C, args);
14
19
  };
15
20
 
16
21
  // `Function.prototype.bind` method implementation
17
22
  // https://tc39.es/ecma262/#sec-function.prototype.bind
18
23
  module.exports = Function.bind || function bind(that /* , ...args */) {
19
- var fn = aCallable(this);
20
- var partArgs = slice.call(arguments, 1);
24
+ var F = aCallable(this);
25
+ var Prototype = F.prototype;
26
+ var partArgs = arraySlice(arguments, 1);
21
27
  var boundFunction = function bound(/* args... */) {
22
- var args = partArgs.concat(slice.call(arguments));
23
- return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);
28
+ var args = concat(partArgs, arraySlice(arguments));
29
+ return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
24
30
  };
25
- if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;
31
+ if (isObject(Prototype)) boundFunction.prototype = Prototype;
26
32
  return boundFunction;
27
33
  };
@@ -0,0 +1,5 @@
1
+ var call = Function.prototype.call;
2
+
3
+ module.exports = call.bind ? call.bind(call) : function () {
4
+ return call.apply(call, arguments);
5
+ };
@@ -0,0 +1,12 @@
1
+ var FunctionPrototype = Function.prototype;
2
+ var bind = FunctionPrototype.bind;
3
+ var call = FunctionPrototype.call;
4
+ var callBind = bind && bind.bind(call);
5
+
6
+ module.exports = bind ? function (fn) {
7
+ return fn && callBind(call, fn);
8
+ } : function (fn) {
9
+ return fn && function () {
10
+ return call.apply(fn, arguments);
11
+ };
12
+ };
@@ -1,3 +1,4 @@
1
+ var call = require('../internals/function-call');
1
2
  var AsyncFromSyncIterator = require('../internals/async-from-sync-iterator');
2
3
  var anObject = require('../internals/an-object');
3
4
  var getIterator = require('../internals/get-iterator');
@@ -8,5 +9,5 @@ var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
8
9
 
9
10
  module.exports = function (it, usingIterator) {
10
11
  var method = arguments.length < 2 ? getMethod(it, ASYNC_ITERATOR) : usingIterator;
11
- return method ? anObject(method.call(it)) : new AsyncFromSyncIterator(getIterator(it));
12
+ return method ? anObject(call(method, it)) : new AsyncFromSyncIterator(getIterator(it));
12
13
  };
@@ -1,9 +1,14 @@
1
+ var global = require('../internals/global');
2
+ var call = require('../internals/function-call');
1
3
  var aCallable = require('../internals/a-callable');
2
4
  var anObject = require('../internals/an-object');
5
+ var tryToString = require('../internals/try-to-string');
3
6
  var getIteratorMethod = require('../internals/get-iterator-method');
4
7
 
8
+ var TypeError = global.TypeError;
9
+
5
10
  module.exports = function (argument, usingIterator) {
6
11
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
7
- if (aCallable(iteratorMethod)) return anObject(iteratorMethod.call(argument));
8
- throw TypeError(String(argument) + ' is not iterable');
12
+ if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
13
+ throw TypeError(tryToString(argument) + ' is not iterable');
9
14
  };
@@ -1,4 +1,6 @@
1
+ var call = require('../internals/function-call');
2
+
1
3
  module.exports = function (it) {
2
4
  // eslint-disable-next-line es/no-map -- safe
3
- return Map.prototype.entries.call(it);
5
+ return call(Map.prototype.entries, it);
4
6
  };
@@ -1,4 +1,6 @@
1
+ var call = require('../internals/function-call');
2
+
1
3
  module.exports = function (it) {
2
4
  // eslint-disable-next-line es/no-set -- safe
3
- return Set.prototype.values.call(it);
5
+ return call(Set.prototype.values, it);
4
6
  };
@@ -1,7 +1,10 @@
1
+ var uncurryThis = require('../internals/function-uncurry-this');
1
2
  var toObject = require('../internals/to-object');
2
3
 
3
4
  var floor = Math.floor;
4
- var replace = ''.replace;
5
+ var charAt = uncurryThis(''.charAt);
6
+ var replace = uncurryThis(''.replace);
7
+ var stringSlice = uncurryThis(''.slice);
5
8
  var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
6
9
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
7
10
 
@@ -15,15 +18,15 @@ module.exports = function (matched, str, position, captures, namedCaptures, repl
15
18
  namedCaptures = toObject(namedCaptures);
16
19
  symbols = SUBSTITUTION_SYMBOLS;
17
20
  }
18
- return replace.call(replacement, symbols, function (match, ch) {
21
+ return replace(replacement, symbols, function (match, ch) {
19
22
  var capture;
20
- switch (ch.charAt(0)) {
23
+ switch (charAt(ch, 0)) {
21
24
  case '$': return '$';
22
25
  case '&': return matched;
23
- case '`': return str.slice(0, position);
24
- case "'": return str.slice(tailPos);
26
+ case '`': return stringSlice(str, 0, position);
27
+ case "'": return stringSlice(str, tailPos);
25
28
  case '<':
26
- capture = namedCaptures[ch.slice(1, -1)];
29
+ capture = namedCaptures[stringSlice(ch, 1, -1)];
27
30
  break;
28
31
  default: // \d\d?
29
32
  var n = +ch;
@@ -31,7 +34,7 @@ module.exports = function (matched, str, position, captures, namedCaptures, repl
31
34
  if (n > m) {
32
35
  var f = floor(n / 10);
33
36
  if (f === 0) return match;
34
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
37
+ if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
35
38
  return match;
36
39
  }
37
40
  capture = captures[n - 1];
@@ -1,9 +1,10 @@
1
+ var uncurryThis = require('../internals/function-uncurry-this');
1
2
  var toObject = require('../internals/to-object');
2
3
 
3
- var hasOwnProperty = {}.hasOwnProperty;
4
+ var hasOwnProperty = uncurryThis({}.hasOwnProperty);
4
5
 
5
6
  // `HasOwnProperty` abstract operation
6
7
  // https://tc39.es/ecma262/#sec-hasownproperty
7
8
  module.exports = Object.hasOwn || function hasOwn(it, key) {
8
- return hasOwnProperty.call(toObject(it), key);
9
+ return hasOwnProperty(toObject(it), key);
9
10
  };
@@ -3,6 +3,6 @@ var global = require('../internals/global');
3
3
  module.exports = function (a, b) {
4
4
  var console = global.console;
5
5
  if (console && console.error) {
6
- arguments.length === 1 ? console.error(a) : console.error(a, b);
6
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
7
7
  }
8
8
  };
@@ -1,4 +1,7 @@
1
1
  // IEEE754 conversions based on https://github.com/feross/ieee754
2
+ var global = require('../internals/global');
3
+
4
+ var Array = global.Array;
2
5
  var abs = Math.abs;
3
6
  var pow = Math.pow;
4
7
  var floor = Math.floor;
@@ -6,7 +9,7 @@ var log = Math.log;
6
9
  var LN2 = Math.LN2;
7
10
 
8
11
  var pack = function (number, mantissaLength, bytes) {
9
- var buffer = new Array(bytes);
12
+ var buffer = Array(bytes);
10
13
  var exponentLength = bytes * 8 - mantissaLength - 1;
11
14
  var eMax = (1 << exponentLength) - 1;
12
15
  var eBias = eMax >> 1;
@@ -1,7 +1,10 @@
1
+ var global = require('../internals/global');
2
+ var uncurryThis = require('../internals/function-uncurry-this');
1
3
  var fails = require('../internals/fails');
2
4
  var classof = require('../internals/classof-raw');
3
5
 
4
- var split = ''.split;
6
+ var Object = global.Object;
7
+ var split = uncurryThis(''.split);
5
8
 
6
9
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
7
10
  module.exports = fails(function () {
@@ -9,5 +12,5 @@ module.exports = fails(function () {
9
12
  // eslint-disable-next-line no-prototype-builtins -- safe
10
13
  return !Object('z').propertyIsEnumerable(0);
11
14
  }) ? function (it) {
12
- return classof(it) == 'String' ? split.call(it, '') : Object(it);
15
+ return classof(it) == 'String' ? split(it, '') : Object(it);
13
16
  } : Object;
@@ -1,12 +1,13 @@
1
+ var uncurryThis = require('../internals/function-uncurry-this');
1
2
  var isCallable = require('../internals/is-callable');
2
3
  var store = require('../internals/shared-store');
3
4
 
4
- var functionToString = Function.toString;
5
+ var functionToString = uncurryThis(Function.toString);
5
6
 
6
7
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
7
8
  if (!isCallable(store.inspectSource)) {
8
9
  store.inspectSource = function (it) {
9
- return functionToString.call(it);
10
+ return functionToString(it);
10
11
  };
11
12
  }
12
13
 
@@ -1,4 +1,5 @@
1
1
  var $ = require('../internals/export');
2
+ var uncurryThis = require('../internals/function-uncurry-this');
2
3
  var hiddenKeys = require('../internals/hidden-keys');
3
4
  var isObject = require('../internals/is-object');
4
5
  var hasOwn = require('../internals/has-own-property');
@@ -60,7 +61,7 @@ var enable = function () {
60
61
  meta.enable = function () { /* empty */ };
61
62
  REQUIRED = true;
62
63
  var getOwnPropertyNames = getOwnPropertyNamesModule.f;
63
- var splice = [].splice;
64
+ var splice = uncurryThis([].splice);
64
65
  var test = {};
65
66
  test[METADATA] = 1;
66
67
 
@@ -70,7 +71,7 @@ var enable = function () {
70
71
  var result = getOwnPropertyNames(it);
71
72
  for (var i = 0, length = result.length; i < length; i++) {
72
73
  if (result[i] === METADATA) {
73
- splice.call(result, i, 1);
74
+ splice(result, i, 1);
74
75
  break;
75
76
  }
76
77
  } return result;
@@ -1,5 +1,6 @@
1
1
  var NATIVE_WEAK_MAP = require('../internals/native-weak-map');
2
2
  var global = require('../internals/global');
3
+ var uncurryThis = require('../internals/function-uncurry-this');
3
4
  var isObject = require('../internals/is-object');
4
5
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
5
6
  var hasOwn = require('../internals/has-own-property');
@@ -8,6 +9,7 @@ var sharedKey = require('../internals/shared-key');
8
9
  var hiddenKeys = require('../internals/hidden-keys');
9
10
 
10
11
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
12
+ var TypeError = global.TypeError;
11
13
  var WeakMap = global.WeakMap;
12
14
  var set, get, has;
13
15
 
@@ -26,20 +28,20 @@ var getterFor = function (TYPE) {
26
28
 
27
29
  if (NATIVE_WEAK_MAP || shared.state) {
28
30
  var store = shared.state || (shared.state = new WeakMap());
29
- var wmget = store.get;
30
- var wmhas = store.has;
31
- var wmset = store.set;
31
+ var wmget = uncurryThis(store.get);
32
+ var wmhas = uncurryThis(store.has);
33
+ var wmset = uncurryThis(store.set);
32
34
  set = function (it, metadata) {
33
- if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
35
+ if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
34
36
  metadata.facade = it;
35
- wmset.call(store, it, metadata);
37
+ wmset(store, it, metadata);
36
38
  return metadata;
37
39
  };
38
40
  get = function (it) {
39
- return wmget.call(store, it) || {};
41
+ return wmget(store, it) || {};
40
42
  };
41
43
  has = function (it) {
42
- return wmhas.call(store, it);
44
+ return wmhas(store, it);
43
45
  };
44
46
  } else {
45
47
  var STATE = sharedKey('state');
@@ -1,5 +1,5 @@
1
1
  // `IsCallable` abstract operation
2
2
  // https://tc39.es/ecma262/#sec-iscallable
3
3
  module.exports = function (argument) {
4
- return typeof argument === 'function';
4
+ return typeof argument == 'function';
5
5
  };