core-js-pure 3.18.2 → 3.19.2

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 (293) 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-non-extensible.js +10 -0
  80. package/internals/array-from-async.js +1 -1
  81. package/internals/array-from.js +6 -2
  82. package/internals/array-group-by.js +6 -3
  83. package/internals/array-iteration-from-last.js +1 -1
  84. package/internals/array-iteration.js +5 -4
  85. package/internals/array-last-index-of.js +2 -1
  86. package/internals/array-reduce.js +3 -0
  87. package/internals/array-slice-simple.js +17 -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 +5 -3
  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/error-stack-installable.js +10 -0
  112. package/internals/export.js +6 -4
  113. package/internals/flatten-into-array.js +4 -1
  114. package/internals/function-apply.js +9 -0
  115. package/internals/function-bind-context.js +5 -17
  116. package/internals/function-bind.js +15 -9
  117. package/internals/function-call.js +5 -0
  118. package/internals/function-uncurry-this.js +12 -0
  119. package/internals/get-async-iterator.js +2 -1
  120. package/internals/get-iterator.js +7 -2
  121. package/internals/get-substitution.js +10 -7
  122. package/internals/has-own-property.js +3 -2
  123. package/internals/host-report-errors.js +1 -1
  124. package/internals/ieee754.js +24 -6
  125. package/internals/indexed-object.js +5 -2
  126. package/internals/inspect-source.js +3 -2
  127. package/internals/install-error-cause.js +1 -1
  128. package/internals/internal-metadata.js +4 -7
  129. package/internals/internal-state.js +9 -7
  130. package/internals/is-callable.js +1 -1
  131. package/internals/is-constructor.js +6 -4
  132. package/internals/is-iterable.js +4 -2
  133. package/internals/is-object.js +1 -1
  134. package/internals/is-symbol.js +6 -2
  135. package/internals/iterate.js +14 -6
  136. package/internals/iterator-close.js +2 -1
  137. package/internals/iterator-create-proxy.js +4 -3
  138. package/internals/map-emplace.js +8 -3
  139. package/internals/map-upsert.js +12 -4
  140. package/internals/math-scale.js +9 -12
  141. package/internals/microtask.js +6 -4
  142. package/internals/normalize-string-argument.js +5 -0
  143. package/internals/not-a-regexp.js +3 -0
  144. package/internals/number-parse-float.js +8 -6
  145. package/internals/number-parse-int.js +4 -2
  146. package/internals/numeric-range-iterator.js +4 -0
  147. package/internals/object-assign.js +5 -2
  148. package/internals/object-define-properties.js +3 -1
  149. package/internals/object-define-property.js +2 -0
  150. package/internals/object-get-own-property-descriptor.js +2 -1
  151. package/internals/object-get-own-property-names-external.js +4 -4
  152. package/internals/object-get-prototype-of.js +2 -1
  153. package/internals/object-is-extensible.js +16 -0
  154. package/internals/object-is-prototype-of.js +3 -0
  155. package/internals/object-keys-internal.js +5 -2
  156. package/internals/object-set-prototype-of.js +4 -3
  157. package/internals/object-to-array.js +7 -3
  158. package/internals/ordinary-to-primitive.js +7 -3
  159. package/internals/own-keys.js +4 -1
  160. package/internals/reflect-metadata.js +9 -3
  161. package/internals/regexp-exec-abstract.js +6 -2
  162. package/internals/require-object-coercible.js +4 -0
  163. package/internals/set-global.js +4 -2
  164. package/internals/shared.js +1 -1
  165. package/internals/string-multibyte.js +13 -4
  166. package/internals/string-pad.js +6 -3
  167. package/internals/string-punycode-to-ascii.js +34 -20
  168. package/internals/string-repeat.js +3 -0
  169. package/internals/string-trim.js +4 -2
  170. package/internals/task.js +11 -11
  171. package/internals/this-number-value.js +2 -4
  172. package/internals/to-index.js +3 -0
  173. package/internals/to-object.js +3 -0
  174. package/internals/to-positive-integer.js +3 -0
  175. package/internals/to-primitive.js +4 -1
  176. package/internals/to-property-key.js +1 -1
  177. package/internals/to-string.js +3 -0
  178. package/internals/try-to-string.js +4 -0
  179. package/internals/uid.js +4 -1
  180. package/internals/well-known-symbol.js +5 -1
  181. package/modules/es.aggregate-error.js +27 -11
  182. package/modules/es.array.concat.js +2 -0
  183. package/modules/es.array.index-of.js +7 -5
  184. package/modules/es.array.join.js +3 -2
  185. package/modules/es.array.of.js +3 -1
  186. package/modules/es.array.reduce.js +2 -1
  187. package/modules/es.array.reverse.js +3 -2
  188. package/modules/es.array.slice.js +4 -2
  189. package/modules/es.array.sort.js +7 -4
  190. package/modules/es.array.splice.js +2 -0
  191. package/modules/es.date.get-year.js +3 -2
  192. package/modules/es.date.now.js +6 -1
  193. package/modules/es.date.set-year.js +6 -4
  194. package/modules/es.date.to-json.js +3 -2
  195. package/modules/es.escape.js +12 -5
  196. package/modules/es.function.has-instance.js +3 -2
  197. package/modules/es.json.stringify.js +18 -7
  198. package/modules/es.map.js +1 -1
  199. package/modules/es.number.to-fixed.js +19 -13
  200. package/modules/es.number.to-precision.js +6 -5
  201. package/modules/es.object.is-extensible.js +4 -10
  202. package/modules/es.object.is-frozen.js +6 -2
  203. package/modules/es.object.is-sealed.js +6 -2
  204. package/modules/es.promise.all-settled.js +2 -2
  205. package/modules/es.promise.any.js +5 -4
  206. package/modules/es.promise.js +22 -18
  207. package/modules/es.reflect.apply.js +4 -10
  208. package/modules/es.reflect.construct.js +10 -5
  209. package/modules/es.reflect.get.js +2 -1
  210. package/modules/es.reflect.is-extensible.js +2 -4
  211. package/modules/es.reflect.set.js +2 -1
  212. package/modules/es.set.js +1 -1
  213. package/modules/es.string.at-alternative.js +4 -1
  214. package/modules/es.string.ends-with.js +6 -4
  215. package/modules/es.string.from-code-point.js +7 -4
  216. package/modules/es.string.includes.js +8 -2
  217. package/modules/es.string.match-all.js +25 -19
  218. package/modules/es.string.raw.js +6 -6
  219. package/modules/es.string.replace-all.js +19 -13
  220. package/modules/es.string.starts-with.js +6 -4
  221. package/modules/es.string.substr.js +3 -2
  222. package/modules/es.symbol.js +34 -21
  223. package/modules/es.unescape.js +14 -9
  224. package/modules/es.weak-map.js +15 -15
  225. package/modules/esnext.array.is-template-object.js +1 -1
  226. package/modules/esnext.async-iterator.as-indexed-pairs.js +2 -1
  227. package/modules/esnext.async-iterator.constructor.js +1 -1
  228. package/modules/esnext.async-iterator.drop.js +2 -1
  229. package/modules/esnext.async-iterator.filter.js +2 -1
  230. package/modules/esnext.async-iterator.flat-map.js +3 -2
  231. package/modules/esnext.async-iterator.from.js +4 -4
  232. package/modules/esnext.async-iterator.map.js +2 -1
  233. package/modules/esnext.async-iterator.reduce.js +4 -1
  234. package/modules/esnext.async-iterator.take.js +4 -2
  235. package/modules/esnext.composite-key.js +5 -1
  236. package/modules/esnext.composite-symbol.js +3 -2
  237. package/modules/esnext.iterator.as-indexed-pairs.js +2 -1
  238. package/modules/esnext.iterator.constructor.js +1 -1
  239. package/modules/esnext.iterator.drop.js +4 -2
  240. package/modules/esnext.iterator.filter.js +2 -1
  241. package/modules/esnext.iterator.flat-map.js +7 -3
  242. package/modules/esnext.iterator.from.js +4 -4
  243. package/modules/esnext.iterator.map.js +2 -1
  244. package/modules/esnext.iterator.reduce.js +3 -0
  245. package/modules/esnext.iterator.take.js +2 -1
  246. package/modules/esnext.map.delete-all.js +2 -4
  247. package/modules/esnext.map.emplace.js +2 -2
  248. package/modules/esnext.map.every.js +1 -1
  249. package/modules/esnext.map.filter.js +5 -4
  250. package/modules/esnext.map.find-key.js +1 -1
  251. package/modules/esnext.map.find.js +1 -1
  252. package/modules/esnext.map.group-by.js +6 -2
  253. package/modules/esnext.map.includes.js +1 -1
  254. package/modules/esnext.map.key-by.js +2 -1
  255. package/modules/esnext.map.map-keys.js +5 -4
  256. package/modules/esnext.map.map-values.js +5 -4
  257. package/modules/esnext.map.reduce.js +3 -0
  258. package/modules/esnext.map.some.js +1 -1
  259. package/modules/esnext.map.update-or-insert.js +2 -2
  260. package/modules/esnext.map.update.js +11 -4
  261. package/modules/esnext.map.upsert.js +2 -2
  262. package/modules/esnext.math.seeded-prng.js +3 -1
  263. package/modules/esnext.number.from-string.js +12 -3
  264. package/modules/esnext.observable.js +14 -9
  265. package/modules/esnext.reflect.get-metadata-keys.js +5 -10
  266. package/modules/esnext.set.add-all.js +2 -4
  267. package/modules/esnext.set.delete-all.js +2 -4
  268. package/modules/esnext.set.difference.js +3 -2
  269. package/modules/esnext.set.every.js +1 -1
  270. package/modules/esnext.set.filter.js +4 -3
  271. package/modules/esnext.set.find.js +1 -1
  272. package/modules/esnext.set.intersection.js +3 -2
  273. package/modules/esnext.set.is-disjoint-from.js +3 -2
  274. package/modules/esnext.set.is-subset-of.js +3 -2
  275. package/modules/esnext.set.is-superset-of.js +3 -2
  276. package/modules/esnext.set.join.js +9 -4
  277. package/modules/esnext.set.map.js +5 -4
  278. package/modules/esnext.set.reduce.js +3 -0
  279. package/modules/esnext.set.some.js +1 -1
  280. package/modules/esnext.set.symmetric-difference.js +3 -2
  281. package/modules/esnext.weak-map.delete-all.js +2 -4
  282. package/modules/esnext.weak-map.emplace.js +2 -2
  283. package/modules/esnext.weak-map.upsert.js +2 -2
  284. package/modules/esnext.weak-set.add-all.js +2 -4
  285. package/modules/esnext.weak-set.delete-all.js +2 -4
  286. package/modules/web.timers.js +5 -4
  287. package/modules/web.url-search-params.js +122 -104
  288. package/modules/web.url.js +664 -628
  289. package/package.json +2 -2
  290. package/stable/instance/entries.js +6 -4
  291. package/stable/instance/for-each.js +6 -4
  292. package/stable/instance/keys.js +6 -4
  293. package/stable/instance/values.js +6 -4
package/es/promise/any.js CHANGED
@@ -5,6 +5,7 @@ require('../../modules/es.object.to-string');
5
5
  require('../../modules/es.promise');
6
6
  require('../../modules/es.promise.any');
7
7
  require('../../modules/es.string.iterator');
8
+ var call = require('../../internals/function-call');
8
9
  var isCallable = require('../../internals/is-callable');
9
10
  var path = require('../../internals/path');
10
11
 
@@ -12,5 +13,5 @@ var Promise = path.Promise;
12
13
  var $any = Promise.any;
13
14
 
14
15
  module.exports = function any(iterable) {
15
- return $any.call(isCallable(this) ? this : Promise, iterable);
16
+ return call($any, isCallable(this) ? this : Promise, iterable);
16
17
  };
@@ -1,6 +1,5 @@
1
1
  require('../../modules/es.regexp.flags');
2
- var flags = require('../../internals/regexp-flags');
2
+ var uncurryThis = require('../../internals/function-uncurry-this');
3
+ var regExpFlags = require('../../internals/regexp-flags');
3
4
 
4
- module.exports = function (it) {
5
- return flags.call(it);
6
- };
5
+ module.exports = uncurryThis(regExpFlags);
@@ -1,9 +1,10 @@
1
1
  require('../../modules/es.regexp.exec');
2
2
  require('../../modules/es.string.match');
3
+ var call = require('../../internals/function-call');
3
4
  var wellKnownSymbol = require('../../internals/well-known-symbol');
4
5
 
5
6
  var MATCH = wellKnownSymbol('match');
6
7
 
7
8
  module.exports = function (it, str) {
8
- return RegExp.prototype[MATCH].call(it, str);
9
+ return call(RegExp.prototype[MATCH], it, str);
9
10
  };
@@ -1,9 +1,10 @@
1
1
  require('../../modules/es.regexp.exec');
2
2
  require('../../modules/es.string.replace');
3
+ var call = require('../../internals/function-call');
3
4
  var wellKnownSymbol = require('../../internals/well-known-symbol');
4
5
 
5
6
  var REPLACE = wellKnownSymbol('replace');
6
7
 
7
8
  module.exports = function (it, str, replacer) {
8
- return RegExp.prototype[REPLACE].call(it, str, replacer);
9
+ return call(RegExp.prototype[REPLACE], it, str, replacer);
9
10
  };
@@ -1,9 +1,10 @@
1
1
  require('../../modules/es.regexp.exec');
2
2
  require('../../modules/es.string.search');
3
+ var call = require('../../internals/function-call');
3
4
  var wellKnownSymbol = require('../../internals/well-known-symbol');
4
5
 
5
6
  var SEARCH = wellKnownSymbol('search');
6
7
 
7
8
  module.exports = function (it, str) {
8
- return RegExp.prototype[SEARCH].call(it, str);
9
+ return call(RegExp.prototype[SEARCH], it, str);
9
10
  };
@@ -1,9 +1,10 @@
1
1
  require('../../modules/es.regexp.exec');
2
2
  require('../../modules/es.string.split');
3
+ var call = require('../../internals/function-call');
3
4
  var wellKnownSymbol = require('../../internals/well-known-symbol');
4
5
 
5
6
  var SPLIT = wellKnownSymbol('split');
6
7
 
7
8
  module.exports = function (it, str, limit) {
8
- return RegExp.prototype[SPLIT].call(it, str, limit);
9
+ return call(RegExp.prototype[SPLIT], it, str, limit);
9
10
  };
package/es/regexp/test.js CHANGED
@@ -1,6 +1,5 @@
1
1
  require('../../modules/es.regexp.exec');
2
2
  require('../../modules/es.regexp.test');
3
+ var uncurryThis = require('../../internals/function-uncurry-this');
3
4
 
4
- module.exports = function (re, string) {
5
- return RegExp.prototype.test.call(re, string);
6
- };
5
+ module.exports = uncurryThis(/./.test);
@@ -1,5 +1,4 @@
1
1
  require('../../modules/es.regexp.to-string');
2
+ var uncurryThis = require('../../internals/function-uncurry-this');
2
3
 
3
- module.exports = function toString(it) {
4
- return RegExp.prototype.toString.call(it);
5
- };
4
+ module.exports = uncurryThis(/./.toString);
@@ -1,9 +1,6 @@
1
1
  require('../../modules/es.object.to-string');
2
2
  require('../../modules/es.string.iterator');
3
+ var uncurryThis = require('../../internals/function-uncurry-this');
3
4
  var Iterators = require('../../internals/iterators');
4
5
 
5
- var getStringIterator = Iterators.String;
6
-
7
- module.exports = function (it) {
8
- return getStringIterator.call(it);
9
- };
6
+ module.exports = uncurryThis(Iterators.String);
@@ -1,13 +1,14 @@
1
- var arrayAt = require('../array/virtual/at');
2
- var stringAt = require('../string/virtual/at');
1
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
2
+ var arrayMethod = require('../array/virtual/at');
3
+ var stringMethod = require('../string/virtual/at');
3
4
 
4
5
  var ArrayPrototype = Array.prototype;
5
6
  var StringPrototype = String.prototype;
6
7
 
7
8
  module.exports = function (it) {
8
9
  var own = it.at;
9
- if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.at)) return arrayAt;
10
- if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.at)) {
11
- return stringAt;
10
+ if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.at)) return arrayMethod;
11
+ if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.at)) {
12
+ return stringMethod;
12
13
  } return own;
13
14
  };
@@ -1,9 +1,10 @@
1
- var codePoints = require('../string/virtual/code-points');
1
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
2
+ var method = require('../string/virtual/code-points');
2
3
 
3
4
  var StringPrototype = String.prototype;
4
5
 
5
6
  module.exports = function (it) {
6
7
  var own = it.codePoints;
7
- return typeof it === 'string' || it === StringPrototype
8
- || (it instanceof String && own === StringPrototype.codePoints) ? codePoints : own;
8
+ return typeof it == 'string' || it === StringPrototype
9
+ || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.codePoints) ? method : own;
9
10
  };
@@ -1,9 +1,10 @@
1
1
  // TODO: Remove from `core-js@4`
2
- var filterOut = require('../array/virtual/filter-out');
2
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
3
+ var method = require('../array/virtual/filter-out');
3
4
 
4
5
  var ArrayPrototype = Array.prototype;
5
6
 
6
7
  module.exports = function (it) {
7
8
  var own = it.filterOut;
8
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filterOut) ? filterOut : own;
9
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filterOut) ? method : own;
9
10
  };
@@ -1,8 +1,9 @@
1
- var filterReject = require('../array/virtual/filter-reject');
1
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
2
+ var method = require('../array/virtual/filter-reject');
2
3
 
3
4
  var ArrayPrototype = Array.prototype;
4
5
 
5
6
  module.exports = function (it) {
6
7
  var own = it.filterReject;
7
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filterReject) ? filterReject : own;
8
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filterReject) ? method : own;
8
9
  };
@@ -1,8 +1,9 @@
1
- var findLastIndex = require('../array/virtual/find-last-index');
1
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
2
+ var method = require('../array/virtual/find-last-index');
2
3
 
3
4
  var ArrayPrototype = Array.prototype;
4
5
 
5
6
  module.exports = function (it) {
6
7
  var own = it.findLastIndex;
7
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLastIndex) ? findLastIndex : own;
8
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.findLastIndex) ? method : own;
8
9
  };
@@ -1,8 +1,9 @@
1
- var findLast = require('../array/virtual/find-last');
1
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
2
+ var method = require('../array/virtual/find-last');
2
3
 
3
4
  var ArrayPrototype = Array.prototype;
4
5
 
5
6
  module.exports = function (it) {
6
7
  var own = it.findLast;
7
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLast) ? findLast : own;
8
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.findLast) ? method : own;
8
9
  };
@@ -1,8 +1,9 @@
1
- var groupBy = require('../array/virtual/group-by');
1
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
2
+ var method = require('../array/virtual/group-by');
2
3
 
3
4
  var ArrayPrototype = Array.prototype;
4
5
 
5
6
  module.exports = function (it) {
6
7
  var own = it.groupBy;
7
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.groupBy) ? groupBy : own;
8
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.groupBy) ? method : own;
8
9
  };
@@ -1,8 +1,9 @@
1
- var uniqueBy = require('../array/virtual/unique-by');
1
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
2
+ var method = require('../array/virtual/unique-by');
2
3
 
3
4
  var ArrayPrototype = Array.prototype;
4
5
 
5
6
  module.exports = function (it) {
6
7
  var own = it.uniqueBy;
7
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.uniqueBy) ? uniqueBy : own;
8
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.uniqueBy) ? method : own;
8
9
  };
@@ -4,12 +4,13 @@ require('../../modules/es.map');
4
4
  require('../../modules/es.string.iterator');
5
5
  require('../../modules/esnext.map.from');
6
6
  require('../../modules/web.dom-collections.iterator');
7
+ var call = require('../../internals/function-call');
7
8
  var isCallable = require('../../internals/is-callable');
8
9
  var path = require('../../internals/path');
9
10
 
10
11
  var Map = path.Map;
11
- var mapFrom = Map.from;
12
+ var $from = Map.from;
12
13
 
13
14
  module.exports = function from(source, mapFn, thisArg) {
14
- return mapFrom.call(isCallable(this) ? this : Map, source, mapFn, thisArg);
15
+ return call($from, isCallable(this) ? this : Map, source, mapFn, thisArg);
15
16
  };
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  require('../../modules/es.map');
3
3
  require('../../modules/esnext.map.group-by');
4
+ var call = require('../../internals/function-call');
4
5
  var isCallable = require('../../internals/is-callable');
5
6
  var path = require('../../internals/path');
6
7
 
@@ -8,5 +9,5 @@ var Map = path.Map;
8
9
  var mapGroupBy = Map.groupBy;
9
10
 
10
11
  module.exports = function groupBy(source, iterable, keyDerivative) {
11
- return mapGroupBy.call(isCallable(this) ? this : Map, source, iterable, keyDerivative);
12
+ return call(mapGroupBy, isCallable(this) ? this : Map, source, iterable, keyDerivative);
12
13
  };
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  require('../../modules/es.map');
3
3
  require('../../modules/esnext.map.key-by');
4
+ var call = require('../../internals/function-call');
4
5
  var isCallable = require('../../internals/is-callable');
5
6
  var path = require('../../internals/path');
6
7
 
@@ -8,5 +9,5 @@ var Map = path.Map;
8
9
  var mapKeyBy = Map.keyBy;
9
10
 
10
11
  module.exports = function keyBy(source, iterable, keyDerivative) {
11
- return mapKeyBy.call(isCallable(this) ? this : Map, source, iterable, keyDerivative);
12
+ return call(mapKeyBy, isCallable(this) ? this : Map, source, iterable, keyDerivative);
12
13
  };
@@ -2,12 +2,13 @@
2
2
  require('../../modules/es.array.iterator');
3
3
  require('../../modules/es.map');
4
4
  require('../../modules/esnext.map.of');
5
- var isCallable = require('../../internals/is-callable');
6
5
  var path = require('../../internals/path');
6
+ var apply = require('../../internals/function-apply');
7
+ var isCallable = require('../../internals/is-callable');
7
8
 
8
9
  var Map = path.Map;
9
10
  var mapOf = Map.of;
10
11
 
11
12
  module.exports = function of() {
12
- return mapOf.apply(isCallable(this) ? this : Map, arguments);
13
+ return apply(mapOf, isCallable(this) ? this : Map, arguments);
13
14
  };
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  require('../../modules/es.promise');
3
3
  require('../../modules/esnext.promise.try');
4
+ var call = require('../../internals/function-call');
4
5
  var isCallable = require('../../internals/is-callable');
5
6
  var path = require('../../internals/path');
6
7
 
@@ -8,5 +9,5 @@ var Promise = path.Promise;
8
9
  var promiseTry = Promise['try'];
9
10
 
10
11
  module.exports = { 'try': function (callbackfn) {
11
- return promiseTry.call(isCallable(this) ? this : Promise, callbackfn);
12
+ return call(promiseTry, isCallable(this) ? this : Promise, callbackfn);
12
13
  } }['try'];
@@ -4,12 +4,13 @@ require('../../modules/es.set');
4
4
  require('../../modules/es.string.iterator');
5
5
  require('../../modules/esnext.set.from');
6
6
  require('../../modules/web.dom-collections.iterator');
7
+ var call = require('../../internals/function-call');
7
8
  var isCallable = require('../../internals/is-callable');
8
9
  var path = require('../../internals/path');
9
10
 
10
11
  var Set = path.Set;
11
- var setFrom = Set.from;
12
+ var $from = Set.from;
12
13
 
13
14
  module.exports = function from(source, mapFn, thisArg) {
14
- return setFrom.call(isCallable(this) ? this : Set, source, mapFn, thisArg);
15
+ return call($from, isCallable(this) ? this : Set, source, mapFn, thisArg);
15
16
  };
@@ -2,12 +2,13 @@
2
2
  require('../../modules/es.array.iterator');
3
3
  require('../../modules/es.set');
4
4
  require('../../modules/esnext.set.of');
5
- var isCallable = require('../../internals/is-callable');
6
5
  var path = require('../../internals/path');
6
+ var apply = require('../../internals/function-apply');
7
+ var isCallable = require('../../internals/is-callable');
7
8
 
8
9
  var Set = path.Set;
9
10
  var setOf = Set.of;
10
11
 
11
12
  module.exports = function of() {
12
- return setOf.apply(isCallable(this) ? this : Set, arguments);
13
+ return apply(setOf, isCallable(this) ? this : Set, arguments);
13
14
  };
@@ -4,12 +4,13 @@ require('../../modules/es.string.iterator');
4
4
  require('../../modules/es.weak-map');
5
5
  require('../../modules/esnext.weak-map.from');
6
6
  require('../../modules/web.dom-collections.iterator');
7
+ var call = require('../../internals/function-call');
7
8
  var isCallable = require('../../internals/is-callable');
8
9
  var path = require('../../internals/path');
9
10
 
10
11
  var WeakMap = path.WeakMap;
11
- var weakMapFrom = WeakMap.from;
12
+ var $from = WeakMap.from;
12
13
 
13
14
  module.exports = function from(source, mapFn, thisArg) {
14
- return weakMapFrom.call(isCallable(this) ? this : WeakMap, source, mapFn, thisArg);
15
+ return call($from, isCallable(this) ? this : WeakMap, source, mapFn, thisArg);
15
16
  };
@@ -2,12 +2,13 @@
2
2
  require('../../modules/es.array.iterator');
3
3
  require('../../modules/es.weak-map');
4
4
  require('../../modules/esnext.weak-map.of');
5
- var isCallable = require('../../internals/is-callable');
6
5
  var path = require('../../internals/path');
6
+ var apply = require('../../internals/function-apply');
7
+ var isCallable = require('../../internals/is-callable');
7
8
 
8
9
  var WeakMap = path.WeakMap;
9
10
  var weakMapOf = WeakMap.of;
10
11
 
11
12
  module.exports = function of() {
12
- return weakMapOf.apply(isCallable(this) ? this : WeakMap, arguments);
13
+ return apply(weakMapOf, isCallable(this) ? this : WeakMap, arguments);
13
14
  };
@@ -4,12 +4,13 @@ require('../../modules/es.string.iterator');
4
4
  require('../../modules/es.weak-set');
5
5
  require('../../modules/esnext.weak-set.from');
6
6
  require('../../modules/web.dom-collections.iterator');
7
+ var call = require('../../internals/function-call');
7
8
  var isCallable = require('../../internals/is-callable');
8
9
  var path = require('../../internals/path');
9
10
 
10
11
  var WeakSet = path.WeakSet;
11
- var weakSetfrom = WeakSet.from;
12
+ var $from = WeakSet.from;
12
13
 
13
14
  module.exports = function from(source, mapFn, thisArg) {
14
- return weakSetfrom.call(isCallable(this) ? this : WeakSet, source, mapFn, thisArg);
15
+ return call($from, isCallable(this) ? this : WeakSet, source, mapFn, thisArg);
15
16
  };
@@ -2,12 +2,13 @@
2
2
  require('../../modules/es.array.iterator');
3
3
  require('../../modules/es.weak-set');
4
4
  require('../../modules/esnext.weak-set.of');
5
- var isCallable = require('../../internals/is-callable');
6
5
  var path = require('../../internals/path');
6
+ var apply = require('../../internals/function-apply');
7
+ var isCallable = require('../../internals/is-callable');
7
8
 
8
9
  var WeakSet = path.WeakSet;
9
10
  var weakSetOf = WeakSet.of;
10
11
 
11
12
  module.exports = function of() {
12
- return weakSetOf.apply(isCallable(this) ? this : WeakSet, arguments);
13
+ return apply(weakSetOf, isCallable(this) ? this : WeakSet, arguments);
13
14
  };
@@ -1,6 +1,9 @@
1
+ var global = require('../internals/global');
1
2
  var isCallable = require('../internals/is-callable');
2
3
  var tryToString = require('../internals/try-to-string');
3
4
 
5
+ var TypeError = global.TypeError;
6
+
4
7
  // `Assert: IsCallable(argument) is true`
5
8
  module.exports = function (argument) {
6
9
  if (isCallable(argument)) return argument;
@@ -1,6 +1,9 @@
1
+ var global = require('../internals/global');
1
2
  var isConstructor = require('../internals/is-constructor');
2
3
  var tryToString = require('../internals/try-to-string');
3
4
 
5
+ var TypeError = global.TypeError;
6
+
4
7
  // `Assert: IsConstructor(argument) is true`
5
8
  module.exports = function (argument) {
6
9
  if (isConstructor(argument)) return argument;
@@ -1,6 +1,10 @@
1
+ var global = require('../internals/global');
1
2
  var isCallable = require('../internals/is-callable');
2
3
 
4
+ var String = global.String;
5
+ var TypeError = global.TypeError;
6
+
3
7
  module.exports = function (argument) {
4
- if (typeof argument === 'object' || isCallable(argument)) return argument;
8
+ if (typeof argument == 'object' || isCallable(argument)) return argument;
5
9
  throw TypeError("Can't set " + String(argument) + ' as a prototype');
6
10
  };
@@ -1,4 +1,9 @@
1
- module.exports = function (it, Constructor, name) {
2
- if (it instanceof Constructor) return it;
3
- throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
1
+ var global = require('../internals/global');
2
+ var isPrototypeOf = require('../internals/object-is-prototype-of');
3
+
4
+ var TypeError = global.TypeError;
5
+
6
+ module.exports = function (it, Prototype) {
7
+ if (isPrototypeOf(Prototype, it)) return it;
8
+ throw TypeError('Incorrect invocation');
4
9
  };
@@ -1,5 +1,9 @@
1
+ var global = require('../internals/global');
1
2
  var isObject = require('../internals/is-object');
2
3
 
4
+ var String = global.String;
5
+ var TypeError = global.TypeError;
6
+
3
7
  // `Assert: Type(argument) is Object`
4
8
  module.exports = function (argument) {
5
9
  if (isObject(argument)) return argument;
@@ -1,2 +1,2 @@
1
1
  // eslint-disable-next-line es/no-typed-arrays -- safe
2
- module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';
2
+ module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
@@ -0,0 +1,10 @@
1
+ // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
2
+ var fails = require('../internals/fails');
3
+
4
+ module.exports = fails(function () {
5
+ if (typeof ArrayBuffer == 'function') {
6
+ var buffer = new ArrayBuffer(8);
7
+ // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
8
+ if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
9
+ }
10
+ });
@@ -24,7 +24,7 @@ module.exports = function fromAsync(asyncItems /* , mapfn = undefined, thisArg =
24
24
  var thisArg = argumentsLength > 2 ? arguments[2] : undefined;
25
25
  return new (getBuiltIn('Promise'))(function (resolve) {
26
26
  var O = toObject(asyncItems);
27
- if (mapfn !== undefined) mapfn = bind(mapfn, thisArg, 2);
27
+ if (mapfn !== undefined) mapfn = bind(mapfn, thisArg);
28
28
  var usingAsyncIterator = getMethod(O, ASYNC_ITERATOR);
29
29
  var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod(O) || arrayIterator;
30
30
  var A = isConstructor(C) ? new C() : [];
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
+ var global = require('../internals/global');
2
3
  var bind = require('../internals/function-bind-context');
4
+ var call = require('../internals/function-call');
3
5
  var toObject = require('../internals/to-object');
4
6
  var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
5
7
  var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
@@ -9,6 +11,8 @@ var createProperty = require('../internals/create-property');
9
11
  var getIterator = require('../internals/get-iterator');
10
12
  var getIteratorMethod = require('../internals/get-iterator-method');
11
13
 
14
+ var Array = global.Array;
15
+
12
16
  // `Array.from` method implementation
13
17
  // https://tc39.es/ecma262/#sec-array.from
14
18
  module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
@@ -17,7 +21,7 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
17
21
  var argumentsLength = arguments.length;
18
22
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
19
23
  var mapping = mapfn !== undefined;
20
- if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
24
+ if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
21
25
  var iteratorMethod = getIteratorMethod(O);
22
26
  var index = 0;
23
27
  var length, result, step, iterator, next, value;
@@ -26,7 +30,7 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
26
30
  iterator = getIterator(O, iteratorMethod);
27
31
  next = iterator.next;
28
32
  result = IS_CONSTRUCTOR ? new this() : [];
29
- for (;!(step = next.call(iterator)).done; index++) {
33
+ for (;!(step = call(next, iterator)).done; index++) {
30
34
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
31
35
  createProperty(result, index, value);
32
36
  }
@@ -1,4 +1,6 @@
1
+ var global = require('../internals/global');
1
2
  var bind = require('../internals/function-bind-context');
3
+ var uncurryThis = require('../internals/function-uncurry-this');
2
4
  var IndexedObject = require('../internals/indexed-object');
3
5
  var toObject = require('../internals/to-object');
4
6
  var toPropertyKey = require('../internals/to-property-key');
@@ -6,12 +8,13 @@ var lengthOfArrayLike = require('../internals/length-of-array-like');
6
8
  var objectCreate = require('../internals/object-create');
7
9
  var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
8
10
 
9
- var push = [].push;
11
+ var Array = global.Array;
12
+ var push = uncurryThis([].push);
10
13
 
11
14
  module.exports = function ($this, callbackfn, that, specificConstructor) {
12
15
  var O = toObject($this);
13
16
  var self = IndexedObject(O);
14
- var boundFunction = bind(callbackfn, that, 3);
17
+ var boundFunction = bind(callbackfn, that);
15
18
  var target = objectCreate(null);
16
19
  var length = lengthOfArrayLike(self);
17
20
  var index = 0;
@@ -21,7 +24,7 @@ module.exports = function ($this, callbackfn, that, specificConstructor) {
21
24
  key = toPropertyKey(boundFunction(value, index, O));
22
25
  // in some IE10 builds, `hasOwnProperty` returns incorrect result on integer keys
23
26
  // but since it's a `null` prototype object, we can safely use `in`
24
- if (key in target) push.call(target[key], value);
27
+ if (key in target) push(target[key], value);
25
28
  else target[key] = [value];
26
29
  }
27
30
  if (specificConstructor) {
@@ -9,7 +9,7 @@ var createMethod = function (TYPE) {
9
9
  return function ($this, callbackfn, that) {
10
10
  var O = toObject($this);
11
11
  var self = IndexedObject(O);
12
- var boundFunction = bind(callbackfn, that, 3);
12
+ var boundFunction = bind(callbackfn, that);
13
13
  var index = lengthOfArrayLike(self);
14
14
  var value, result;
15
15
  while (index-- > 0) {
@@ -1,10 +1,11 @@
1
1
  var bind = require('../internals/function-bind-context');
2
+ var uncurryThis = require('../internals/function-uncurry-this');
2
3
  var IndexedObject = require('../internals/indexed-object');
3
4
  var toObject = require('../internals/to-object');
4
5
  var lengthOfArrayLike = require('../internals/length-of-array-like');
5
6
  var arraySpeciesCreate = require('../internals/array-species-create');
6
7
 
7
- var push = [].push;
8
+ var push = uncurryThis([].push);
8
9
 
9
10
  // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
10
11
  var createMethod = function (TYPE) {
@@ -18,7 +19,7 @@ var createMethod = function (TYPE) {
18
19
  return function ($this, callbackfn, that, specificCreate) {
19
20
  var O = toObject($this);
20
21
  var self = IndexedObject(O);
21
- var boundFunction = bind(callbackfn, that, 3);
22
+ var boundFunction = bind(callbackfn, that);
22
23
  var length = lengthOfArrayLike(self);
23
24
  var index = 0;
24
25
  var create = specificCreate || arraySpeciesCreate;
@@ -33,10 +34,10 @@ var createMethod = function (TYPE) {
33
34
  case 3: return true; // some
34
35
  case 5: return value; // find
35
36
  case 6: return index; // findIndex
36
- case 2: push.call(target, value); // filter
37
+ case 2: push(target, value); // filter
37
38
  } else switch (TYPE) {
38
39
  case 4: return false; // every
39
- case 7: push.call(target, value); // filterReject
40
+ case 7: push(target, value); // filterReject
40
41
  }
41
42
  }
42
43
  }
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  /* eslint-disable es/no-array-prototype-lastindexof -- safe */
3
+ var apply = require('../internals/function-apply');
3
4
  var toIndexedObject = require('../internals/to-indexed-object');
4
5
  var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
5
6
  var lengthOfArrayLike = require('../internals/length-of-array-like');
@@ -15,7 +16,7 @@ var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
15
16
  // https://tc39.es/ecma262/#sec-array.prototype.lastindexof
16
17
  module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
17
18
  // convert -0 to +0
18
- if (NEGATIVE_ZERO) return $lastIndexOf.apply(this, arguments) || 0;
19
+ if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0;
19
20
  var O = toIndexedObject(this);
20
21
  var length = lengthOfArrayLike(O);
21
22
  var index = length - 1;