core-js 3.18.1 → 3.19.1

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 (361) hide show
  1. package/configurator.js +7 -3
  2. package/es/date/to-primitive.js +2 -3
  3. package/es/date/to-string.js +2 -4
  4. package/es/instance/at.js +6 -5
  5. package/es/instance/bind.js +3 -2
  6. package/es/instance/code-point-at.js +4 -3
  7. package/es/instance/concat.js +3 -2
  8. package/es/instance/copy-within.js +3 -2
  9. package/es/instance/ends-with.js +4 -3
  10. package/es/instance/entries.js +3 -2
  11. package/es/instance/every.js +3 -2
  12. package/es/instance/fill.js +3 -2
  13. package/es/instance/filter.js +3 -2
  14. package/es/instance/find-index.js +3 -2
  15. package/es/instance/find.js +3 -2
  16. package/es/instance/flags.js +2 -1
  17. package/es/instance/flat-map.js +3 -2
  18. package/es/instance/flat.js +3 -2
  19. package/es/instance/for-each.js +3 -2
  20. package/es/instance/includes.js +6 -5
  21. package/es/instance/index-of.js +3 -2
  22. package/es/instance/keys.js +3 -2
  23. package/es/instance/last-index-of.js +3 -2
  24. package/es/instance/map.js +3 -2
  25. package/es/instance/match-all.js +4 -3
  26. package/es/instance/pad-end.js +4 -3
  27. package/es/instance/pad-start.js +4 -3
  28. package/es/instance/reduce-right.js +3 -2
  29. package/es/instance/reduce.js +3 -2
  30. package/es/instance/repeat.js +4 -3
  31. package/es/instance/replace-all.js +4 -3
  32. package/es/instance/reverse.js +3 -2
  33. package/es/instance/slice.js +3 -2
  34. package/es/instance/some.js +3 -2
  35. package/es/instance/sort.js +3 -2
  36. package/es/instance/splice.js +3 -2
  37. package/es/instance/starts-with.js +4 -3
  38. package/es/instance/trim-end.js +4 -3
  39. package/es/instance/trim-left.js +4 -3
  40. package/es/instance/trim-right.js +4 -3
  41. package/es/instance/trim-start.js +4 -3
  42. package/es/instance/trim.js +4 -3
  43. package/es/instance/values.js +3 -2
  44. package/es/json/stringify.js +4 -3
  45. package/es/promise/all-settled.js +2 -1
  46. package/es/promise/any.js +2 -1
  47. package/es/regexp/flags.js +3 -4
  48. package/es/regexp/match.js +2 -1
  49. package/es/regexp/replace.js +2 -1
  50. package/es/regexp/search.js +2 -1
  51. package/es/regexp/split.js +2 -1
  52. package/es/regexp/test.js +2 -3
  53. package/es/regexp/to-string.js +2 -3
  54. package/es/string/iterator.js +2 -5
  55. package/features/instance/at.js +6 -5
  56. package/features/instance/code-points.js +4 -3
  57. package/features/instance/filter-out.js +3 -2
  58. package/features/instance/filter-reject.js +3 -2
  59. package/features/instance/find-last-index.js +3 -2
  60. package/features/instance/find-last.js +3 -2
  61. package/features/instance/group-by.js +3 -2
  62. package/features/instance/unique-by.js +3 -2
  63. package/features/map/from.js +3 -2
  64. package/features/map/group-by.js +2 -1
  65. package/features/map/key-by.js +2 -1
  66. package/features/map/of.js +3 -2
  67. package/features/promise/try.js +2 -1
  68. package/features/set/from.js +3 -2
  69. package/features/set/of.js +3 -2
  70. package/features/typed-array/methods.js +2 -0
  71. package/features/weak-map/from.js +3 -2
  72. package/features/weak-map/of.js +3 -2
  73. package/features/weak-set/from.js +3 -2
  74. package/features/weak-set/of.js +3 -2
  75. package/internals/a-callable.js +3 -0
  76. package/internals/a-constructor.js +3 -0
  77. package/internals/a-possible-prototype.js +5 -1
  78. package/internals/an-instance.js +8 -3
  79. package/internals/an-object.js +4 -0
  80. package/internals/array-buffer-native.js +1 -1
  81. package/internals/array-buffer-non-extensible.js +10 -0
  82. package/internals/array-buffer-view-core.js +11 -10
  83. package/internals/array-buffer.js +31 -18
  84. package/internals/array-copy-within.js +2 -2
  85. package/internals/array-fill.js +2 -2
  86. package/internals/array-from-async.js +14 -9
  87. package/internals/array-from.js +8 -4
  88. package/internals/array-group-by.js +8 -5
  89. package/internals/array-includes.js +2 -2
  90. package/internals/array-iteration-from-last.js +3 -3
  91. package/internals/array-iteration.js +7 -6
  92. package/internals/array-last-index-of.js +6 -5
  93. package/internals/array-reduce.js +5 -2
  94. package/internals/array-slice.js +3 -0
  95. package/internals/array-sort.js +10 -11
  96. package/internals/array-species-constructor.js +2 -0
  97. package/internals/array-unique-by.js +15 -11
  98. package/internals/async-from-sync-iterator.js +4 -3
  99. package/internals/async-iterator-create-proxy.js +4 -3
  100. package/internals/async-iterator-iteration.js +5 -2
  101. package/internals/classof-raw.js +5 -2
  102. package/internals/classof.js +3 -0
  103. package/internals/clear-error-stack.js +20 -0
  104. package/internals/collection-add-all.js +3 -2
  105. package/internals/collection-delete-all.js +3 -2
  106. package/internals/collection-from.js +7 -4
  107. package/internals/collection-of.js +3 -4
  108. package/internals/collection-strong.js +11 -9
  109. package/internals/collection-weak.js +13 -9
  110. package/internals/collection.js +8 -7
  111. package/internals/composite-key.js +9 -2
  112. package/internals/copy-constructor-properties.js +2 -2
  113. package/internals/create-html.js +3 -1
  114. package/internals/date-to-iso-string.js +23 -13
  115. package/internals/date-to-primitive.js +3 -0
  116. package/internals/define-iterator.js +2 -1
  117. package/internals/define-well-known-symbol.js +2 -2
  118. package/internals/engine-v8-version.js +10 -4
  119. package/internals/entry-unbind.js +3 -5
  120. package/internals/error-stack-installable.js +10 -0
  121. package/internals/export.js +1 -1
  122. package/internals/fix-regexp-well-known-symbol-logic.js +5 -3
  123. package/internals/flatten-into-array.js +8 -4
  124. package/internals/function-apply.js +9 -0
  125. package/internals/function-bind-context.js +5 -17
  126. package/internals/function-bind.js +15 -9
  127. package/internals/function-call.js +5 -0
  128. package/internals/function-name.js +2 -2
  129. package/internals/function-uncurry-this.js +12 -0
  130. package/internals/get-async-iterator.js +2 -1
  131. package/internals/get-iterator.js +7 -2
  132. package/internals/get-map-iterator.js +3 -1
  133. package/internals/get-set-iterator.js +3 -1
  134. package/internals/get-substitution.js +10 -7
  135. package/internals/has-own-property.js +10 -0
  136. package/internals/host-report-errors.js +1 -1
  137. package/internals/ieee754.js +4 -1
  138. package/internals/indexed-object.js +5 -2
  139. package/internals/inspect-source.js +3 -2
  140. package/internals/install-error-cause.js +1 -1
  141. package/internals/internal-metadata.js +8 -11
  142. package/internals/internal-state.js +13 -11
  143. package/internals/is-callable.js +1 -1
  144. package/internals/is-constructor.js +6 -4
  145. package/internals/is-data-descriptor.js +2 -2
  146. package/internals/is-integral-number.js +10 -0
  147. package/internals/is-iterable.js +4 -2
  148. package/internals/is-object.js +1 -1
  149. package/internals/is-symbol.js +6 -2
  150. package/internals/iterate.js +16 -8
  151. package/internals/iterator-close.js +2 -1
  152. package/internals/iterator-create-proxy.js +4 -3
  153. package/internals/length-of-array-like.js +7 -0
  154. package/internals/map-emplace.js +8 -3
  155. package/internals/map-upsert.js +12 -4
  156. package/internals/math-scale.js +9 -12
  157. package/internals/microtask.js +6 -4
  158. package/internals/normalize-string-argument.js +5 -0
  159. package/internals/not-a-regexp.js +3 -0
  160. package/internals/number-parse-float.js +8 -6
  161. package/internals/number-parse-int.js +4 -2
  162. package/internals/numeric-range-iterator.js +4 -0
  163. package/internals/object-assign.js +5 -2
  164. package/internals/object-define-properties.js +3 -1
  165. package/internals/object-define-property.js +2 -0
  166. package/internals/object-get-own-property-descriptor.js +3 -2
  167. package/internals/object-get-own-property-names-external.js +4 -4
  168. package/internals/object-get-prototype-of.js +4 -3
  169. package/internals/object-is-extensible.js +16 -0
  170. package/internals/object-is-prototype-of.js +3 -0
  171. package/internals/object-iterator.js +2 -2
  172. package/internals/object-keys-internal.js +7 -4
  173. package/internals/object-set-prototype-of.js +4 -3
  174. package/internals/object-to-array.js +7 -3
  175. package/internals/ordinary-to-primitive.js +7 -3
  176. package/internals/own-keys.js +4 -1
  177. package/internals/redefine.js +2 -2
  178. package/internals/reflect-metadata.js +9 -3
  179. package/internals/regexp-exec-abstract.js +6 -2
  180. package/internals/regexp-exec.js +19 -14
  181. package/internals/require-object-coercible.js +4 -0
  182. package/internals/set-global.js +4 -2
  183. package/internals/set-to-string-tag.js +2 -2
  184. package/internals/shared.js +1 -1
  185. package/internals/string-multibyte.js +15 -7
  186. package/internals/string-pad.js +7 -4
  187. package/internals/string-punycode-to-ascii.js +26 -14
  188. package/internals/string-repeat.js +5 -2
  189. package/internals/string-trim.js +4 -2
  190. package/internals/task.js +11 -11
  191. package/internals/this-number-value.js +2 -4
  192. package/internals/to-absolute-index.js +2 -2
  193. package/internals/to-index.js +5 -2
  194. package/internals/to-integer-or-infinity.js +10 -0
  195. package/internals/to-length.js +2 -2
  196. package/internals/to-object.js +3 -0
  197. package/internals/to-offset.js +3 -0
  198. package/internals/to-positive-integer.js +5 -2
  199. package/internals/to-primitive.js +4 -1
  200. package/internals/to-property-key.js +1 -1
  201. package/internals/to-string.js +3 -0
  202. package/internals/try-to-string.js +4 -0
  203. package/internals/typed-array-constructor.js +18 -14
  204. package/internals/typed-array-from.js +6 -5
  205. package/internals/uid.js +4 -1
  206. package/internals/well-known-symbol.js +8 -4
  207. package/modules/es.aggregate-error.js +29 -12
  208. package/modules/es.array-buffer.slice.js +8 -4
  209. package/modules/es.array.at.js +4 -4
  210. package/modules/es.array.concat.js +4 -2
  211. package/modules/es.array.flat-map.js +2 -2
  212. package/modules/es.array.flat.js +4 -4
  213. package/modules/es.array.index-of.js +7 -5
  214. package/modules/es.array.join.js +3 -2
  215. package/modules/es.array.of.js +3 -1
  216. package/modules/es.array.reduce.js +2 -1
  217. package/modules/es.array.reverse.js +3 -2
  218. package/modules/es.array.slice.js +6 -4
  219. package/modules/es.array.sort.js +9 -6
  220. package/modules/es.array.splice.js +6 -4
  221. package/modules/es.date.get-year.js +3 -2
  222. package/modules/es.date.now.js +6 -1
  223. package/modules/es.date.set-year.js +8 -6
  224. package/modules/es.date.to-primitive.js +2 -1
  225. package/modules/es.date.to-string.js +5 -4
  226. package/modules/es.escape.js +12 -5
  227. package/modules/es.function.has-instance.js +3 -2
  228. package/modules/es.function.name.js +4 -2
  229. package/modules/es.json.stringify.js +18 -7
  230. package/modules/es.map.js +1 -1
  231. package/modules/es.number.constructor.js +25 -19
  232. package/modules/es.number.is-integer.js +2 -2
  233. package/modules/es.number.is-safe-integer.js +2 -2
  234. package/modules/es.number.to-fixed.js +21 -15
  235. package/modules/es.number.to-precision.js +6 -5
  236. package/modules/es.object.has-own.js +1 -1
  237. package/modules/es.object.is-extensible.js +4 -10
  238. package/modules/es.object.is-frozen.js +6 -2
  239. package/modules/es.object.is-sealed.js +6 -2
  240. package/modules/es.promise.all-settled.js +2 -2
  241. package/modules/es.promise.any.js +5 -4
  242. package/modules/es.promise.js +22 -18
  243. package/modules/es.reflect.apply.js +4 -10
  244. package/modules/es.reflect.construct.js +10 -5
  245. package/modules/es.reflect.get.js +2 -1
  246. package/modules/es.reflect.is-extensible.js +2 -4
  247. package/modules/es.reflect.set.js +2 -1
  248. package/modules/es.regexp.constructor.js +25 -16
  249. package/modules/es.regexp.dot-all.js +5 -1
  250. package/modules/es.regexp.flags.js +4 -2
  251. package/modules/es.regexp.sticky.js +5 -1
  252. package/modules/es.regexp.test.js +7 -3
  253. package/modules/es.regexp.to-string.js +8 -5
  254. package/modules/es.set.js +1 -1
  255. package/modules/es.string.at-alternative.js +7 -5
  256. package/modules/es.string.ends-with.js +7 -5
  257. package/modules/es.string.from-code-point.js +7 -4
  258. package/modules/es.string.includes.js +8 -2
  259. package/modules/es.string.match-all.js +25 -19
  260. package/modules/es.string.match.js +2 -1
  261. package/modules/es.string.raw.js +9 -8
  262. package/modules/es.string.replace-all.js +19 -13
  263. package/modules/es.string.replace.js +21 -14
  264. package/modules/es.string.search.js +2 -1
  265. package/modules/es.string.split.js +23 -16
  266. package/modules/es.string.starts-with.js +6 -4
  267. package/modules/es.string.substr.js +6 -5
  268. package/modules/es.symbol.description.js +22 -14
  269. package/modules/es.symbol.js +47 -33
  270. package/modules/es.typed-array.at.js +4 -4
  271. package/modules/es.typed-array.copy-within.js +4 -2
  272. package/modules/es.typed-array.fill.js +9 -2
  273. package/modules/es.typed-array.iterator.js +7 -6
  274. package/modules/es.typed-array.join.js +3 -3
  275. package/modules/es.typed-array.last-index-of.js +3 -2
  276. package/modules/es.typed-array.reduce-right.js +2 -1
  277. package/modules/es.typed-array.reduce.js +2 -1
  278. package/modules/es.typed-array.set.js +4 -2
  279. package/modules/es.typed-array.slice.js +2 -2
  280. package/modules/es.typed-array.sort.js +13 -28
  281. package/modules/es.typed-array.to-locale-string.js +7 -2
  282. package/modules/es.typed-array.to-string.js +3 -2
  283. package/modules/es.unescape.js +14 -9
  284. package/modules/es.weak-map.js +15 -15
  285. package/modules/esnext.array.is-template-object.js +1 -1
  286. package/modules/esnext.array.last-index.js +2 -2
  287. package/modules/esnext.array.last-item.js +3 -3
  288. package/modules/esnext.async-iterator.as-indexed-pairs.js +2 -1
  289. package/modules/esnext.async-iterator.constructor.js +4 -4
  290. package/modules/esnext.async-iterator.drop.js +2 -1
  291. package/modules/esnext.async-iterator.filter.js +2 -1
  292. package/modules/esnext.async-iterator.flat-map.js +3 -2
  293. package/modules/esnext.async-iterator.from.js +4 -4
  294. package/modules/esnext.async-iterator.map.js +2 -1
  295. package/modules/esnext.async-iterator.reduce.js +4 -1
  296. package/modules/esnext.async-iterator.take.js +4 -2
  297. package/modules/esnext.composite-key.js +5 -1
  298. package/modules/esnext.composite-symbol.js +3 -2
  299. package/modules/esnext.iterator.as-indexed-pairs.js +2 -1
  300. package/modules/esnext.iterator.constructor.js +4 -4
  301. package/modules/esnext.iterator.drop.js +4 -2
  302. package/modules/esnext.iterator.filter.js +2 -1
  303. package/modules/esnext.iterator.flat-map.js +7 -3
  304. package/modules/esnext.iterator.from.js +4 -4
  305. package/modules/esnext.iterator.map.js +2 -1
  306. package/modules/esnext.iterator.reduce.js +3 -0
  307. package/modules/esnext.iterator.take.js +2 -1
  308. package/modules/esnext.map.delete-all.js +2 -4
  309. package/modules/esnext.map.emplace.js +2 -2
  310. package/modules/esnext.map.every.js +1 -1
  311. package/modules/esnext.map.filter.js +5 -4
  312. package/modules/esnext.map.find-key.js +1 -1
  313. package/modules/esnext.map.find.js +1 -1
  314. package/modules/esnext.map.group-by.js +6 -2
  315. package/modules/esnext.map.includes.js +1 -1
  316. package/modules/esnext.map.key-by.js +2 -1
  317. package/modules/esnext.map.map-keys.js +5 -4
  318. package/modules/esnext.map.map-values.js +5 -4
  319. package/modules/esnext.map.reduce.js +3 -0
  320. package/modules/esnext.map.some.js +1 -1
  321. package/modules/esnext.map.update-or-insert.js +2 -2
  322. package/modules/esnext.map.update.js +11 -4
  323. package/modules/esnext.map.upsert.js +2 -2
  324. package/modules/esnext.math.seeded-prng.js +3 -1
  325. package/modules/esnext.number.from-string.js +14 -5
  326. package/modules/esnext.observable.js +14 -9
  327. package/modules/esnext.reflect.get-metadata-keys.js +5 -10
  328. package/modules/esnext.set.add-all.js +2 -4
  329. package/modules/esnext.set.delete-all.js +2 -4
  330. package/modules/esnext.set.difference.js +3 -2
  331. package/modules/esnext.set.every.js +1 -1
  332. package/modules/esnext.set.filter.js +4 -3
  333. package/modules/esnext.set.find.js +1 -1
  334. package/modules/esnext.set.intersection.js +3 -2
  335. package/modules/esnext.set.is-disjoint-from.js +3 -2
  336. package/modules/esnext.set.is-subset-of.js +3 -2
  337. package/modules/esnext.set.is-superset-of.js +3 -2
  338. package/modules/esnext.set.join.js +9 -4
  339. package/modules/esnext.set.map.js +5 -4
  340. package/modules/esnext.set.reduce.js +3 -0
  341. package/modules/esnext.set.some.js +1 -1
  342. package/modules/esnext.set.symmetric-difference.js +3 -2
  343. package/modules/esnext.typed-array.from-async.js +9 -3
  344. package/modules/esnext.typed-array.unique-by.js +4 -2
  345. package/modules/esnext.weak-map.delete-all.js +2 -4
  346. package/modules/esnext.weak-map.emplace.js +2 -2
  347. package/modules/esnext.weak-map.upsert.js +2 -2
  348. package/modules/esnext.weak-set.add-all.js +2 -4
  349. package/modules/esnext.weak-set.delete-all.js +2 -4
  350. package/modules/web.timers.js +5 -4
  351. package/modules/web.url-search-params.js +63 -54
  352. package/modules/web.url.js +110 -96
  353. package/modules/web.url.to-json.js +2 -1
  354. package/package.json +2 -2
  355. package/stable/instance/entries.js +6 -4
  356. package/stable/instance/for-each.js +6 -4
  357. package/stable/instance/keys.js +6 -4
  358. package/stable/instance/values.js +6 -4
  359. package/internals/has.js +0 -7
  360. package/internals/is-integer.js +0 -9
  361. package/internals/to-integer.js +0 -8
@@ -5,12 +5,16 @@ var $ = require('../internals/export');
5
5
  var DESCRIPTORS = require('../internals/descriptors');
6
6
  var USE_NATIVE_URL = require('../internals/native-url');
7
7
  var global = require('../internals/global');
8
+ var bind = require('../internals/function-bind-context');
9
+ var call = require('../internals/function-call');
10
+ var uncurryThis = require('../internals/function-uncurry-this');
8
11
  var defineProperties = require('../internals/object-define-properties');
9
12
  var redefine = require('../internals/redefine');
10
13
  var anInstance = require('../internals/an-instance');
11
- var has = require('../internals/has');
14
+ var hasOwn = require('../internals/has-own-property');
12
15
  var assign = require('../internals/object-assign');
13
16
  var arrayFrom = require('../internals/array-from');
17
+ var arraySlice = require('../internals/array-slice');
14
18
  var codeAt = require('../internals/string-multibyte').codeAt;
15
19
  var toASCII = require('../internals/string-punycode-to-ascii');
16
20
  var $toString = require('../internals/to-string');
@@ -18,27 +22,42 @@ var setToStringTag = require('../internals/set-to-string-tag');
18
22
  var URLSearchParamsModule = require('../modules/web.url-search-params');
19
23
  var InternalStateModule = require('../internals/internal-state');
20
24
 
21
- var NativeURL = global.URL;
22
- var URLSearchParams = URLSearchParamsModule.URLSearchParams;
23
- var getInternalSearchParamsState = URLSearchParamsModule.getState;
24
25
  var setInternalState = InternalStateModule.set;
25
26
  var getInternalURLState = InternalStateModule.getterFor('URL');
27
+ var URLSearchParams = URLSearchParamsModule.URLSearchParams;
28
+ var getInternalSearchParamsState = URLSearchParamsModule.getState;
29
+
30
+ var NativeURL = global.URL;
31
+ var TypeError = global.TypeError;
32
+ var parseInt = global.parseInt;
26
33
  var floor = Math.floor;
27
34
  var pow = Math.pow;
35
+ var charAt = uncurryThis(''.charAt);
36
+ var exec = uncurryThis(/./.exec);
37
+ var join = uncurryThis([].join);
38
+ var numberToString = uncurryThis(1.0.toString);
39
+ var pop = uncurryThis([].pop);
40
+ var push = uncurryThis([].push);
41
+ var replace = uncurryThis(''.replace);
42
+ var shift = uncurryThis([].shift);
43
+ var split = uncurryThis(''.split);
44
+ var stringSlice = uncurryThis(''.slice);
45
+ var toLowerCase = uncurryThis(''.toLowerCase);
46
+ var unshift = uncurryThis([].unshift);
28
47
 
29
48
  var INVALID_AUTHORITY = 'Invalid authority';
30
49
  var INVALID_SCHEME = 'Invalid scheme';
31
50
  var INVALID_HOST = 'Invalid host';
32
51
  var INVALID_PORT = 'Invalid port';
33
52
 
34
- var ALPHA = /[A-Za-z]/;
53
+ var ALPHA = /[a-z]/i;
35
54
  // eslint-disable-next-line regexp/no-obscure-range -- safe
36
- var ALPHANUMERIC = /[\d+-.A-Za-z]/;
55
+ var ALPHANUMERIC = /[\d+-.a-z]/i;
37
56
  var DIGIT = /\d/;
38
57
  var HEX_START = /^0x/i;
39
58
  var OCT = /^[0-7]+$/;
40
59
  var DEC = /^\d+$/;
41
- var HEX = /^[\dA-Fa-f]+$/;
60
+ var HEX = /^[\da-f]+$/i;
42
61
  /* eslint-disable regexp/no-control-character -- safe */
43
62
  var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
44
63
  var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
@@ -49,14 +68,14 @@ var EOF;
49
68
 
50
69
  var parseHost = function (url, input) {
51
70
  var result, codePoints, index;
52
- if (input.charAt(0) == '[') {
53
- if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
54
- result = parseIPv6(input.slice(1, -1));
71
+ if (charAt(input, 0) == '[') {
72
+ if (charAt(input, input.length - 1) != ']') return INVALID_HOST;
73
+ result = parseIPv6(stringSlice(input, 1, -1));
55
74
  if (!result) return INVALID_HOST;
56
75
  url.host = result;
57
76
  // opaque host
58
77
  } else if (!isSpecial(url)) {
59
- if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
78
+ if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
60
79
  result = '';
61
80
  codePoints = arrayFrom(input);
62
81
  for (index = 0; index < codePoints.length; index++) {
@@ -65,7 +84,7 @@ var parseHost = function (url, input) {
65
84
  url.host = result;
66
85
  } else {
67
86
  input = toASCII(input);
68
- if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
87
+ if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
69
88
  result = parseIPv4(input);
70
89
  if (result === null) return INVALID_HOST;
71
90
  url.host = result;
@@ -73,10 +92,10 @@ var parseHost = function (url, input) {
73
92
  };
74
93
 
75
94
  var parseIPv4 = function (input) {
76
- var parts = input.split('.');
95
+ var parts = split(input, '.');
77
96
  var partsLength, numbers, index, part, radix, number, ipv4;
78
97
  if (parts.length && parts[parts.length - 1] == '') {
79
- parts.pop();
98
+ parts.length--;
80
99
  }
81
100
  partsLength = parts.length;
82
101
  if (partsLength > 4) return input;
@@ -85,17 +104,17 @@ var parseIPv4 = function (input) {
85
104
  part = parts[index];
86
105
  if (part == '') return input;
87
106
  radix = 10;
88
- if (part.length > 1 && part.charAt(0) == '0') {
89
- radix = HEX_START.test(part) ? 16 : 8;
90
- part = part.slice(radix == 8 ? 1 : 2);
107
+ if (part.length > 1 && charAt(part, 0) == '0') {
108
+ radix = exec(HEX_START, part) ? 16 : 8;
109
+ part = stringSlice(part, radix == 8 ? 1 : 2);
91
110
  }
92
111
  if (part === '') {
93
112
  number = 0;
94
113
  } else {
95
- if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
114
+ if (!exec(radix == 10 ? DEC : radix == 8 ? OCT : HEX, part)) return input;
96
115
  number = parseInt(part, radix);
97
116
  }
98
- numbers.push(number);
117
+ push(numbers, number);
99
118
  }
100
119
  for (index = 0; index < partsLength; index++) {
101
120
  number = numbers[index];
@@ -103,7 +122,7 @@ var parseIPv4 = function (input) {
103
122
  if (number >= pow(256, 5 - partsLength)) return null;
104
123
  } else if (number > 255) return null;
105
124
  }
106
- ipv4 = numbers.pop();
125
+ ipv4 = pop(numbers);
107
126
  for (index = 0; index < numbers.length; index++) {
108
127
  ipv4 += numbers[index] * pow(256, 3 - index);
109
128
  }
@@ -119,11 +138,11 @@ var parseIPv6 = function (input) {
119
138
  var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
120
139
 
121
140
  var chr = function () {
122
- return input.charAt(pointer);
141
+ return charAt(input, pointer);
123
142
  };
124
143
 
125
144
  if (chr() == ':') {
126
- if (input.charAt(1) != ':') return;
145
+ if (charAt(input, 1) != ':') return;
127
146
  pointer += 2;
128
147
  pieceIndex++;
129
148
  compress = pieceIndex;
@@ -138,7 +157,7 @@ var parseIPv6 = function (input) {
138
157
  continue;
139
158
  }
140
159
  value = length = 0;
141
- while (length < 4 && HEX.test(chr())) {
160
+ while (length < 4 && exec(HEX, chr())) {
142
161
  value = value * 16 + parseInt(chr(), 16);
143
162
  pointer++;
144
163
  length++;
@@ -154,8 +173,8 @@ var parseIPv6 = function (input) {
154
173
  if (chr() == '.' && numbersSeen < 4) pointer++;
155
174
  else return;
156
175
  }
157
- if (!DIGIT.test(chr())) return;
158
- while (DIGIT.test(chr())) {
176
+ if (!exec(DIGIT, chr())) return;
177
+ while (exec(DIGIT, chr())) {
159
178
  number = parseInt(chr(), 10);
160
179
  if (ipv4Piece === null) ipv4Piece = number;
161
180
  else if (ipv4Piece == 0) return;
@@ -219,9 +238,9 @@ var serializeHost = function (host) {
219
238
  if (typeof host == 'number') {
220
239
  result = [];
221
240
  for (index = 0; index < 4; index++) {
222
- result.unshift(host % 256);
241
+ unshift(result, host % 256);
223
242
  host = floor(host / 256);
224
- } return result.join('.');
243
+ } return join(result, '.');
225
244
  // ipv6
226
245
  } else if (typeof host == 'object') {
227
246
  result = '';
@@ -233,7 +252,7 @@ var serializeHost = function (host) {
233
252
  result += index ? ':' : '::';
234
253
  ignore0 = true;
235
254
  } else {
236
- result += host[index].toString(16);
255
+ result += numberToString(host[index], 16);
237
256
  if (index < 7) result += ':';
238
257
  }
239
258
  }
@@ -254,7 +273,7 @@ var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
254
273
 
255
274
  var percentEncode = function (chr, set) {
256
275
  var code = codeAt(chr, 0);
257
- return code > 0x20 && code < 0x7F && !has(set, chr) ? chr : encodeURIComponent(chr);
276
+ return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
258
277
  };
259
278
 
260
279
  var specialSchemes = {
@@ -267,7 +286,7 @@ var specialSchemes = {
267
286
  };
268
287
 
269
288
  var isSpecial = function (url) {
270
- return has(specialSchemes, url.scheme);
289
+ return hasOwn(specialSchemes, url.scheme);
271
290
  };
272
291
 
273
292
  var includesCredentials = function (url) {
@@ -280,15 +299,15 @@ var cannotHaveUsernamePasswordPort = function (url) {
280
299
 
281
300
  var isWindowsDriveLetter = function (string, normalized) {
282
301
  var second;
283
- return string.length == 2 && ALPHA.test(string.charAt(0))
284
- && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
302
+ return string.length == 2 && exec(ALPHA, charAt(string, 0))
303
+ && ((second = charAt(string, 1)) == ':' || (!normalized && second == '|'));
285
304
  };
286
305
 
287
306
  var startsWithWindowsDriveLetter = function (string) {
288
307
  var third;
289
- return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
308
+ return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (
290
309
  string.length == 2 ||
291
- ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
310
+ ((third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#')
292
311
  );
293
312
  };
294
313
 
@@ -296,16 +315,16 @@ var shortenURLsPath = function (url) {
296
315
  var path = url.path;
297
316
  var pathSize = path.length;
298
317
  if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
299
- path.pop();
318
+ path.length--;
300
319
  }
301
320
  };
302
321
 
303
322
  var isSingleDot = function (segment) {
304
- return segment === '.' || segment.toLowerCase() === '%2e';
323
+ return segment === '.' || toLowerCase(segment) === '%2e';
305
324
  };
306
325
 
307
326
  var isDoubleDot = function (segment) {
308
- segment = segment.toLowerCase();
327
+ segment = toLowerCase(segment);
309
328
  return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
310
329
  };
311
330
 
@@ -352,10 +371,10 @@ var parseURL = function (url, input, stateOverride, base) {
352
371
  url.query = null;
353
372
  url.fragment = null;
354
373
  url.cannotBeABaseURL = false;
355
- input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
374
+ input = replace(input, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
356
375
  }
357
376
 
358
- input = input.replace(TAB_AND_NEW_LINE, '');
377
+ input = replace(input, TAB_AND_NEW_LINE, '');
359
378
 
360
379
  codePoints = arrayFrom(input);
361
380
 
@@ -363,8 +382,8 @@ var parseURL = function (url, input, stateOverride, base) {
363
382
  chr = codePoints[pointer];
364
383
  switch (state) {
365
384
  case SCHEME_START:
366
- if (chr && ALPHA.test(chr)) {
367
- buffer += chr.toLowerCase();
385
+ if (chr && exec(ALPHA, chr)) {
386
+ buffer += toLowerCase(chr);
368
387
  state = SCHEME;
369
388
  } else if (!stateOverride) {
370
389
  state = NO_SCHEME;
@@ -373,11 +392,11 @@ var parseURL = function (url, input, stateOverride, base) {
373
392
  break;
374
393
 
375
394
  case SCHEME:
376
- if (chr && (ALPHANUMERIC.test(chr) || chr == '+' || chr == '-' || chr == '.')) {
377
- buffer += chr.toLowerCase();
395
+ if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) {
396
+ buffer += toLowerCase(chr);
378
397
  } else if (chr == ':') {
379
398
  if (stateOverride && (
380
- (isSpecial(url) != has(specialSchemes, buffer)) ||
399
+ (isSpecial(url) != hasOwn(specialSchemes, buffer)) ||
381
400
  (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
382
401
  (url.scheme == 'file' && !url.host)
383
402
  )) return;
@@ -398,7 +417,7 @@ var parseURL = function (url, input, stateOverride, base) {
398
417
  pointer++;
399
418
  } else {
400
419
  url.cannotBeABaseURL = true;
401
- url.path.push('');
420
+ push(url.path, '');
402
421
  state = CANNOT_BE_A_BASE_URL_PATH;
403
422
  }
404
423
  } else if (!stateOverride) {
@@ -413,7 +432,7 @@ var parseURL = function (url, input, stateOverride, base) {
413
432
  if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME;
414
433
  if (base.cannotBeABaseURL && chr == '#') {
415
434
  url.scheme = base.scheme;
416
- url.path = base.path.slice();
435
+ url.path = arraySlice(base.path);
417
436
  url.query = base.query;
418
437
  url.fragment = '';
419
438
  url.cannotBeABaseURL = true;
@@ -448,7 +467,7 @@ var parseURL = function (url, input, stateOverride, base) {
448
467
  url.password = base.password;
449
468
  url.host = base.host;
450
469
  url.port = base.port;
451
- url.path = base.path.slice();
470
+ url.path = arraySlice(base.path);
452
471
  url.query = base.query;
453
472
  } else if (chr == '/' || (chr == '\\' && isSpecial(url))) {
454
473
  state = RELATIVE_SLASH;
@@ -457,7 +476,7 @@ var parseURL = function (url, input, stateOverride, base) {
457
476
  url.password = base.password;
458
477
  url.host = base.host;
459
478
  url.port = base.port;
460
- url.path = base.path.slice();
479
+ url.path = arraySlice(base.path);
461
480
  url.query = '';
462
481
  state = QUERY;
463
482
  } else if (chr == '#') {
@@ -465,7 +484,7 @@ var parseURL = function (url, input, stateOverride, base) {
465
484
  url.password = base.password;
466
485
  url.host = base.host;
467
486
  url.port = base.port;
468
- url.path = base.path.slice();
487
+ url.path = arraySlice(base.path);
469
488
  url.query = base.query;
470
489
  url.fragment = '';
471
490
  state = FRAGMENT;
@@ -474,8 +493,8 @@ var parseURL = function (url, input, stateOverride, base) {
474
493
  url.password = base.password;
475
494
  url.host = base.host;
476
495
  url.port = base.port;
477
- url.path = base.path.slice();
478
- url.path.pop();
496
+ url.path = arraySlice(base.path);
497
+ url.path.length--;
479
498
  state = PATH;
480
499
  continue;
481
500
  } break;
@@ -496,7 +515,7 @@ var parseURL = function (url, input, stateOverride, base) {
496
515
 
497
516
  case SPECIAL_AUTHORITY_SLASHES:
498
517
  state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
499
- if (chr != '/' || buffer.charAt(pointer + 1) != '/') continue;
518
+ if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue;
500
519
  pointer++;
501
520
  break;
502
521
 
@@ -564,7 +583,7 @@ var parseURL = function (url, input, stateOverride, base) {
564
583
  } break;
565
584
 
566
585
  case PORT:
567
- if (DIGIT.test(chr)) {
586
+ if (exec(DIGIT, chr)) {
568
587
  buffer += chr;
569
588
  } else if (
570
589
  chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
@@ -589,23 +608,23 @@ var parseURL = function (url, input, stateOverride, base) {
589
608
  else if (base && base.scheme == 'file') {
590
609
  if (chr == EOF) {
591
610
  url.host = base.host;
592
- url.path = base.path.slice();
611
+ url.path = arraySlice(base.path);
593
612
  url.query = base.query;
594
613
  } else if (chr == '?') {
595
614
  url.host = base.host;
596
- url.path = base.path.slice();
615
+ url.path = arraySlice(base.path);
597
616
  url.query = '';
598
617
  state = QUERY;
599
618
  } else if (chr == '#') {
600
619
  url.host = base.host;
601
- url.path = base.path.slice();
620
+ url.path = arraySlice(base.path);
602
621
  url.query = base.query;
603
622
  url.fragment = '';
604
623
  state = FRAGMENT;
605
624
  } else {
606
- if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
625
+ if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
607
626
  url.host = base.host;
608
- url.path = base.path.slice();
627
+ url.path = arraySlice(base.path);
609
628
  shortenURLsPath(url);
610
629
  }
611
630
  state = PATH;
@@ -621,8 +640,8 @@ var parseURL = function (url, input, stateOverride, base) {
621
640
  state = FILE_HOST;
622
641
  break;
623
642
  }
624
- if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
625
- if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
643
+ if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
644
+ if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
626
645
  else url.host = base.host;
627
646
  }
628
647
  state = PATH;
@@ -671,23 +690,23 @@ var parseURL = function (url, input, stateOverride, base) {
671
690
  if (isDoubleDot(buffer)) {
672
691
  shortenURLsPath(url);
673
692
  if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
674
- url.path.push('');
693
+ push(url.path, '');
675
694
  }
676
695
  } else if (isSingleDot(buffer)) {
677
696
  if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
678
- url.path.push('');
697
+ push(url.path, '');
679
698
  }
680
699
  } else {
681
700
  if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
682
701
  if (url.host) url.host = '';
683
- buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
702
+ buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter
684
703
  }
685
- url.path.push(buffer);
704
+ push(url.path, buffer);
686
705
  }
687
706
  buffer = '';
688
707
  if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) {
689
708
  while (url.path.length > 1 && url.path[0] === '') {
690
- url.path.shift();
709
+ shift(url.path);
691
710
  }
692
711
  }
693
712
  if (chr == '?') {
@@ -734,14 +753,15 @@ var parseURL = function (url, input, stateOverride, base) {
734
753
  // `URL` constructor
735
754
  // https://url.spec.whatwg.org/#url-class
736
755
  var URLConstructor = function URL(url /* , base */) {
737
- var that = anInstance(this, URLConstructor, 'URL');
756
+ var that = anInstance(this, URLPrototype);
738
757
  var base = arguments.length > 1 ? arguments[1] : undefined;
739
758
  var urlString = $toString(url);
740
759
  var state = setInternalState(that, { type: 'URL' });
741
760
  var baseState, failure;
742
761
  if (base !== undefined) {
743
- if (base instanceof URLConstructor) baseState = getInternalURLState(base);
744
- else {
762
+ try {
763
+ baseState = getInternalURLState(base);
764
+ } catch (error) {
745
765
  failure = parseURL(baseState = {}, $toString(base));
746
766
  if (failure) throw TypeError(failure);
747
767
  }
@@ -752,21 +772,21 @@ var URLConstructor = function URL(url /* , base */) {
752
772
  var searchParamsState = getInternalSearchParamsState(searchParams);
753
773
  searchParamsState.updateSearchParams(state.query);
754
774
  searchParamsState.updateURL = function () {
755
- state.query = String(searchParams) || null;
775
+ state.query = $toString(searchParams) || null;
756
776
  };
757
777
  if (!DESCRIPTORS) {
758
- that.href = serializeURL.call(that);
759
- that.origin = getOrigin.call(that);
760
- that.protocol = getProtocol.call(that);
761
- that.username = getUsername.call(that);
762
- that.password = getPassword.call(that);
763
- that.host = getHost.call(that);
764
- that.hostname = getHostname.call(that);
765
- that.port = getPort.call(that);
766
- that.pathname = getPathname.call(that);
767
- that.search = getSearch.call(that);
768
- that.searchParams = getSearchParams.call(that);
769
- that.hash = getHash.call(that);
778
+ that.href = call(serializeURL, that);
779
+ that.origin = call(getOrigin, that);
780
+ that.protocol = call(getProtocol, that);
781
+ that.username = call(getUsername, that);
782
+ that.password = call(getPassword, that);
783
+ that.host = call(getHost, that);
784
+ that.hostname = call(getHostname, that);
785
+ that.port = call(getPort, that);
786
+ that.pathname = call(getPathname, that);
787
+ that.search = call(getSearch, that);
788
+ that.searchParams = call(getSearchParams, that);
789
+ that.hash = call(getHash, that);
770
790
  }
771
791
  };
772
792
 
@@ -791,7 +811,7 @@ var serializeURL = function () {
791
811
  output += serializeHost(host);
792
812
  if (port !== null) output += ':' + port;
793
813
  } else if (scheme == 'file') output += '//';
794
- output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
814
+ output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
795
815
  if (query !== null) output += '?' + query;
796
816
  if (fragment !== null) output += '#' + fragment;
797
817
  return output;
@@ -838,13 +858,13 @@ var getHostname = function () {
838
858
 
839
859
  var getPort = function () {
840
860
  var port = getInternalURLState(this).port;
841
- return port === null ? '' : String(port);
861
+ return port === null ? '' : $toString(port);
842
862
  };
843
863
 
844
864
  var getPathname = function () {
845
865
  var url = getInternalURLState(this);
846
866
  var path = url.path;
847
- return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
867
+ return url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
848
868
  };
849
869
 
850
870
  var getSearch = function () {
@@ -946,7 +966,7 @@ if (DESCRIPTORS) {
946
966
  if (search == '') {
947
967
  url.query = null;
948
968
  } else {
949
- if ('?' == search.charAt(0)) search = search.slice(1);
969
+ if ('?' == charAt(search, 0)) search = stringSlice(search, 1);
950
970
  url.query = '';
951
971
  parseURL(url, search, QUERY);
952
972
  }
@@ -964,7 +984,7 @@ if (DESCRIPTORS) {
964
984
  url.fragment = null;
965
985
  return;
966
986
  }
967
- if ('#' == hash.charAt(0)) hash = hash.slice(1);
987
+ if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1);
968
988
  url.fragment = '';
969
989
  parseURL(url, hash, FRAGMENT);
970
990
  })
@@ -974,13 +994,13 @@ if (DESCRIPTORS) {
974
994
  // `URL.prototype.toJSON` method
975
995
  // https://url.spec.whatwg.org/#dom-url-tojson
976
996
  redefine(URLPrototype, 'toJSON', function toJSON() {
977
- return serializeURL.call(this);
997
+ return call(serializeURL, this);
978
998
  }, { enumerable: true });
979
999
 
980
1000
  // `URL.prototype.toString` method
981
1001
  // https://url.spec.whatwg.org/#URL-stringification-behavior
982
1002
  redefine(URLPrototype, 'toString', function toString() {
983
- return serializeURL.call(this);
1003
+ return call(serializeURL, this);
984
1004
  }, { enumerable: true });
985
1005
 
986
1006
  if (NativeURL) {
@@ -988,16 +1008,10 @@ if (NativeURL) {
988
1008
  var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
989
1009
  // `URL.createObjectURL` method
990
1010
  // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
991
- // eslint-disable-next-line no-unused-vars -- required for `.length`
992
- if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
993
- return nativeCreateObjectURL.apply(NativeURL, arguments);
994
- });
1011
+ if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));
995
1012
  // `URL.revokeObjectURL` method
996
1013
  // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
997
- // eslint-disable-next-line no-unused-vars -- required for `.length`
998
- if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
999
- return nativeRevokeObjectURL.apply(NativeURL, arguments);
1000
- });
1014
+ if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));
1001
1015
  }
1002
1016
 
1003
1017
  setToStringTag(URLConstructor, 'URL');
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
+ var call = require('../internals/function-call');
3
4
 
4
5
  // `URL.prototype.toJSON` method
5
6
  // https://url.spec.whatwg.org/#dom-url-tojson
6
7
  $({ target: 'URL', proto: true, enumerable: true }, {
7
8
  toJSON: function toJSON() {
8
- return URL.prototype.toString.call(this);
9
+ return call(URL.prototype.toString, this);
9
10
  }
10
11
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js",
3
3
  "description": "Standard library",
4
- "version": "3.18.1",
4
+ "version": "3.19.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
@@ -54,5 +54,5 @@
54
54
  "scripts": {
55
55
  "postinstall": "node -e \"try{require('./postinstall')}catch(e){}\""
56
56
  },
57
- "gitHead": "1a347bdf0297884ed8d9e32e1971267c6d572822"
57
+ "gitHead": "1f16f36fa2807bbe793b9da852a110e6c6077693"
58
58
  }
@@ -1,6 +1,9 @@
1
1
  require('../../modules/web.dom-collections.iterator');
2
- var entries = require('../array/virtual/entries');
3
2
  var classof = require('../../internals/classof');
3
+ var hasOwn = require('../../internals/has-own-property');
4
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
5
+ var method = require('../array/virtual/entries');
6
+
4
7
  var ArrayPrototype = Array.prototype;
5
8
 
6
9
  var DOMIterables = {
@@ -10,7 +13,6 @@ var DOMIterables = {
10
13
 
11
14
  module.exports = function (it) {
12
15
  var own = it.entries;
13
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.entries)
14
- // eslint-disable-next-line no-prototype-builtins -- safe
15
- || DOMIterables.hasOwnProperty(classof(it)) ? entries : own;
16
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.entries)
17
+ || hasOwn(DOMIterables, classof(it)) ? method : own;
16
18
  };
@@ -1,6 +1,9 @@
1
1
  require('../../modules/web.dom-collections.iterator');
2
- var forEach = require('../array/virtual/for-each');
3
2
  var classof = require('../../internals/classof');
3
+ var hasOwn = require('../../internals/has-own-property');
4
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
5
+ var method = require('../array/virtual/for-each');
6
+
4
7
  var ArrayPrototype = Array.prototype;
5
8
 
6
9
  var DOMIterables = {
@@ -10,7 +13,6 @@ var DOMIterables = {
10
13
 
11
14
  module.exports = function (it) {
12
15
  var own = it.forEach;
13
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach)
14
- // eslint-disable-next-line no-prototype-builtins -- safe
15
- || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own;
16
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.forEach)
17
+ || hasOwn(DOMIterables, classof(it)) ? method : own;
16
18
  };
@@ -1,6 +1,9 @@
1
1
  require('../../modules/web.dom-collections.iterator');
2
- var keys = require('../array/virtual/keys');
3
2
  var classof = require('../../internals/classof');
3
+ var hasOwn = require('../../internals/has-own-property');
4
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
5
+ var method = require('../array/virtual/keys');
6
+
4
7
  var ArrayPrototype = Array.prototype;
5
8
 
6
9
  var DOMIterables = {
@@ -10,7 +13,6 @@ var DOMIterables = {
10
13
 
11
14
  module.exports = function (it) {
12
15
  var own = it.keys;
13
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.keys)
14
- // eslint-disable-next-line no-prototype-builtins -- safe
15
- || DOMIterables.hasOwnProperty(classof(it)) ? keys : own;
16
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
17
+ || hasOwn(DOMIterables, classof(it)) ? method : own;
16
18
  };
@@ -1,6 +1,9 @@
1
1
  require('../../modules/web.dom-collections.iterator');
2
- var values = require('../array/virtual/values');
3
2
  var classof = require('../../internals/classof');
3
+ var hasOwn = require('../../internals/has-own-property');
4
+ var isPrototypeOf = require('../../internals/object-is-prototype-of');
5
+ var method = require('../array/virtual/values');
6
+
4
7
  var ArrayPrototype = Array.prototype;
5
8
 
6
9
  var DOMIterables = {
@@ -10,7 +13,6 @@ var DOMIterables = {
10
13
 
11
14
  module.exports = function (it) {
12
15
  var own = it.values;
13
- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.values)
14
- // eslint-disable-next-line no-prototype-builtins -- safe
15
- || DOMIterables.hasOwnProperty(classof(it)) ? values : own;
16
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.values)
17
+ || hasOwn(DOMIterables, classof(it)) ? method : own;
16
18
  };