core-js 3.19.0 → 3.20.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 (964) hide show
  1. package/README.md +26 -16
  2. package/actual/README.md +1 -0
  3. package/actual/aggregate-error.js +3 -0
  4. package/actual/array/at.js +3 -0
  5. package/actual/array/concat.js +3 -0
  6. package/actual/array/copy-within.js +3 -0
  7. package/actual/array/entries.js +3 -0
  8. package/actual/array/every.js +3 -0
  9. package/actual/array/fill.js +3 -0
  10. package/actual/array/filter.js +3 -0
  11. package/actual/array/find-index.js +3 -0
  12. package/actual/array/find-last-index.js +4 -0
  13. package/actual/array/find-last.js +4 -0
  14. package/actual/array/find.js +3 -0
  15. package/actual/array/flat-map.js +3 -0
  16. package/actual/array/flat.js +3 -0
  17. package/actual/array/for-each.js +3 -0
  18. package/actual/array/from.js +3 -0
  19. package/actual/array/group-by-to-map.js +5 -0
  20. package/actual/array/group-by.js +4 -0
  21. package/actual/array/includes.js +3 -0
  22. package/actual/array/index-of.js +3 -0
  23. package/actual/array/index.js +8 -0
  24. package/actual/array/is-array.js +3 -0
  25. package/actual/array/iterator.js +3 -0
  26. package/actual/array/join.js +3 -0
  27. package/actual/array/keys.js +3 -0
  28. package/actual/array/last-index-of.js +3 -0
  29. package/actual/array/map.js +3 -0
  30. package/actual/array/of.js +3 -0
  31. package/actual/array/reduce-right.js +3 -0
  32. package/actual/array/reduce.js +3 -0
  33. package/actual/array/reverse.js +3 -0
  34. package/actual/array/slice.js +3 -0
  35. package/actual/array/some.js +3 -0
  36. package/actual/array/sort.js +3 -0
  37. package/actual/array/splice.js +3 -0
  38. package/actual/array/values.js +3 -0
  39. package/actual/array/virtual/at.js +3 -0
  40. package/actual/array/virtual/concat.js +3 -0
  41. package/actual/array/virtual/copy-within.js +3 -0
  42. package/actual/array/virtual/entries.js +3 -0
  43. package/actual/array/virtual/every.js +3 -0
  44. package/actual/array/virtual/fill.js +3 -0
  45. package/actual/array/virtual/filter.js +3 -0
  46. package/actual/array/virtual/find-index.js +3 -0
  47. package/actual/array/virtual/find-last-index.js +4 -0
  48. package/actual/array/virtual/find-last.js +4 -0
  49. package/actual/array/virtual/find.js +3 -0
  50. package/actual/array/virtual/flat-map.js +3 -0
  51. package/actual/array/virtual/flat.js +3 -0
  52. package/actual/array/virtual/for-each.js +3 -0
  53. package/actual/array/virtual/group-by-to-map.js +5 -0
  54. package/actual/array/virtual/group-by.js +4 -0
  55. package/actual/array/virtual/includes.js +3 -0
  56. package/actual/array/virtual/index-of.js +3 -0
  57. package/actual/array/virtual/index.js +8 -0
  58. package/actual/array/virtual/iterator.js +3 -0
  59. package/actual/array/virtual/join.js +3 -0
  60. package/actual/array/virtual/keys.js +3 -0
  61. package/actual/array/virtual/last-index-of.js +3 -0
  62. package/actual/array/virtual/map.js +3 -0
  63. package/actual/array/virtual/reduce-right.js +3 -0
  64. package/actual/array/virtual/reduce.js +3 -0
  65. package/actual/array/virtual/reverse.js +3 -0
  66. package/actual/array/virtual/slice.js +3 -0
  67. package/actual/array/virtual/some.js +3 -0
  68. package/actual/array/virtual/sort.js +3 -0
  69. package/actual/array/virtual/splice.js +3 -0
  70. package/actual/array/virtual/values.js +3 -0
  71. package/actual/array-buffer/constructor.js +3 -0
  72. package/actual/array-buffer/index.js +3 -0
  73. package/actual/array-buffer/is-view.js +3 -0
  74. package/actual/array-buffer/slice.js +3 -0
  75. package/actual/clear-immediate.js +3 -0
  76. package/actual/data-view/index.js +3 -0
  77. package/actual/date/get-year.js +3 -0
  78. package/actual/date/index.js +3 -0
  79. package/actual/date/now.js +3 -0
  80. package/actual/date/set-year.js +3 -0
  81. package/actual/date/to-gmt-string.js +3 -0
  82. package/actual/date/to-iso-string.js +3 -0
  83. package/actual/date/to-json.js +3 -0
  84. package/actual/date/to-primitive.js +3 -0
  85. package/actual/date/to-string.js +3 -0
  86. package/actual/dom-collections/for-each.js +3 -0
  87. package/actual/dom-collections/index.js +3 -0
  88. package/actual/dom-collections/iterator.js +3 -0
  89. package/actual/dom-exception/constructor.js +3 -0
  90. package/actual/dom-exception/index.js +3 -0
  91. package/actual/dom-exception/to-string-tag.js +3 -0
  92. package/actual/error/constructor.js +3 -0
  93. package/actual/error/index.js +3 -0
  94. package/actual/error/to-string.js +3 -0
  95. package/actual/escape.js +3 -0
  96. package/actual/function/bind.js +3 -0
  97. package/actual/function/has-instance.js +3 -0
  98. package/actual/function/index.js +3 -0
  99. package/actual/function/name.js +3 -0
  100. package/actual/function/virtual/bind.js +3 -0
  101. package/actual/function/virtual/index.js +3 -0
  102. package/actual/get-iterator-method.js +3 -0
  103. package/actual/get-iterator.js +3 -0
  104. package/actual/global-this.js +3 -0
  105. package/actual/index.js +4 -0
  106. package/actual/instance/at.js +3 -0
  107. package/actual/instance/bind.js +3 -0
  108. package/actual/instance/code-point-at.js +3 -0
  109. package/actual/instance/concat.js +3 -0
  110. package/actual/instance/copy-within.js +3 -0
  111. package/actual/instance/ends-with.js +3 -0
  112. package/actual/instance/entries.js +3 -0
  113. package/actual/instance/every.js +3 -0
  114. package/actual/instance/fill.js +3 -0
  115. package/actual/instance/filter.js +3 -0
  116. package/actual/instance/find-index.js +3 -0
  117. package/actual/instance/find-last-index.js +9 -0
  118. package/actual/instance/find-last.js +9 -0
  119. package/actual/instance/find.js +3 -0
  120. package/actual/instance/flags.js +3 -0
  121. package/actual/instance/flat-map.js +3 -0
  122. package/actual/instance/flat.js +3 -0
  123. package/actual/instance/for-each.js +3 -0
  124. package/actual/instance/group-by-to-map.js +9 -0
  125. package/actual/instance/group-by.js +9 -0
  126. package/actual/instance/includes.js +3 -0
  127. package/actual/instance/index-of.js +3 -0
  128. package/actual/instance/keys.js +3 -0
  129. package/actual/instance/last-index-of.js +3 -0
  130. package/actual/instance/map.js +3 -0
  131. package/actual/instance/match-all.js +3 -0
  132. package/actual/instance/pad-end.js +3 -0
  133. package/actual/instance/pad-start.js +3 -0
  134. package/actual/instance/reduce-right.js +3 -0
  135. package/actual/instance/reduce.js +3 -0
  136. package/actual/instance/repeat.js +3 -0
  137. package/actual/instance/replace-all.js +3 -0
  138. package/actual/instance/reverse.js +3 -0
  139. package/actual/instance/slice.js +3 -0
  140. package/actual/instance/some.js +3 -0
  141. package/actual/instance/sort.js +3 -0
  142. package/actual/instance/splice.js +3 -0
  143. package/actual/instance/starts-with.js +3 -0
  144. package/actual/instance/trim-end.js +3 -0
  145. package/actual/instance/trim-left.js +3 -0
  146. package/actual/instance/trim-right.js +3 -0
  147. package/actual/instance/trim-start.js +3 -0
  148. package/actual/instance/trim.js +3 -0
  149. package/actual/instance/values.js +3 -0
  150. package/actual/is-iterable.js +3 -0
  151. package/actual/json/index.js +3 -0
  152. package/actual/json/stringify.js +3 -0
  153. package/actual/json/to-string-tag.js +3 -0
  154. package/actual/map/index.js +3 -0
  155. package/actual/math/acosh.js +3 -0
  156. package/actual/math/asinh.js +3 -0
  157. package/actual/math/atanh.js +3 -0
  158. package/actual/math/cbrt.js +3 -0
  159. package/actual/math/clz32.js +3 -0
  160. package/actual/math/cosh.js +3 -0
  161. package/actual/math/expm1.js +3 -0
  162. package/actual/math/fround.js +3 -0
  163. package/actual/math/hypot.js +3 -0
  164. package/actual/math/imul.js +3 -0
  165. package/actual/math/index.js +3 -0
  166. package/actual/math/log10.js +3 -0
  167. package/actual/math/log1p.js +3 -0
  168. package/actual/math/log2.js +3 -0
  169. package/actual/math/sign.js +3 -0
  170. package/actual/math/sinh.js +3 -0
  171. package/actual/math/tanh.js +3 -0
  172. package/actual/math/to-string-tag.js +3 -0
  173. package/actual/math/trunc.js +3 -0
  174. package/actual/number/constructor.js +3 -0
  175. package/actual/number/epsilon.js +3 -0
  176. package/actual/number/index.js +3 -0
  177. package/actual/number/is-finite.js +3 -0
  178. package/actual/number/is-integer.js +3 -0
  179. package/actual/number/is-nan.js +3 -0
  180. package/actual/number/is-safe-integer.js +3 -0
  181. package/actual/number/max-safe-integer.js +3 -0
  182. package/actual/number/min-safe-integer.js +3 -0
  183. package/actual/number/parse-float.js +3 -0
  184. package/actual/number/parse-int.js +3 -0
  185. package/actual/number/to-exponential.js +3 -0
  186. package/actual/number/to-fixed.js +3 -0
  187. package/actual/number/to-precision.js +3 -0
  188. package/actual/number/virtual/index.js +3 -0
  189. package/actual/number/virtual/to-exponential.js +3 -0
  190. package/actual/number/virtual/to-fixed.js +3 -0
  191. package/actual/number/virtual/to-precision.js +3 -0
  192. package/actual/object/assign.js +3 -0
  193. package/actual/object/create.js +3 -0
  194. package/actual/object/define-getter.js +3 -0
  195. package/actual/object/define-properties.js +3 -0
  196. package/actual/object/define-property.js +3 -0
  197. package/actual/object/define-setter.js +3 -0
  198. package/actual/object/entries.js +3 -0
  199. package/actual/object/freeze.js +3 -0
  200. package/actual/object/from-entries.js +3 -0
  201. package/actual/object/get-own-property-descriptor.js +3 -0
  202. package/actual/object/get-own-property-descriptors.js +3 -0
  203. package/actual/object/get-own-property-names.js +3 -0
  204. package/actual/object/get-own-property-symbols.js +3 -0
  205. package/actual/object/get-prototype-of.js +3 -0
  206. package/actual/object/has-own.js +3 -0
  207. package/actual/object/index.js +3 -0
  208. package/actual/object/is-extensible.js +3 -0
  209. package/actual/object/is-frozen.js +3 -0
  210. package/actual/object/is-sealed.js +3 -0
  211. package/actual/object/is.js +3 -0
  212. package/actual/object/keys.js +3 -0
  213. package/actual/object/lookup-getter.js +3 -0
  214. package/actual/object/lookup-setter.js +3 -0
  215. package/actual/object/prevent-extensions.js +3 -0
  216. package/actual/object/seal.js +3 -0
  217. package/actual/object/set-prototype-of.js +3 -0
  218. package/actual/object/to-string.js +3 -0
  219. package/actual/object/values.js +3 -0
  220. package/actual/parse-float.js +3 -0
  221. package/actual/parse-int.js +3 -0
  222. package/actual/promise/all-settled.js +3 -0
  223. package/actual/promise/any.js +3 -0
  224. package/actual/promise/finally.js +3 -0
  225. package/actual/promise/index.js +3 -0
  226. package/actual/queue-microtask.js +3 -0
  227. package/actual/reflect/apply.js +3 -0
  228. package/actual/reflect/construct.js +3 -0
  229. package/actual/reflect/define-property.js +3 -0
  230. package/actual/reflect/delete-property.js +3 -0
  231. package/actual/reflect/get-own-property-descriptor.js +3 -0
  232. package/actual/reflect/get-prototype-of.js +3 -0
  233. package/actual/reflect/get.js +3 -0
  234. package/actual/reflect/has.js +3 -0
  235. package/actual/reflect/index.js +3 -0
  236. package/actual/reflect/is-extensible.js +3 -0
  237. package/actual/reflect/own-keys.js +3 -0
  238. package/actual/reflect/prevent-extensions.js +3 -0
  239. package/actual/reflect/set-prototype-of.js +3 -0
  240. package/actual/reflect/set.js +3 -0
  241. package/actual/reflect/to-string-tag.js +3 -0
  242. package/actual/regexp/constructor.js +3 -0
  243. package/actual/regexp/dot-all.js +3 -0
  244. package/actual/regexp/flags.js +3 -0
  245. package/actual/regexp/index.js +3 -0
  246. package/actual/regexp/match.js +3 -0
  247. package/actual/regexp/replace.js +3 -0
  248. package/actual/regexp/search.js +3 -0
  249. package/actual/regexp/split.js +3 -0
  250. package/actual/regexp/sticky.js +3 -0
  251. package/actual/regexp/test.js +3 -0
  252. package/actual/regexp/to-string.js +3 -0
  253. package/actual/set/index.js +3 -0
  254. package/actual/set-immediate.js +3 -0
  255. package/actual/set-interval.js +3 -0
  256. package/actual/set-timeout.js +3 -0
  257. package/actual/string/anchor.js +3 -0
  258. package/actual/string/at.js +3 -0
  259. package/actual/string/big.js +3 -0
  260. package/actual/string/blink.js +3 -0
  261. package/actual/string/bold.js +3 -0
  262. package/actual/string/code-point-at.js +3 -0
  263. package/actual/string/ends-with.js +3 -0
  264. package/actual/string/fixed.js +3 -0
  265. package/actual/string/fontcolor.js +3 -0
  266. package/actual/string/fontsize.js +3 -0
  267. package/actual/string/from-code-point.js +3 -0
  268. package/actual/string/includes.js +3 -0
  269. package/actual/string/index.js +3 -0
  270. package/actual/string/italics.js +3 -0
  271. package/actual/string/iterator.js +3 -0
  272. package/actual/string/link.js +3 -0
  273. package/actual/string/match-all.js +3 -0
  274. package/actual/string/match.js +3 -0
  275. package/actual/string/pad-end.js +3 -0
  276. package/actual/string/pad-start.js +3 -0
  277. package/actual/string/raw.js +3 -0
  278. package/actual/string/repeat.js +3 -0
  279. package/actual/string/replace-all.js +3 -0
  280. package/actual/string/replace.js +3 -0
  281. package/actual/string/search.js +3 -0
  282. package/actual/string/small.js +3 -0
  283. package/actual/string/split.js +3 -0
  284. package/actual/string/starts-with.js +3 -0
  285. package/actual/string/strike.js +3 -0
  286. package/actual/string/sub.js +3 -0
  287. package/actual/string/substr.js +3 -0
  288. package/actual/string/sup.js +3 -0
  289. package/actual/string/trim-end.js +3 -0
  290. package/actual/string/trim-left.js +3 -0
  291. package/actual/string/trim-right.js +3 -0
  292. package/actual/string/trim-start.js +3 -0
  293. package/actual/string/trim.js +3 -0
  294. package/actual/string/virtual/anchor.js +3 -0
  295. package/actual/string/virtual/at.js +3 -0
  296. package/actual/string/virtual/big.js +3 -0
  297. package/actual/string/virtual/blink.js +3 -0
  298. package/actual/string/virtual/bold.js +3 -0
  299. package/actual/string/virtual/code-point-at.js +3 -0
  300. package/actual/string/virtual/ends-with.js +3 -0
  301. package/actual/string/virtual/fixed.js +3 -0
  302. package/actual/string/virtual/fontcolor.js +3 -0
  303. package/actual/string/virtual/fontsize.js +3 -0
  304. package/actual/string/virtual/includes.js +3 -0
  305. package/actual/string/virtual/index.js +3 -0
  306. package/actual/string/virtual/italics.js +3 -0
  307. package/actual/string/virtual/iterator.js +3 -0
  308. package/actual/string/virtual/link.js +3 -0
  309. package/actual/string/virtual/match-all.js +3 -0
  310. package/actual/string/virtual/pad-end.js +3 -0
  311. package/actual/string/virtual/pad-start.js +3 -0
  312. package/actual/string/virtual/repeat.js +3 -0
  313. package/actual/string/virtual/replace-all.js +3 -0
  314. package/actual/string/virtual/small.js +3 -0
  315. package/actual/string/virtual/starts-with.js +3 -0
  316. package/actual/string/virtual/strike.js +3 -0
  317. package/actual/string/virtual/sub.js +3 -0
  318. package/actual/string/virtual/substr.js +3 -0
  319. package/actual/string/virtual/sup.js +3 -0
  320. package/actual/string/virtual/trim-end.js +3 -0
  321. package/actual/string/virtual/trim-left.js +3 -0
  322. package/actual/string/virtual/trim-right.js +3 -0
  323. package/actual/string/virtual/trim-start.js +3 -0
  324. package/actual/string/virtual/trim.js +3 -0
  325. package/actual/structured-clone.js +3 -0
  326. package/actual/symbol/async-iterator.js +3 -0
  327. package/actual/symbol/description.js +3 -0
  328. package/actual/symbol/for.js +3 -0
  329. package/actual/symbol/has-instance.js +3 -0
  330. package/actual/symbol/index.js +3 -0
  331. package/actual/symbol/is-concat-spreadable.js +3 -0
  332. package/actual/symbol/iterator.js +3 -0
  333. package/actual/symbol/key-for.js +3 -0
  334. package/actual/symbol/match-all.js +3 -0
  335. package/actual/symbol/match.js +3 -0
  336. package/actual/symbol/replace.js +3 -0
  337. package/actual/symbol/search.js +3 -0
  338. package/actual/symbol/species.js +3 -0
  339. package/actual/symbol/split.js +3 -0
  340. package/actual/symbol/to-primitive.js +3 -0
  341. package/actual/symbol/to-string-tag.js +3 -0
  342. package/actual/symbol/unscopables.js +3 -0
  343. package/actual/typed-array/at.js +3 -0
  344. package/actual/typed-array/copy-within.js +3 -0
  345. package/actual/typed-array/entries.js +3 -0
  346. package/actual/typed-array/every.js +3 -0
  347. package/actual/typed-array/fill.js +3 -0
  348. package/actual/typed-array/filter.js +3 -0
  349. package/actual/typed-array/find-index.js +3 -0
  350. package/actual/typed-array/find-last-index.js +1 -0
  351. package/actual/typed-array/find-last.js +1 -0
  352. package/actual/typed-array/find.js +3 -0
  353. package/actual/typed-array/float32-array.js +4 -0
  354. package/actual/typed-array/float64-array.js +4 -0
  355. package/actual/typed-array/for-each.js +3 -0
  356. package/actual/typed-array/from.js +3 -0
  357. package/actual/typed-array/includes.js +3 -0
  358. package/actual/typed-array/index-of.js +3 -0
  359. package/actual/typed-array/index.js +5 -0
  360. package/actual/typed-array/int16-array.js +4 -0
  361. package/actual/typed-array/int32-array.js +4 -0
  362. package/actual/typed-array/int8-array.js +4 -0
  363. package/actual/typed-array/iterator.js +3 -0
  364. package/actual/typed-array/join.js +3 -0
  365. package/actual/typed-array/keys.js +3 -0
  366. package/actual/typed-array/last-index-of.js +3 -0
  367. package/actual/typed-array/map.js +3 -0
  368. package/actual/typed-array/methods.js +5 -0
  369. package/actual/typed-array/of.js +3 -0
  370. package/actual/typed-array/reduce-right.js +3 -0
  371. package/actual/typed-array/reduce.js +3 -0
  372. package/actual/typed-array/reverse.js +3 -0
  373. package/actual/typed-array/set.js +3 -0
  374. package/actual/typed-array/slice.js +3 -0
  375. package/actual/typed-array/some.js +3 -0
  376. package/actual/typed-array/sort.js +3 -0
  377. package/actual/typed-array/subarray.js +3 -0
  378. package/actual/typed-array/to-locale-string.js +3 -0
  379. package/actual/typed-array/to-string.js +3 -0
  380. package/actual/typed-array/uint16-array.js +4 -0
  381. package/actual/typed-array/uint32-array.js +4 -0
  382. package/actual/typed-array/uint8-array.js +4 -0
  383. package/actual/typed-array/uint8-clamped-array.js +4 -0
  384. package/actual/typed-array/values.js +3 -0
  385. package/actual/unescape.js +3 -0
  386. package/actual/url/index.js +3 -0
  387. package/actual/url/to-json.js +3 -0
  388. package/actual/url-search-params/index.js +3 -0
  389. package/actual/weak-map/index.js +3 -0
  390. package/actual/weak-set/index.js +3 -0
  391. package/es/aggregate-error.js +2 -0
  392. package/es/array-buffer/constructor.js +1 -0
  393. package/es/data-view/index.js +2 -0
  394. package/es/error/constructor.js +4 -0
  395. package/es/error/index.js +5 -0
  396. package/es/error/to-string.js +4 -0
  397. package/es/index.js +4 -0
  398. package/es/number/index.js +1 -0
  399. package/es/number/to-exponential.js +4 -0
  400. package/es/number/virtual/index.js +1 -0
  401. package/es/number/virtual/to-exponential.js +4 -0
  402. package/es/typed-array/float32-array.js +2 -0
  403. package/es/typed-array/float64-array.js +2 -0
  404. package/es/typed-array/int16-array.js +2 -0
  405. package/es/typed-array/int32-array.js +2 -0
  406. package/es/typed-array/int8-array.js +2 -0
  407. package/es/typed-array/uint16-array.js +2 -0
  408. package/es/typed-array/uint32-array.js +2 -0
  409. package/es/typed-array/uint8-array.js +2 -0
  410. package/es/typed-array/uint8-clamped-array.js +2 -0
  411. package/features/aggregate-error.js +1 -1
  412. package/features/array/at.js +1 -1
  413. package/features/array/concat.js +1 -1
  414. package/features/array/copy-within.js +1 -1
  415. package/features/array/entries.js +1 -1
  416. package/features/array/every.js +1 -1
  417. package/features/array/fill.js +1 -1
  418. package/features/array/filter.js +1 -1
  419. package/features/array/find-index.js +1 -1
  420. package/features/array/find-last-index.js +2 -3
  421. package/features/array/find-last.js +2 -3
  422. package/features/array/find.js +1 -1
  423. package/features/array/flat-map.js +1 -1
  424. package/features/array/flat.js +1 -1
  425. package/features/array/for-each.js +1 -1
  426. package/features/array/from.js +1 -1
  427. package/features/array/group-by-to-map.js +3 -0
  428. package/features/array/group-by.js +2 -3
  429. package/features/array/includes.js +1 -1
  430. package/features/array/index-of.js +1 -1
  431. package/features/array/index.js +5 -5
  432. package/features/array/is-array.js +1 -1
  433. package/features/array/iterator.js +1 -1
  434. package/features/array/join.js +1 -1
  435. package/features/array/keys.js +1 -1
  436. package/features/array/last-index-of.js +1 -1
  437. package/features/array/map.js +1 -1
  438. package/features/array/of.js +1 -1
  439. package/features/array/reduce-right.js +1 -1
  440. package/features/array/reduce.js +1 -1
  441. package/features/array/reverse.js +1 -1
  442. package/features/array/slice.js +1 -1
  443. package/features/array/some.js +1 -1
  444. package/features/array/sort.js +1 -1
  445. package/features/array/splice.js +1 -1
  446. package/features/array/to-reversed.js +4 -0
  447. package/features/array/to-sorted.js +5 -0
  448. package/features/array/to-spliced.js +4 -0
  449. package/features/array/values.js +1 -1
  450. package/features/array/virtual/at.js +1 -1
  451. package/features/array/virtual/concat.js +1 -1
  452. package/features/array/virtual/copy-within.js +1 -1
  453. package/features/array/virtual/entries.js +1 -1
  454. package/features/array/virtual/every.js +1 -1
  455. package/features/array/virtual/fill.js +1 -1
  456. package/features/array/virtual/filter.js +1 -1
  457. package/features/array/virtual/find-index.js +1 -1
  458. package/features/array/virtual/find-last-index.js +2 -3
  459. package/features/array/virtual/find-last.js +2 -3
  460. package/features/array/virtual/find.js +1 -1
  461. package/features/array/virtual/flat-map.js +1 -1
  462. package/features/array/virtual/flat.js +1 -1
  463. package/features/array/virtual/for-each.js +1 -1
  464. package/features/array/virtual/group-by-to-map.js +3 -0
  465. package/features/array/virtual/group-by.js +2 -3
  466. package/features/array/virtual/includes.js +1 -1
  467. package/features/array/virtual/index-of.js +1 -1
  468. package/features/array/virtual/index.js +5 -5
  469. package/features/array/virtual/iterator.js +1 -1
  470. package/features/array/virtual/join.js +1 -1
  471. package/features/array/virtual/keys.js +1 -1
  472. package/features/array/virtual/last-index-of.js +1 -1
  473. package/features/array/virtual/map.js +1 -1
  474. package/features/array/virtual/reduce-right.js +1 -1
  475. package/features/array/virtual/reduce.js +1 -1
  476. package/features/array/virtual/reverse.js +1 -1
  477. package/features/array/virtual/slice.js +1 -1
  478. package/features/array/virtual/some.js +1 -1
  479. package/features/array/virtual/sort.js +1 -1
  480. package/features/array/virtual/splice.js +1 -1
  481. package/features/array/virtual/to-reversed.js +4 -0
  482. package/features/array/virtual/to-sorted.js +5 -0
  483. package/features/array/virtual/to-spliced.js +4 -0
  484. package/features/array/virtual/values.js +1 -1
  485. package/features/array/virtual/with.js +4 -0
  486. package/features/array/with.js +4 -0
  487. package/features/array-buffer/constructor.js +1 -1
  488. package/features/array-buffer/index.js +1 -1
  489. package/features/array-buffer/is-view.js +1 -1
  490. package/features/array-buffer/slice.js +1 -1
  491. package/features/clear-immediate.js +1 -1
  492. package/features/data-view/index.js +1 -1
  493. package/features/date/get-year.js +1 -1
  494. package/features/date/index.js +1 -1
  495. package/features/date/now.js +1 -1
  496. package/features/date/set-year.js +1 -1
  497. package/features/date/to-gmt-string.js +1 -1
  498. package/features/date/to-iso-string.js +1 -1
  499. package/features/date/to-json.js +1 -1
  500. package/features/date/to-primitive.js +1 -1
  501. package/features/date/to-string.js +1 -1
  502. package/features/dom-collections/for-each.js +1 -1
  503. package/features/dom-collections/index.js +1 -1
  504. package/features/dom-collections/iterator.js +1 -1
  505. package/features/dom-exception/constructor.js +3 -0
  506. package/features/dom-exception/index.js +3 -0
  507. package/features/dom-exception/to-string-tag.js +3 -0
  508. package/features/error/constructor.js +3 -0
  509. package/features/error/index.js +3 -0
  510. package/features/error/to-string.js +3 -0
  511. package/features/escape.js +1 -1
  512. package/features/function/bind.js +1 -1
  513. package/features/function/has-instance.js +1 -1
  514. package/features/function/index.js +4 -1
  515. package/features/function/is-callable.js +4 -0
  516. package/features/function/is-constructor.js +4 -0
  517. package/features/function/name.js +1 -1
  518. package/features/function/un-this.js +4 -0
  519. package/features/function/virtual/bind.js +1 -1
  520. package/features/function/virtual/index.js +2 -1
  521. package/features/function/virtual/un-this.js +4 -0
  522. package/features/get-iterator-method.js +1 -1
  523. package/features/get-iterator.js +1 -1
  524. package/features/global-this.js +1 -1
  525. package/features/index.js +22 -0
  526. package/features/instance/bind.js +1 -1
  527. package/features/instance/code-point-at.js +1 -1
  528. package/features/instance/concat.js +1 -1
  529. package/features/instance/copy-within.js +1 -1
  530. package/features/instance/ends-with.js +1 -1
  531. package/features/instance/entries.js +1 -1
  532. package/features/instance/every.js +1 -1
  533. package/features/instance/fill.js +1 -1
  534. package/features/instance/filter.js +1 -1
  535. package/features/instance/find-index.js +1 -1
  536. package/features/instance/find-last-index.js +2 -8
  537. package/features/instance/find-last.js +2 -8
  538. package/features/instance/find.js +1 -1
  539. package/features/instance/flags.js +1 -1
  540. package/features/instance/flat-map.js +1 -1
  541. package/features/instance/flat.js +1 -1
  542. package/features/instance/for-each.js +1 -1
  543. package/features/instance/group-by-to-map.js +3 -0
  544. package/features/instance/group-by.js +2 -8
  545. package/features/instance/includes.js +1 -1
  546. package/features/instance/index-of.js +1 -1
  547. package/features/instance/keys.js +1 -1
  548. package/features/instance/last-index-of.js +1 -1
  549. package/features/instance/map.js +1 -1
  550. package/features/instance/match-all.js +1 -1
  551. package/features/instance/pad-end.js +1 -1
  552. package/features/instance/pad-start.js +1 -1
  553. package/features/instance/reduce-right.js +1 -1
  554. package/features/instance/reduce.js +1 -1
  555. package/features/instance/repeat.js +1 -1
  556. package/features/instance/replace-all.js +1 -1
  557. package/features/instance/reverse.js +1 -1
  558. package/features/instance/slice.js +1 -1
  559. package/features/instance/some.js +1 -1
  560. package/features/instance/sort.js +1 -1
  561. package/features/instance/splice.js +1 -1
  562. package/features/instance/starts-with.js +1 -1
  563. package/features/instance/to-reversed.js +9 -0
  564. package/features/instance/to-sorted.js +9 -0
  565. package/features/instance/to-spliced.js +9 -0
  566. package/features/instance/trim-end.js +1 -1
  567. package/features/instance/trim-left.js +1 -1
  568. package/features/instance/trim-right.js +1 -1
  569. package/features/instance/trim-start.js +1 -1
  570. package/features/instance/trim.js +1 -1
  571. package/features/instance/un-this.js +9 -0
  572. package/features/instance/values.js +1 -1
  573. package/features/instance/with.js +9 -0
  574. package/features/is-iterable.js +1 -1
  575. package/features/iterator/index.js +2 -0
  576. package/features/iterator/to-async.js +8 -0
  577. package/features/json/index.js +1 -1
  578. package/features/json/stringify.js +1 -1
  579. package/features/json/to-string-tag.js +1 -1
  580. package/features/map/index.js +1 -1
  581. package/features/math/acosh.js +1 -1
  582. package/features/math/asinh.js +1 -1
  583. package/features/math/atanh.js +1 -1
  584. package/features/math/cbrt.js +1 -1
  585. package/features/math/clz32.js +1 -1
  586. package/features/math/cosh.js +1 -1
  587. package/features/math/expm1.js +1 -1
  588. package/features/math/fround.js +1 -1
  589. package/features/math/hypot.js +1 -1
  590. package/features/math/imul.js +1 -1
  591. package/features/math/index.js +1 -1
  592. package/features/math/log10.js +1 -1
  593. package/features/math/log1p.js +1 -1
  594. package/features/math/log2.js +1 -1
  595. package/features/math/sign.js +1 -1
  596. package/features/math/sinh.js +1 -1
  597. package/features/math/tanh.js +1 -1
  598. package/features/math/to-string-tag.js +1 -1
  599. package/features/math/trunc.js +1 -1
  600. package/features/number/constructor.js +1 -1
  601. package/features/number/epsilon.js +1 -1
  602. package/features/number/index.js +1 -1
  603. package/features/number/is-finite.js +1 -1
  604. package/features/number/is-integer.js +1 -1
  605. package/features/number/is-nan.js +1 -1
  606. package/features/number/is-safe-integer.js +1 -1
  607. package/features/number/max-safe-integer.js +1 -1
  608. package/features/number/min-safe-integer.js +1 -1
  609. package/features/number/parse-float.js +1 -1
  610. package/features/number/parse-int.js +1 -1
  611. package/features/number/to-exponential.js +3 -0
  612. package/features/number/to-fixed.js +1 -1
  613. package/features/number/to-precision.js +1 -1
  614. package/features/number/virtual/index.js +1 -1
  615. package/features/number/virtual/to-exponential.js +3 -0
  616. package/features/number/virtual/to-fixed.js +1 -1
  617. package/features/number/virtual/to-precision.js +1 -1
  618. package/features/object/assign.js +1 -1
  619. package/features/object/create.js +1 -1
  620. package/features/object/define-getter.js +1 -1
  621. package/features/object/define-properties.js +1 -1
  622. package/features/object/define-property.js +1 -1
  623. package/features/object/define-setter.js +1 -1
  624. package/features/object/entries.js +1 -1
  625. package/features/object/freeze.js +1 -1
  626. package/features/object/from-entries.js +1 -1
  627. package/features/object/get-own-property-descriptor.js +1 -1
  628. package/features/object/get-own-property-descriptors.js +1 -1
  629. package/features/object/get-own-property-names.js +1 -1
  630. package/features/object/get-own-property-symbols.js +1 -1
  631. package/features/object/get-prototype-of.js +1 -1
  632. package/features/object/has-own.js +1 -1
  633. package/features/object/index.js +1 -1
  634. package/features/object/is-extensible.js +1 -1
  635. package/features/object/is-frozen.js +1 -1
  636. package/features/object/is-sealed.js +1 -1
  637. package/features/object/is.js +1 -1
  638. package/features/object/keys.js +1 -1
  639. package/features/object/lookup-getter.js +1 -1
  640. package/features/object/lookup-setter.js +1 -1
  641. package/features/object/prevent-extensions.js +1 -1
  642. package/features/object/seal.js +1 -1
  643. package/features/object/set-prototype-of.js +1 -1
  644. package/features/object/to-string.js +1 -1
  645. package/features/object/values.js +1 -1
  646. package/features/parse-float.js +1 -1
  647. package/features/parse-int.js +1 -1
  648. package/features/promise/all-settled.js +1 -1
  649. package/features/promise/any.js +1 -1
  650. package/features/promise/finally.js +1 -1
  651. package/features/promise/index.js +1 -1
  652. package/features/queue-microtask.js +1 -1
  653. package/features/reflect/apply.js +1 -1
  654. package/features/reflect/construct.js +1 -1
  655. package/features/reflect/define-property.js +1 -1
  656. package/features/reflect/delete-property.js +1 -1
  657. package/features/reflect/get-own-property-descriptor.js +1 -1
  658. package/features/reflect/get-prototype-of.js +1 -1
  659. package/features/reflect/get.js +1 -1
  660. package/features/reflect/has.js +1 -1
  661. package/features/reflect/index.js +1 -1
  662. package/features/reflect/is-extensible.js +1 -1
  663. package/features/reflect/own-keys.js +1 -1
  664. package/features/reflect/prevent-extensions.js +1 -1
  665. package/features/reflect/set-prototype-of.js +1 -1
  666. package/features/reflect/set.js +1 -1
  667. package/features/regexp/constructor.js +1 -1
  668. package/features/regexp/dot-all.js +1 -1
  669. package/features/regexp/flags.js +1 -1
  670. package/features/regexp/index.js +1 -1
  671. package/features/regexp/match.js +1 -1
  672. package/features/regexp/replace.js +1 -1
  673. package/features/regexp/search.js +1 -1
  674. package/features/regexp/split.js +1 -1
  675. package/features/regexp/sticky.js +1 -1
  676. package/features/regexp/test.js +1 -1
  677. package/features/regexp/to-string.js +1 -1
  678. package/features/set/index.js +1 -1
  679. package/features/set-immediate.js +1 -1
  680. package/features/set-interval.js +1 -1
  681. package/features/set-timeout.js +1 -1
  682. package/features/string/anchor.js +1 -1
  683. package/features/string/at.js +1 -1
  684. package/features/string/big.js +1 -1
  685. package/features/string/blink.js +1 -1
  686. package/features/string/bold.js +1 -1
  687. package/features/string/code-point-at.js +1 -1
  688. package/features/string/cooked.js +4 -0
  689. package/features/string/ends-with.js +1 -1
  690. package/features/string/fixed.js +1 -1
  691. package/features/string/fontcolor.js +1 -1
  692. package/features/string/fontsize.js +1 -1
  693. package/features/string/from-code-point.js +1 -1
  694. package/features/string/includes.js +1 -1
  695. package/features/string/index.js +3 -3
  696. package/features/string/italics.js +1 -1
  697. package/features/string/iterator.js +1 -1
  698. package/features/string/link.js +1 -1
  699. package/features/string/match-all.js +1 -1
  700. package/features/string/match.js +1 -1
  701. package/features/string/pad-end.js +1 -1
  702. package/features/string/pad-start.js +1 -1
  703. package/features/string/raw.js +1 -1
  704. package/features/string/repeat.js +1 -1
  705. package/features/string/replace-all.js +1 -1
  706. package/features/string/replace.js +1 -1
  707. package/features/string/search.js +1 -1
  708. package/features/string/small.js +1 -1
  709. package/features/string/split.js +1 -1
  710. package/features/string/starts-with.js +1 -1
  711. package/features/string/strike.js +1 -1
  712. package/features/string/sub.js +1 -1
  713. package/features/string/substr.js +1 -1
  714. package/features/string/sup.js +1 -1
  715. package/features/string/trim-end.js +1 -1
  716. package/features/string/trim-left.js +1 -1
  717. package/features/string/trim-right.js +1 -1
  718. package/features/string/trim-start.js +1 -1
  719. package/features/string/trim.js +1 -1
  720. package/features/string/virtual/anchor.js +1 -1
  721. package/features/string/virtual/at.js +1 -1
  722. package/features/string/virtual/big.js +1 -1
  723. package/features/string/virtual/blink.js +1 -1
  724. package/features/string/virtual/bold.js +1 -1
  725. package/features/string/virtual/code-point-at.js +1 -1
  726. package/features/string/virtual/ends-with.js +1 -1
  727. package/features/string/virtual/fixed.js +1 -1
  728. package/features/string/virtual/fontcolor.js +1 -1
  729. package/features/string/virtual/fontsize.js +1 -1
  730. package/features/string/virtual/includes.js +1 -1
  731. package/features/string/virtual/index.js +1 -1
  732. package/features/string/virtual/italics.js +1 -1
  733. package/features/string/virtual/iterator.js +1 -1
  734. package/features/string/virtual/link.js +1 -1
  735. package/features/string/virtual/match-all.js +1 -1
  736. package/features/string/virtual/pad-end.js +1 -1
  737. package/features/string/virtual/pad-start.js +1 -1
  738. package/features/string/virtual/repeat.js +1 -1
  739. package/features/string/virtual/replace-all.js +1 -1
  740. package/features/string/virtual/small.js +1 -1
  741. package/features/string/virtual/starts-with.js +1 -1
  742. package/features/string/virtual/strike.js +1 -1
  743. package/features/string/virtual/sub.js +1 -1
  744. package/features/string/virtual/substr.js +1 -1
  745. package/features/string/virtual/sup.js +1 -1
  746. package/features/string/virtual/trim-end.js +1 -1
  747. package/features/string/virtual/trim-left.js +1 -1
  748. package/features/string/virtual/trim-right.js +1 -1
  749. package/features/string/virtual/trim-start.js +1 -1
  750. package/features/string/virtual/trim.js +1 -1
  751. package/features/structured-clone.js +3 -0
  752. package/features/symbol/async-iterator.js +1 -1
  753. package/features/symbol/for.js +1 -1
  754. package/features/symbol/has-instance.js +1 -1
  755. package/features/symbol/index.js +1 -1
  756. package/features/symbol/is-concat-spreadable.js +1 -1
  757. package/features/symbol/iterator.js +1 -1
  758. package/features/symbol/key-for.js +1 -1
  759. package/features/symbol/match-all.js +1 -1
  760. package/features/symbol/match.js +1 -1
  761. package/features/symbol/replace.js +1 -1
  762. package/features/symbol/search.js +1 -1
  763. package/features/symbol/species.js +1 -1
  764. package/features/symbol/split.js +1 -1
  765. package/features/symbol/to-primitive.js +1 -1
  766. package/features/symbol/to-string-tag.js +1 -1
  767. package/features/symbol/unscopables.js +1 -1
  768. package/features/typed-array/at.js +1 -1
  769. package/features/typed-array/copy-within.js +1 -1
  770. package/features/typed-array/entries.js +1 -1
  771. package/features/typed-array/every.js +1 -1
  772. package/features/typed-array/fill.js +1 -1
  773. package/features/typed-array/filter.js +1 -1
  774. package/features/typed-array/find-index.js +1 -1
  775. package/features/typed-array/find-last-index.js +3 -1
  776. package/features/typed-array/find-last.js +3 -1
  777. package/features/typed-array/find.js +1 -1
  778. package/features/typed-array/float32-array.js +1 -1
  779. package/features/typed-array/float64-array.js +1 -1
  780. package/features/typed-array/for-each.js +1 -1
  781. package/features/typed-array/from.js +1 -1
  782. package/features/typed-array/includes.js +1 -1
  783. package/features/typed-array/index-of.js +1 -1
  784. package/features/typed-array/index.js +5 -3
  785. package/features/typed-array/int16-array.js +1 -1
  786. package/features/typed-array/int32-array.js +1 -1
  787. package/features/typed-array/int8-array.js +1 -1
  788. package/features/typed-array/iterator.js +1 -1
  789. package/features/typed-array/join.js +1 -1
  790. package/features/typed-array/keys.js +1 -1
  791. package/features/typed-array/last-index-of.js +1 -1
  792. package/features/typed-array/map.js +1 -1
  793. package/features/typed-array/methods.js +5 -3
  794. package/features/typed-array/of.js +1 -1
  795. package/features/typed-array/reduce-right.js +1 -1
  796. package/features/typed-array/reduce.js +1 -1
  797. package/features/typed-array/reverse.js +1 -1
  798. package/features/typed-array/set.js +1 -1
  799. package/features/typed-array/slice.js +1 -1
  800. package/features/typed-array/some.js +1 -1
  801. package/features/typed-array/sort.js +1 -1
  802. package/features/typed-array/subarray.js +1 -1
  803. package/features/typed-array/to-locale-string.js +1 -1
  804. package/features/typed-array/to-reversed.js +1 -0
  805. package/features/typed-array/to-sorted.js +2 -0
  806. package/features/typed-array/to-spliced.js +1 -0
  807. package/features/typed-array/to-string.js +1 -1
  808. package/features/typed-array/uint16-array.js +1 -1
  809. package/features/typed-array/uint32-array.js +1 -1
  810. package/features/typed-array/uint8-array.js +1 -1
  811. package/features/typed-array/uint8-clamped-array.js +1 -1
  812. package/features/typed-array/values.js +1 -1
  813. package/features/typed-array/with.js +1 -0
  814. package/features/unescape.js +1 -1
  815. package/features/url/index.js +1 -1
  816. package/features/url/to-json.js +1 -1
  817. package/features/url-search-params/index.js +1 -1
  818. package/features/weak-map/index.js +1 -1
  819. package/features/weak-set/index.js +1 -1
  820. package/internals/array-buffer-non-extensible.js +10 -0
  821. package/internals/array-buffer-view-core.js +2 -2
  822. package/internals/array-buffer.js +1 -1
  823. package/internals/array-from-constructor-and-list.js +3 -1
  824. package/internals/array-group-by.js +1 -0
  825. package/internals/array-slice-simple.js +17 -0
  826. package/internals/array-sort.js +1 -1
  827. package/internals/array-to-reversed.js +11 -0
  828. package/internals/array-to-spliced.js +35 -0
  829. package/internals/array-with.js +18 -0
  830. package/internals/async-from-sync-iterator.js +3 -1
  831. package/internals/async-iterator-create-proxy.js +3 -1
  832. package/internals/clear-error-stack.js +1 -8
  833. package/internals/copy-constructor-properties.js +4 -2
  834. package/internals/create-iterator-constructor.js +2 -2
  835. package/internals/dom-exception-constants.js +27 -0
  836. package/internals/error-to-string.js +30 -0
  837. package/internals/ieee754.js +20 -5
  838. package/internals/internal-metadata.js +1 -5
  839. package/internals/is-constructor.js +12 -3
  840. package/internals/iterator-create-proxy.js +3 -1
  841. package/internals/math-log10.js +7 -0
  842. package/internals/object-get-own-property-names-external.js +1 -1
  843. package/internals/object-is-extensible.js +16 -0
  844. package/internals/regexp-exec.js +1 -2
  845. package/internals/regexp-sticky-helpers.js +14 -2
  846. package/internals/set-to-string-tag.js +4 -3
  847. package/internals/shared.js +1 -1
  848. package/internals/string-punycode-to-ascii.js +8 -6
  849. package/internals/try-node-require.js +8 -0
  850. package/internals/wrap-error-constructor-with-cause.js +60 -0
  851. package/modules/es.aggregate-error.cause.js +21 -0
  852. package/modules/es.aggregate-error.js +10 -4
  853. package/modules/es.array.iterator.js +9 -1
  854. package/modules/es.error.cause.js +56 -0
  855. package/modules/es.error.to-string.js +10 -0
  856. package/modules/es.function.name.js +1 -1
  857. package/modules/es.math.log10.js +2 -6
  858. package/modules/es.number.to-exponential.js +100 -0
  859. package/modules/es.number.to-fixed.js +1 -0
  860. package/modules/es.object.is-extensible.js +4 -10
  861. package/modules/es.object.is-frozen.js +6 -2
  862. package/modules/es.object.is-sealed.js +6 -2
  863. package/modules/es.promise.js +1 -1
  864. package/modules/es.reflect.is-extensible.js +2 -4
  865. package/modules/es.regexp.constructor.js +4 -3
  866. package/modules/es.regexp.sticky.js +2 -2
  867. package/modules/es.string.at-alternative.js +1 -1
  868. package/modules/es.string.split.js +1 -1
  869. package/modules/es.typed-array.iterator.js +14 -7
  870. package/modules/es.weak-map.js +1 -2
  871. package/modules/esnext.array.group-by-to-map.js +38 -0
  872. package/modules/esnext.array.group-by.js +1 -2
  873. package/modules/esnext.array.to-reversed.js +18 -0
  874. package/modules/esnext.array.to-sorted.js +25 -0
  875. package/modules/esnext.array.to-spliced.js +20 -0
  876. package/modules/esnext.array.with.js +15 -0
  877. package/modules/esnext.function.is-callable.js +29 -0
  878. package/modules/esnext.function.is-constructor.js +8 -0
  879. package/modules/esnext.function.un-this.js +11 -0
  880. package/modules/esnext.iterator.to-async.js +10 -0
  881. package/modules/esnext.observable.js +69 -54
  882. package/modules/esnext.string.at.js +10 -3
  883. package/modules/esnext.string.cooked.js +30 -0
  884. package/modules/esnext.typed-array.from-async.js +1 -0
  885. package/modules/esnext.typed-array.group-by.js +1 -0
  886. package/modules/esnext.typed-array.to-reversed.js +13 -0
  887. package/modules/esnext.typed-array.to-sorted.js +19 -0
  888. package/modules/esnext.typed-array.to-spliced.js +15 -0
  889. package/modules/esnext.typed-array.with.js +13 -0
  890. package/modules/web.dom-exception.constructor.js +141 -0
  891. package/modules/web.dom-exception.stack.js +58 -0
  892. package/modules/web.dom-exception.to-string-tag.js +6 -0
  893. package/modules/web.structured-clone.js +461 -0
  894. package/modules/web.url-search-params.js +76 -67
  895. package/modules/web.url.js +612 -590
  896. package/package.json +2 -2
  897. package/proposals/accessible-object-hasownproperty.js +0 -1
  898. package/proposals/array-flat-map.js +5 -0
  899. package/proposals/array-from-async.js +1 -0
  900. package/proposals/array-grouping.js +2 -0
  901. package/proposals/array-includes.js +3 -0
  902. package/proposals/array-is-template-object.js +1 -0
  903. package/proposals/array-last.js +1 -0
  904. package/proposals/async-iteration.js +2 -0
  905. package/proposals/change-array-by-copy.js +9 -0
  906. package/proposals/collection-methods.js +1 -0
  907. package/proposals/collection-of-from.js +1 -0
  908. package/proposals/efficient-64-bit-arithmetic.js +1 -0
  909. package/proposals/error-cause.js +3 -0
  910. package/proposals/function-is-callable-is-constructor.js +3 -0
  911. package/proposals/function-un-this.js +2 -0
  912. package/proposals/global-this.js +1 -0
  913. package/proposals/index.js +1 -0
  914. package/proposals/iterator-helpers.js +2 -0
  915. package/proposals/keys-composition.js +1 -0
  916. package/proposals/map-update-or-insert.js +1 -0
  917. package/proposals/map-upsert.js +1 -1
  918. package/proposals/math-extensions.js +1 -0
  919. package/proposals/math-signbit.js +1 -0
  920. package/proposals/number-from-string.js +1 -0
  921. package/proposals/object-from-entries.js +2 -0
  922. package/proposals/object-getownpropertydescriptors.js +2 -0
  923. package/proposals/object-iteration.js +1 -0
  924. package/proposals/object-values-entries.js +3 -0
  925. package/proposals/observable.js +1 -0
  926. package/proposals/promise-all-settled.js +1 -1
  927. package/proposals/promise-any.js +1 -0
  928. package/proposals/promise-finally.js +2 -0
  929. package/proposals/promise-try.js +1 -0
  930. package/proposals/reflect-metadata.js +1 -0
  931. package/proposals/regexp-dotall-flag.js +5 -0
  932. package/proposals/regexp-named-groups.js +4 -0
  933. package/proposals/relative-indexing-method.js +0 -1
  934. package/proposals/seeded-random.js +1 -0
  935. package/proposals/set-methods.js +1 -0
  936. package/proposals/string-at.js +1 -0
  937. package/proposals/string-code-points.js +1 -0
  938. package/proposals/string-cooked.js +2 -0
  939. package/proposals/string-left-right-trim.js +3 -0
  940. package/proposals/string-match-all.js +1 -1
  941. package/proposals/string-padding.js +3 -0
  942. package/proposals/string-replace-all.js +1 -0
  943. package/proposals/symbol-description.js +2 -0
  944. package/proposals/url.js +1 -0
  945. package/proposals/well-formed-stringify.js +2 -0
  946. package/stable/dom-exception/constructor.js +6 -0
  947. package/stable/dom-exception/index.js +7 -0
  948. package/stable/dom-exception/to-string-tag.js +3 -0
  949. package/stable/error/constructor.js +3 -0
  950. package/stable/error/index.js +3 -0
  951. package/stable/error/to-string.js +3 -0
  952. package/stable/index.js +8 -0
  953. package/stable/number/to-exponential.js +3 -0
  954. package/stable/number/virtual/to-exponential.js +3 -0
  955. package/stable/structured-clone.js +13 -0
  956. package/stable/symbol/description.js +3 -1
  957. package/stage/0.js +2 -0
  958. package/stage/1.js +1 -2
  959. package/stage/2.js +2 -0
  960. package/stage/3.js +1 -0
  961. package/stage/4.js +2 -0
  962. package/web/dom-exception.js +7 -0
  963. package/web/index.js +4 -0
  964. package/web/structured-clone.js +8 -0
@@ -6,7 +6,6 @@ var DESCRIPTORS = require('../internals/descriptors');
6
6
  var USE_NATIVE_URL = require('../internals/native-url');
7
7
  var global = require('../internals/global');
8
8
  var bind = require('../internals/function-bind-context');
9
- var call = require('../internals/function-call');
10
9
  var uncurryThis = require('../internals/function-uncurry-this');
11
10
  var defineProperties = require('../internals/object-define-properties');
12
11
  var redefine = require('../internals/redefine');
@@ -14,7 +13,7 @@ var anInstance = require('../internals/an-instance');
14
13
  var hasOwn = require('../internals/has-own-property');
15
14
  var assign = require('../internals/object-assign');
16
15
  var arrayFrom = require('../internals/array-from');
17
- var arraySlice = require('../internals/array-slice');
16
+ var arraySlice = require('../internals/array-slice-simple');
18
17
  var codeAt = require('../internals/string-multibyte').codeAt;
19
18
  var toASCII = require('../internals/string-punycode-to-ascii');
20
19
  var $toString = require('../internals/to-string');
@@ -66,31 +65,7 @@ var TAB_AND_NEW_LINE = /[\t\n\r]/g;
66
65
  /* eslint-enable regexp/no-control-character -- safe */
67
66
  var EOF;
68
67
 
69
- var parseHost = function (url, input) {
70
- var result, codePoints, index;
71
- if (charAt(input, 0) == '[') {
72
- if (charAt(input, input.length - 1) != ']') return INVALID_HOST;
73
- result = parseIPv6(stringSlice(input, 1, -1));
74
- if (!result) return INVALID_HOST;
75
- url.host = result;
76
- // opaque host
77
- } else if (!isSpecial(url)) {
78
- if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
79
- result = '';
80
- codePoints = arrayFrom(input);
81
- for (index = 0; index < codePoints.length; index++) {
82
- result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
83
- }
84
- url.host = result;
85
- } else {
86
- input = toASCII(input);
87
- if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
88
- result = parseIPv4(input);
89
- if (result === null) return INVALID_HOST;
90
- url.host = result;
91
- }
92
- };
93
-
68
+ // https://url.spec.whatwg.org/#ipv4-number-parser
94
69
  var parseIPv4 = function (input) {
95
70
  var parts = split(input, '.');
96
71
  var partsLength, numbers, index, part, radix, number, ipv4;
@@ -129,6 +104,7 @@ var parseIPv4 = function (input) {
129
104
  return ipv4;
130
105
  };
131
106
 
107
+ // https://url.spec.whatwg.org/#concept-ipv6-parser
132
108
  // eslint-disable-next-line max-statements -- TODO
133
109
  var parseIPv6 = function (input) {
134
110
  var address = [0, 0, 0, 0, 0, 0, 0, 0];
@@ -232,6 +208,7 @@ var findLongestZeroSequence = function (ipv6) {
232
208
  return maxIndex;
233
209
  };
234
210
 
211
+ // https://url.spec.whatwg.org/#host-serializing
235
212
  var serializeHost = function (host) {
236
213
  var result, index, compress, ignore0;
237
214
  // ipv4
@@ -276,6 +253,7 @@ var percentEncode = function (chr, set) {
276
253
  return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
277
254
  };
278
255
 
256
+ // https://url.spec.whatwg.org/#special-scheme
279
257
  var specialSchemes = {
280
258
  ftp: 21,
281
259
  file: null,
@@ -285,24 +263,14 @@ var specialSchemes = {
285
263
  wss: 443
286
264
  };
287
265
 
288
- var isSpecial = function (url) {
289
- return hasOwn(specialSchemes, url.scheme);
290
- };
291
-
292
- var includesCredentials = function (url) {
293
- return url.username != '' || url.password != '';
294
- };
295
-
296
- var cannotHaveUsernamePasswordPort = function (url) {
297
- return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
298
- };
299
-
266
+ // https://url.spec.whatwg.org/#windows-drive-letter
300
267
  var isWindowsDriveLetter = function (string, normalized) {
301
268
  var second;
302
269
  return string.length == 2 && exec(ALPHA, charAt(string, 0))
303
270
  && ((second = charAt(string, 1)) == ':' || (!normalized && second == '|'));
304
271
  };
305
272
 
273
+ // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter
306
274
  var startsWithWindowsDriveLetter = function (string) {
307
275
  var third;
308
276
  return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (
@@ -311,18 +279,12 @@ var startsWithWindowsDriveLetter = function (string) {
311
279
  );
312
280
  };
313
281
 
314
- var shortenURLsPath = function (url) {
315
- var path = url.path;
316
- var pathSize = path.length;
317
- if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
318
- path.length--;
319
- }
320
- };
321
-
282
+ // https://url.spec.whatwg.org/#single-dot-path-segment
322
283
  var isSingleDot = function (segment) {
323
284
  return segment === '.' || toLowerCase(segment) === '%2e';
324
285
  };
325
286
 
287
+ // https://url.spec.whatwg.org/#double-dot-path-segment
326
288
  var isDoubleDot = function (segment) {
327
289
  segment = toLowerCase(segment);
328
290
  return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
@@ -351,402 +313,625 @@ var CANNOT_BE_A_BASE_URL_PATH = {};
351
313
  var QUERY = {};
352
314
  var FRAGMENT = {};
353
315
 
354
- // eslint-disable-next-line max-statements -- TODO
355
- var parseURL = function (url, input, stateOverride, base) {
356
- var state = stateOverride || SCHEME_START;
357
- var pointer = 0;
358
- var buffer = '';
359
- var seenAt = false;
360
- var seenBracket = false;
361
- var seenPasswordToken = false;
362
- var codePoints, chr, bufferCodePoints, failure;
363
-
364
- if (!stateOverride) {
365
- url.scheme = '';
366
- url.username = '';
367
- url.password = '';
368
- url.host = null;
369
- url.port = null;
370
- url.path = [];
371
- url.query = null;
372
- url.fragment = null;
373
- url.cannotBeABaseURL = false;
374
- input = replace(input, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
316
+ var URLState = function (url, isBase, base) {
317
+ var urlString = $toString(url);
318
+ var baseState, failure, searchParams;
319
+ if (isBase) {
320
+ failure = this.parse(urlString);
321
+ if (failure) throw TypeError(failure);
322
+ this.searchParams = null;
323
+ } else {
324
+ if (base !== undefined) baseState = new URLState(base, true);
325
+ failure = this.parse(urlString, null, baseState);
326
+ if (failure) throw TypeError(failure);
327
+ searchParams = getInternalSearchParamsState(new URLSearchParams());
328
+ searchParams.bindURL(this);
329
+ this.searchParams = searchParams;
375
330
  }
331
+ };
376
332
 
377
- input = replace(input, TAB_AND_NEW_LINE, '');
333
+ URLState.prototype = {
334
+ type: 'URL',
335
+ // https://url.spec.whatwg.org/#url-parsing
336
+ // eslint-disable-next-line max-statements -- TODO
337
+ parse: function (input, stateOverride, base) {
338
+ var url = this;
339
+ var state = stateOverride || SCHEME_START;
340
+ var pointer = 0;
341
+ var buffer = '';
342
+ var seenAt = false;
343
+ var seenBracket = false;
344
+ var seenPasswordToken = false;
345
+ var codePoints, chr, bufferCodePoints, failure;
346
+
347
+ input = $toString(input);
348
+
349
+ if (!stateOverride) {
350
+ url.scheme = '';
351
+ url.username = '';
352
+ url.password = '';
353
+ url.host = null;
354
+ url.port = null;
355
+ url.path = [];
356
+ url.query = null;
357
+ url.fragment = null;
358
+ url.cannotBeABaseURL = false;
359
+ input = replace(input, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
360
+ }
378
361
 
379
- codePoints = arrayFrom(input);
362
+ input = replace(input, TAB_AND_NEW_LINE, '');
380
363
 
381
- while (pointer <= codePoints.length) {
382
- chr = codePoints[pointer];
383
- switch (state) {
384
- case SCHEME_START:
385
- if (chr && exec(ALPHA, chr)) {
386
- buffer += toLowerCase(chr);
387
- state = SCHEME;
388
- } else if (!stateOverride) {
389
- state = NO_SCHEME;
390
- continue;
391
- } else return INVALID_SCHEME;
392
- break;
393
-
394
- case SCHEME:
395
- if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) {
396
- buffer += toLowerCase(chr);
397
- } else if (chr == ':') {
398
- if (stateOverride && (
399
- (isSpecial(url) != hasOwn(specialSchemes, buffer)) ||
400
- (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
401
- (url.scheme == 'file' && !url.host)
402
- )) return;
403
- url.scheme = buffer;
404
- if (stateOverride) {
405
- if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
406
- return;
407
- }
408
- buffer = '';
409
- if (url.scheme == 'file') {
410
- state = FILE;
411
- } else if (isSpecial(url) && base && base.scheme == url.scheme) {
412
- state = SPECIAL_RELATIVE_OR_AUTHORITY;
413
- } else if (isSpecial(url)) {
414
- state = SPECIAL_AUTHORITY_SLASHES;
415
- } else if (codePoints[pointer + 1] == '/') {
416
- state = PATH_OR_AUTHORITY;
417
- pointer++;
418
- } else {
419
- url.cannotBeABaseURL = true;
420
- push(url.path, '');
421
- state = CANNOT_BE_A_BASE_URL_PATH;
422
- }
423
- } else if (!stateOverride) {
424
- buffer = '';
425
- state = NO_SCHEME;
426
- pointer = 0;
427
- continue;
428
- } else return INVALID_SCHEME;
429
- break;
364
+ codePoints = arrayFrom(input);
430
365
 
431
- case NO_SCHEME:
432
- if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME;
433
- if (base.cannotBeABaseURL && chr == '#') {
434
- url.scheme = base.scheme;
435
- url.path = arraySlice(base.path);
436
- url.query = base.query;
437
- url.fragment = '';
438
- url.cannotBeABaseURL = true;
439
- state = FRAGMENT;
366
+ while (pointer <= codePoints.length) {
367
+ chr = codePoints[pointer];
368
+ switch (state) {
369
+ case SCHEME_START:
370
+ if (chr && exec(ALPHA, chr)) {
371
+ buffer += toLowerCase(chr);
372
+ state = SCHEME;
373
+ } else if (!stateOverride) {
374
+ state = NO_SCHEME;
375
+ continue;
376
+ } else return INVALID_SCHEME;
440
377
  break;
441
- }
442
- state = base.scheme == 'file' ? FILE : RELATIVE;
443
- continue;
444
378
 
445
- case SPECIAL_RELATIVE_OR_AUTHORITY:
446
- if (chr == '/' && codePoints[pointer + 1] == '/') {
447
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
448
- pointer++;
449
- } else {
450
- state = RELATIVE;
451
- continue;
452
- } break;
453
-
454
- case PATH_OR_AUTHORITY:
455
- if (chr == '/') {
456
- state = AUTHORITY;
379
+ case SCHEME:
380
+ if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) {
381
+ buffer += toLowerCase(chr);
382
+ } else if (chr == ':') {
383
+ if (stateOverride && (
384
+ (url.isSpecial() != hasOwn(specialSchemes, buffer)) ||
385
+ (buffer == 'file' && (url.includesCredentials() || url.port !== null)) ||
386
+ (url.scheme == 'file' && !url.host)
387
+ )) return;
388
+ url.scheme = buffer;
389
+ if (stateOverride) {
390
+ if (url.isSpecial() && specialSchemes[url.scheme] == url.port) url.port = null;
391
+ return;
392
+ }
393
+ buffer = '';
394
+ if (url.scheme == 'file') {
395
+ state = FILE;
396
+ } else if (url.isSpecial() && base && base.scheme == url.scheme) {
397
+ state = SPECIAL_RELATIVE_OR_AUTHORITY;
398
+ } else if (url.isSpecial()) {
399
+ state = SPECIAL_AUTHORITY_SLASHES;
400
+ } else if (codePoints[pointer + 1] == '/') {
401
+ state = PATH_OR_AUTHORITY;
402
+ pointer++;
403
+ } else {
404
+ url.cannotBeABaseURL = true;
405
+ push(url.path, '');
406
+ state = CANNOT_BE_A_BASE_URL_PATH;
407
+ }
408
+ } else if (!stateOverride) {
409
+ buffer = '';
410
+ state = NO_SCHEME;
411
+ pointer = 0;
412
+ continue;
413
+ } else return INVALID_SCHEME;
457
414
  break;
458
- } else {
459
- state = PATH;
460
- continue;
461
- }
462
-
463
- case RELATIVE:
464
- url.scheme = base.scheme;
465
- if (chr == EOF) {
466
- url.username = base.username;
467
- url.password = base.password;
468
- url.host = base.host;
469
- url.port = base.port;
470
- url.path = arraySlice(base.path);
471
- url.query = base.query;
472
- } else if (chr == '/' || (chr == '\\' && isSpecial(url))) {
473
- state = RELATIVE_SLASH;
474
- } else if (chr == '?') {
475
- url.username = base.username;
476
- url.password = base.password;
477
- url.host = base.host;
478
- url.port = base.port;
479
- url.path = arraySlice(base.path);
480
- url.query = '';
481
- state = QUERY;
482
- } else if (chr == '#') {
483
- url.username = base.username;
484
- url.password = base.password;
485
- url.host = base.host;
486
- url.port = base.port;
487
- url.path = arraySlice(base.path);
488
- url.query = base.query;
489
- url.fragment = '';
490
- state = FRAGMENT;
491
- } else {
492
- url.username = base.username;
493
- url.password = base.password;
494
- url.host = base.host;
495
- url.port = base.port;
496
- url.path = arraySlice(base.path);
497
- url.path.length--;
498
- state = PATH;
499
- continue;
500
- } break;
501
415
 
502
- case RELATIVE_SLASH:
503
- if (isSpecial(url) && (chr == '/' || chr == '\\')) {
504
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
505
- } else if (chr == '/') {
506
- state = AUTHORITY;
507
- } else {
508
- url.username = base.username;
509
- url.password = base.password;
510
- url.host = base.host;
511
- url.port = base.port;
512
- state = PATH;
416
+ case NO_SCHEME:
417
+ if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME;
418
+ if (base.cannotBeABaseURL && chr == '#') {
419
+ url.scheme = base.scheme;
420
+ url.path = arraySlice(base.path);
421
+ url.query = base.query;
422
+ url.fragment = '';
423
+ url.cannotBeABaseURL = true;
424
+ state = FRAGMENT;
425
+ break;
426
+ }
427
+ state = base.scheme == 'file' ? FILE : RELATIVE;
513
428
  continue;
514
- } break;
515
429
 
516
- case SPECIAL_AUTHORITY_SLASHES:
517
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
518
- if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue;
519
- pointer++;
520
- break;
430
+ case SPECIAL_RELATIVE_OR_AUTHORITY:
431
+ if (chr == '/' && codePoints[pointer + 1] == '/') {
432
+ state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
433
+ pointer++;
434
+ } else {
435
+ state = RELATIVE;
436
+ continue;
437
+ } break;
521
438
 
522
- case SPECIAL_AUTHORITY_IGNORE_SLASHES:
523
- if (chr != '/' && chr != '\\') {
524
- state = AUTHORITY;
525
- continue;
526
- } break;
527
-
528
- case AUTHORITY:
529
- if (chr == '@') {
530
- if (seenAt) buffer = '%40' + buffer;
531
- seenAt = true;
532
- bufferCodePoints = arrayFrom(buffer);
533
- for (var i = 0; i < bufferCodePoints.length; i++) {
534
- var codePoint = bufferCodePoints[i];
535
- if (codePoint == ':' && !seenPasswordToken) {
536
- seenPasswordToken = true;
537
- continue;
538
- }
539
- var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
540
- if (seenPasswordToken) url.password += encodedCodePoints;
541
- else url.username += encodedCodePoints;
542
- }
543
- buffer = '';
544
- } else if (
545
- chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
546
- (chr == '\\' && isSpecial(url))
547
- ) {
548
- if (seenAt && buffer == '') return INVALID_AUTHORITY;
549
- pointer -= arrayFrom(buffer).length + 1;
550
- buffer = '';
551
- state = HOST;
552
- } else buffer += chr;
553
- break;
554
-
555
- case HOST:
556
- case HOSTNAME:
557
- if (stateOverride && url.scheme == 'file') {
558
- state = FILE_HOST;
559
- continue;
560
- } else if (chr == ':' && !seenBracket) {
561
- if (buffer == '') return INVALID_HOST;
562
- failure = parseHost(url, buffer);
563
- if (failure) return failure;
564
- buffer = '';
565
- state = PORT;
566
- if (stateOverride == HOSTNAME) return;
567
- } else if (
568
- chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
569
- (chr == '\\' && isSpecial(url))
570
- ) {
571
- if (isSpecial(url) && buffer == '') return INVALID_HOST;
572
- if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
573
- failure = parseHost(url, buffer);
574
- if (failure) return failure;
575
- buffer = '';
576
- state = PATH_START;
577
- if (stateOverride) return;
578
- continue;
579
- } else {
580
- if (chr == '[') seenBracket = true;
581
- else if (chr == ']') seenBracket = false;
582
- buffer += chr;
583
- } break;
584
-
585
- case PORT:
586
- if (exec(DIGIT, chr)) {
587
- buffer += chr;
588
- } else if (
589
- chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
590
- (chr == '\\' && isSpecial(url)) ||
591
- stateOverride
592
- ) {
593
- if (buffer != '') {
594
- var port = parseInt(buffer, 10);
595
- if (port > 0xFFFF) return INVALID_PORT;
596
- url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
597
- buffer = '';
439
+ case PATH_OR_AUTHORITY:
440
+ if (chr == '/') {
441
+ state = AUTHORITY;
442
+ break;
443
+ } else {
444
+ state = PATH;
445
+ continue;
598
446
  }
599
- if (stateOverride) return;
600
- state = PATH_START;
601
- continue;
602
- } else return INVALID_PORT;
603
- break;
604
447
 
605
- case FILE:
606
- url.scheme = 'file';
607
- if (chr == '/' || chr == '\\') state = FILE_SLASH;
608
- else if (base && base.scheme == 'file') {
448
+ case RELATIVE:
449
+ url.scheme = base.scheme;
609
450
  if (chr == EOF) {
451
+ url.username = base.username;
452
+ url.password = base.password;
610
453
  url.host = base.host;
454
+ url.port = base.port;
611
455
  url.path = arraySlice(base.path);
612
456
  url.query = base.query;
457
+ } else if (chr == '/' || (chr == '\\' && url.isSpecial())) {
458
+ state = RELATIVE_SLASH;
613
459
  } else if (chr == '?') {
460
+ url.username = base.username;
461
+ url.password = base.password;
614
462
  url.host = base.host;
463
+ url.port = base.port;
615
464
  url.path = arraySlice(base.path);
616
465
  url.query = '';
617
466
  state = QUERY;
618
467
  } else if (chr == '#') {
468
+ url.username = base.username;
469
+ url.password = base.password;
619
470
  url.host = base.host;
471
+ url.port = base.port;
620
472
  url.path = arraySlice(base.path);
621
473
  url.query = base.query;
622
474
  url.fragment = '';
623
475
  state = FRAGMENT;
624
476
  } else {
625
- if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
477
+ url.username = base.username;
478
+ url.password = base.password;
479
+ url.host = base.host;
480
+ url.port = base.port;
481
+ url.path = arraySlice(base.path);
482
+ url.path.length--;
483
+ state = PATH;
484
+ continue;
485
+ } break;
486
+
487
+ case RELATIVE_SLASH:
488
+ if (url.isSpecial() && (chr == '/' || chr == '\\')) {
489
+ state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
490
+ } else if (chr == '/') {
491
+ state = AUTHORITY;
492
+ } else {
493
+ url.username = base.username;
494
+ url.password = base.password;
495
+ url.host = base.host;
496
+ url.port = base.port;
497
+ state = PATH;
498
+ continue;
499
+ } break;
500
+
501
+ case SPECIAL_AUTHORITY_SLASHES:
502
+ state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
503
+ if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue;
504
+ pointer++;
505
+ break;
506
+
507
+ case SPECIAL_AUTHORITY_IGNORE_SLASHES:
508
+ if (chr != '/' && chr != '\\') {
509
+ state = AUTHORITY;
510
+ continue;
511
+ } break;
512
+
513
+ case AUTHORITY:
514
+ if (chr == '@') {
515
+ if (seenAt) buffer = '%40' + buffer;
516
+ seenAt = true;
517
+ bufferCodePoints = arrayFrom(buffer);
518
+ for (var i = 0; i < bufferCodePoints.length; i++) {
519
+ var codePoint = bufferCodePoints[i];
520
+ if (codePoint == ':' && !seenPasswordToken) {
521
+ seenPasswordToken = true;
522
+ continue;
523
+ }
524
+ var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
525
+ if (seenPasswordToken) url.password += encodedCodePoints;
526
+ else url.username += encodedCodePoints;
527
+ }
528
+ buffer = '';
529
+ } else if (
530
+ chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
531
+ (chr == '\\' && url.isSpecial())
532
+ ) {
533
+ if (seenAt && buffer == '') return INVALID_AUTHORITY;
534
+ pointer -= arrayFrom(buffer).length + 1;
535
+ buffer = '';
536
+ state = HOST;
537
+ } else buffer += chr;
538
+ break;
539
+
540
+ case HOST:
541
+ case HOSTNAME:
542
+ if (stateOverride && url.scheme == 'file') {
543
+ state = FILE_HOST;
544
+ continue;
545
+ } else if (chr == ':' && !seenBracket) {
546
+ if (buffer == '') return INVALID_HOST;
547
+ failure = url.parseHost(buffer);
548
+ if (failure) return failure;
549
+ buffer = '';
550
+ state = PORT;
551
+ if (stateOverride == HOSTNAME) return;
552
+ } else if (
553
+ chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
554
+ (chr == '\\' && url.isSpecial())
555
+ ) {
556
+ if (url.isSpecial() && buffer == '') return INVALID_HOST;
557
+ if (stateOverride && buffer == '' && (url.includesCredentials() || url.port !== null)) return;
558
+ failure = url.parseHost(buffer);
559
+ if (failure) return failure;
560
+ buffer = '';
561
+ state = PATH_START;
562
+ if (stateOverride) return;
563
+ continue;
564
+ } else {
565
+ if (chr == '[') seenBracket = true;
566
+ else if (chr == ']') seenBracket = false;
567
+ buffer += chr;
568
+ } break;
569
+
570
+ case PORT:
571
+ if (exec(DIGIT, chr)) {
572
+ buffer += chr;
573
+ } else if (
574
+ chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
575
+ (chr == '\\' && url.isSpecial()) ||
576
+ stateOverride
577
+ ) {
578
+ if (buffer != '') {
579
+ var port = parseInt(buffer, 10);
580
+ if (port > 0xFFFF) return INVALID_PORT;
581
+ url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port;
582
+ buffer = '';
583
+ }
584
+ if (stateOverride) return;
585
+ state = PATH_START;
586
+ continue;
587
+ } else return INVALID_PORT;
588
+ break;
589
+
590
+ case FILE:
591
+ url.scheme = 'file';
592
+ if (chr == '/' || chr == '\\') state = FILE_SLASH;
593
+ else if (base && base.scheme == 'file') {
594
+ if (chr == EOF) {
595
+ url.host = base.host;
596
+ url.path = arraySlice(base.path);
597
+ url.query = base.query;
598
+ } else if (chr == '?') {
626
599
  url.host = base.host;
627
600
  url.path = arraySlice(base.path);
628
- shortenURLsPath(url);
601
+ url.query = '';
602
+ state = QUERY;
603
+ } else if (chr == '#') {
604
+ url.host = base.host;
605
+ url.path = arraySlice(base.path);
606
+ url.query = base.query;
607
+ url.fragment = '';
608
+ state = FRAGMENT;
609
+ } else {
610
+ if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
611
+ url.host = base.host;
612
+ url.path = arraySlice(base.path);
613
+ url.shortenPath();
614
+ }
615
+ state = PATH;
616
+ continue;
629
617
  }
618
+ } else {
630
619
  state = PATH;
631
620
  continue;
621
+ } break;
622
+
623
+ case FILE_SLASH:
624
+ if (chr == '/' || chr == '\\') {
625
+ state = FILE_HOST;
626
+ break;
627
+ }
628
+ if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
629
+ if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
630
+ else url.host = base.host;
632
631
  }
633
- } else {
634
632
  state = PATH;
635
633
  continue;
636
- } break;
637
634
 
638
- case FILE_SLASH:
639
- if (chr == '/' || chr == '\\') {
640
- state = FILE_HOST;
635
+ case FILE_HOST:
636
+ if (chr == EOF || chr == '/' || chr == '\\' || chr == '?' || chr == '#') {
637
+ if (!stateOverride && isWindowsDriveLetter(buffer)) {
638
+ state = PATH;
639
+ } else if (buffer == '') {
640
+ url.host = '';
641
+ if (stateOverride) return;
642
+ state = PATH_START;
643
+ } else {
644
+ failure = url.parseHost(buffer);
645
+ if (failure) return failure;
646
+ if (url.host == 'localhost') url.host = '';
647
+ if (stateOverride) return;
648
+ buffer = '';
649
+ state = PATH_START;
650
+ } continue;
651
+ } else buffer += chr;
641
652
  break;
642
- }
643
- if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
644
- if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
645
- else url.host = base.host;
646
- }
647
- state = PATH;
648
- continue;
649
653
 
650
- case FILE_HOST:
651
- if (chr == EOF || chr == '/' || chr == '\\' || chr == '?' || chr == '#') {
652
- if (!stateOverride && isWindowsDriveLetter(buffer)) {
654
+ case PATH_START:
655
+ if (url.isSpecial()) {
653
656
  state = PATH;
654
- } else if (buffer == '') {
655
- url.host = '';
656
- if (stateOverride) return;
657
- state = PATH_START;
658
- } else {
659
- failure = parseHost(url, buffer);
660
- if (failure) return failure;
661
- if (url.host == 'localhost') url.host = '';
662
- if (stateOverride) return;
657
+ if (chr != '/' && chr != '\\') continue;
658
+ } else if (!stateOverride && chr == '?') {
659
+ url.query = '';
660
+ state = QUERY;
661
+ } else if (!stateOverride && chr == '#') {
662
+ url.fragment = '';
663
+ state = FRAGMENT;
664
+ } else if (chr != EOF) {
665
+ state = PATH;
666
+ if (chr != '/') continue;
667
+ } break;
668
+
669
+ case PATH:
670
+ if (
671
+ chr == EOF || chr == '/' ||
672
+ (chr == '\\' && url.isSpecial()) ||
673
+ (!stateOverride && (chr == '?' || chr == '#'))
674
+ ) {
675
+ if (isDoubleDot(buffer)) {
676
+ url.shortenPath();
677
+ if (chr != '/' && !(chr == '\\' && url.isSpecial())) {
678
+ push(url.path, '');
679
+ }
680
+ } else if (isSingleDot(buffer)) {
681
+ if (chr != '/' && !(chr == '\\' && url.isSpecial())) {
682
+ push(url.path, '');
683
+ }
684
+ } else {
685
+ if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
686
+ if (url.host) url.host = '';
687
+ buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter
688
+ }
689
+ push(url.path, buffer);
690
+ }
663
691
  buffer = '';
664
- state = PATH_START;
665
- } continue;
666
- } else buffer += chr;
667
- break;
668
-
669
- case PATH_START:
670
- if (isSpecial(url)) {
671
- state = PATH;
672
- if (chr != '/' && chr != '\\') continue;
673
- } else if (!stateOverride && chr == '?') {
674
- url.query = '';
675
- state = QUERY;
676
- } else if (!stateOverride && chr == '#') {
677
- url.fragment = '';
678
- state = FRAGMENT;
679
- } else if (chr != EOF) {
680
- state = PATH;
681
- if (chr != '/') continue;
682
- } break;
683
-
684
- case PATH:
685
- if (
686
- chr == EOF || chr == '/' ||
687
- (chr == '\\' && isSpecial(url)) ||
688
- (!stateOverride && (chr == '?' || chr == '#'))
689
- ) {
690
- if (isDoubleDot(buffer)) {
691
- shortenURLsPath(url);
692
- if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
693
- push(url.path, '');
692
+ if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) {
693
+ while (url.path.length > 1 && url.path[0] === '') {
694
+ shift(url.path);
695
+ }
694
696
  }
695
- } else if (isSingleDot(buffer)) {
696
- if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
697
- push(url.path, '');
697
+ if (chr == '?') {
698
+ url.query = '';
699
+ state = QUERY;
700
+ } else if (chr == '#') {
701
+ url.fragment = '';
702
+ state = FRAGMENT;
698
703
  }
699
704
  } else {
700
- if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
701
- if (url.host) url.host = '';
702
- buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter
703
- }
704
- push(url.path, buffer);
705
- }
706
- buffer = '';
707
- if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) {
708
- while (url.path.length > 1 && url.path[0] === '') {
709
- shift(url.path);
710
- }
711
- }
705
+ buffer += percentEncode(chr, pathPercentEncodeSet);
706
+ } break;
707
+
708
+ case CANNOT_BE_A_BASE_URL_PATH:
712
709
  if (chr == '?') {
713
710
  url.query = '';
714
711
  state = QUERY;
715
712
  } else if (chr == '#') {
716
713
  url.fragment = '';
717
714
  state = FRAGMENT;
718
- }
719
- } else {
720
- buffer += percentEncode(chr, pathPercentEncodeSet);
721
- } break;
722
-
723
- case CANNOT_BE_A_BASE_URL_PATH:
724
- if (chr == '?') {
725
- url.query = '';
726
- state = QUERY;
727
- } else if (chr == '#') {
728
- url.fragment = '';
729
- state = FRAGMENT;
730
- } else if (chr != EOF) {
731
- url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
732
- } break;
733
-
734
- case QUERY:
735
- if (!stateOverride && chr == '#') {
736
- url.fragment = '';
737
- state = FRAGMENT;
738
- } else if (chr != EOF) {
739
- if (chr == "'" && isSpecial(url)) url.query += '%27';
740
- else if (chr == '#') url.query += '%23';
741
- else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
742
- } break;
743
-
744
- case FRAGMENT:
745
- if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
746
- break;
747
- }
715
+ } else if (chr != EOF) {
716
+ url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
717
+ } break;
718
+
719
+ case QUERY:
720
+ if (!stateOverride && chr == '#') {
721
+ url.fragment = '';
722
+ state = FRAGMENT;
723
+ } else if (chr != EOF) {
724
+ if (chr == "'" && url.isSpecial()) url.query += '%27';
725
+ else if (chr == '#') url.query += '%23';
726
+ else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
727
+ } break;
728
+
729
+ case FRAGMENT:
730
+ if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
731
+ break;
732
+ }
748
733
 
749
- pointer++;
734
+ pointer++;
735
+ }
736
+ },
737
+ // https://url.spec.whatwg.org/#host-parsing
738
+ parseHost: function (input) {
739
+ var result, codePoints, index;
740
+ if (charAt(input, 0) == '[') {
741
+ if (charAt(input, input.length - 1) != ']') return INVALID_HOST;
742
+ result = parseIPv6(stringSlice(input, 1, -1));
743
+ if (!result) return INVALID_HOST;
744
+ this.host = result;
745
+ // opaque host
746
+ } else if (!this.isSpecial()) {
747
+ if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
748
+ result = '';
749
+ codePoints = arrayFrom(input);
750
+ for (index = 0; index < codePoints.length; index++) {
751
+ result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
752
+ }
753
+ this.host = result;
754
+ } else {
755
+ input = toASCII(input);
756
+ if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
757
+ result = parseIPv4(input);
758
+ if (result === null) return INVALID_HOST;
759
+ this.host = result;
760
+ }
761
+ },
762
+ // https://url.spec.whatwg.org/#cannot-have-a-username-password-port
763
+ cannotHaveUsernamePasswordPort: function () {
764
+ return !this.host || this.cannotBeABaseURL || this.scheme == 'file';
765
+ },
766
+ // https://url.spec.whatwg.org/#include-credentials
767
+ includesCredentials: function () {
768
+ return this.username != '' || this.password != '';
769
+ },
770
+ // https://url.spec.whatwg.org/#is-special
771
+ isSpecial: function () {
772
+ return hasOwn(specialSchemes, this.scheme);
773
+ },
774
+ // https://url.spec.whatwg.org/#shorten-a-urls-path
775
+ shortenPath: function () {
776
+ var path = this.path;
777
+ var pathSize = path.length;
778
+ if (pathSize && (this.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
779
+ path.length--;
780
+ }
781
+ },
782
+ // https://url.spec.whatwg.org/#concept-url-serializer
783
+ serialize: function () {
784
+ var url = this;
785
+ var scheme = url.scheme;
786
+ var username = url.username;
787
+ var password = url.password;
788
+ var host = url.host;
789
+ var port = url.port;
790
+ var path = url.path;
791
+ var query = url.query;
792
+ var fragment = url.fragment;
793
+ var output = scheme + ':';
794
+ if (host !== null) {
795
+ output += '//';
796
+ if (url.includesCredentials()) {
797
+ output += username + (password ? ':' + password : '') + '@';
798
+ }
799
+ output += serializeHost(host);
800
+ if (port !== null) output += ':' + port;
801
+ } else if (scheme == 'file') output += '//';
802
+ output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
803
+ if (query !== null) output += '?' + query;
804
+ if (fragment !== null) output += '#' + fragment;
805
+ return output;
806
+ },
807
+ // https://url.spec.whatwg.org/#dom-url-href
808
+ setHref: function (href) {
809
+ var failure = this.parse(href);
810
+ if (failure) throw TypeError(failure);
811
+ this.searchParams.update();
812
+ },
813
+ // https://url.spec.whatwg.org/#dom-url-origin
814
+ getOrigin: function () {
815
+ var scheme = this.scheme;
816
+ var port = this.port;
817
+ if (scheme == 'blob') try {
818
+ return new URLConstructor(scheme.path[0]).origin;
819
+ } catch (error) {
820
+ return 'null';
821
+ }
822
+ if (scheme == 'file' || !this.isSpecial()) return 'null';
823
+ return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : '');
824
+ },
825
+ // https://url.spec.whatwg.org/#dom-url-protocol
826
+ getProtocol: function () {
827
+ return this.scheme + ':';
828
+ },
829
+ setProtocol: function (protocol) {
830
+ this.parse($toString(protocol) + ':', SCHEME_START);
831
+ },
832
+ // https://url.spec.whatwg.org/#dom-url-username
833
+ getUsername: function () {
834
+ return this.username;
835
+ },
836
+ setUsername: function (username) {
837
+ var codePoints = arrayFrom($toString(username));
838
+ if (this.cannotHaveUsernamePasswordPort()) return;
839
+ this.username = '';
840
+ for (var i = 0; i < codePoints.length; i++) {
841
+ this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
842
+ }
843
+ },
844
+ // https://url.spec.whatwg.org/#dom-url-password
845
+ getPassword: function () {
846
+ return this.password;
847
+ },
848
+ setPassword: function (password) {
849
+ var codePoints = arrayFrom($toString(password));
850
+ if (this.cannotHaveUsernamePasswordPort()) return;
851
+ this.password = '';
852
+ for (var i = 0; i < codePoints.length; i++) {
853
+ this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
854
+ }
855
+ },
856
+ // https://url.spec.whatwg.org/#dom-url-host
857
+ getHost: function () {
858
+ var host = this.host;
859
+ var port = this.port;
860
+ return host === null ? ''
861
+ : port === null ? serializeHost(host)
862
+ : serializeHost(host) + ':' + port;
863
+ },
864
+ setHost: function (host) {
865
+ if (this.cannotBeABaseURL) return;
866
+ this.parse(host, HOST);
867
+ },
868
+ // https://url.spec.whatwg.org/#dom-url-hostname
869
+ getHostname: function () {
870
+ var host = this.host;
871
+ return host === null ? '' : serializeHost(host);
872
+ },
873
+ setHostname: function (hostname) {
874
+ if (this.cannotBeABaseURL) return;
875
+ this.parse(hostname, HOSTNAME);
876
+ },
877
+ // https://url.spec.whatwg.org/#dom-url-port
878
+ getPort: function () {
879
+ var port = this.port;
880
+ return port === null ? '' : $toString(port);
881
+ },
882
+ setPort: function (port) {
883
+ if (this.cannotHaveUsernamePasswordPort()) return;
884
+ port = $toString(port);
885
+ if (port == '') this.port = null;
886
+ else this.parse(port, PORT);
887
+ },
888
+ // https://url.spec.whatwg.org/#dom-url-pathname
889
+ getPathname: function () {
890
+ var path = this.path;
891
+ return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
892
+ },
893
+ setPathname: function (pathname) {
894
+ if (this.cannotBeABaseURL) return;
895
+ this.path = [];
896
+ this.parse(pathname, PATH_START);
897
+ },
898
+ // https://url.spec.whatwg.org/#dom-url-search
899
+ getSearch: function () {
900
+ var query = this.query;
901
+ return query ? '?' + query : '';
902
+ },
903
+ setSearch: function (search) {
904
+ search = $toString(search);
905
+ if (search == '') {
906
+ this.query = null;
907
+ } else {
908
+ if ('?' == charAt(search, 0)) search = stringSlice(search, 1);
909
+ this.query = '';
910
+ this.parse(search, QUERY);
911
+ }
912
+ this.searchParams.update();
913
+ },
914
+ // https://url.spec.whatwg.org/#dom-url-searchparams
915
+ getSearchParams: function () {
916
+ return this.searchParams.facade;
917
+ },
918
+ // https://url.spec.whatwg.org/#dom-url-hash
919
+ getHash: function () {
920
+ var fragment = this.fragment;
921
+ return fragment ? '#' + fragment : '';
922
+ },
923
+ setHash: function (hash) {
924
+ hash = $toString(hash);
925
+ if (hash == '') {
926
+ this.fragment = null;
927
+ return;
928
+ }
929
+ if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1);
930
+ this.fragment = '';
931
+ this.parse(hash, FRAGMENT);
932
+ },
933
+ update: function () {
934
+ this.query = this.searchParams.serialize() || null;
750
935
  }
751
936
  };
752
937
 
@@ -755,252 +940,89 @@ var parseURL = function (url, input, stateOverride, base) {
755
940
  var URLConstructor = function URL(url /* , base */) {
756
941
  var that = anInstance(this, URLPrototype);
757
942
  var base = arguments.length > 1 ? arguments[1] : undefined;
758
- var urlString = $toString(url);
759
- var state = setInternalState(that, { type: 'URL' });
760
- var baseState, failure;
761
- if (base !== undefined) {
762
- try {
763
- baseState = getInternalURLState(base);
764
- } catch (error) {
765
- failure = parseURL(baseState = {}, $toString(base));
766
- if (failure) throw TypeError(failure);
767
- }
768
- }
769
- failure = parseURL(state, urlString, null, baseState);
770
- if (failure) throw TypeError(failure);
771
- var searchParams = state.searchParams = new URLSearchParams();
772
- var searchParamsState = getInternalSearchParamsState(searchParams);
773
- searchParamsState.updateSearchParams(state.query);
774
- searchParamsState.updateURL = function () {
775
- state.query = $toString(searchParams) || null;
776
- };
943
+ var state = setInternalState(that, new URLState(url, false, base));
777
944
  if (!DESCRIPTORS) {
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);
945
+ that.href = state.serialize();
946
+ that.origin = state.getOrigin();
947
+ that.protocol = state.getProtocol();
948
+ that.username = state.getUsername();
949
+ that.password = state.getPassword();
950
+ that.host = state.getHost();
951
+ that.hostname = state.getHostname();
952
+ that.port = state.getPort();
953
+ that.pathname = state.getPathname();
954
+ that.search = state.getSearch();
955
+ that.searchParams = state.getSearchParams();
956
+ that.hash = state.getHash();
790
957
  }
791
958
  };
792
959
 
793
960
  var URLPrototype = URLConstructor.prototype;
794
961
 
795
- var serializeURL = function () {
796
- var url = getInternalURLState(this);
797
- var scheme = url.scheme;
798
- var username = url.username;
799
- var password = url.password;
800
- var host = url.host;
801
- var port = url.port;
802
- var path = url.path;
803
- var query = url.query;
804
- var fragment = url.fragment;
805
- var output = scheme + ':';
806
- if (host !== null) {
807
- output += '//';
808
- if (includesCredentials(url)) {
809
- output += username + (password ? ':' + password : '') + '@';
810
- }
811
- output += serializeHost(host);
812
- if (port !== null) output += ':' + port;
813
- } else if (scheme == 'file') output += '//';
814
- output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
815
- if (query !== null) output += '?' + query;
816
- if (fragment !== null) output += '#' + fragment;
817
- return output;
818
- };
819
-
820
- var getOrigin = function () {
821
- var url = getInternalURLState(this);
822
- var scheme = url.scheme;
823
- var port = url.port;
824
- if (scheme == 'blob') try {
825
- return new URLConstructor(scheme.path[0]).origin;
826
- } catch (error) {
827
- return 'null';
828
- }
829
- if (scheme == 'file' || !isSpecial(url)) return 'null';
830
- return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
831
- };
832
-
833
- var getProtocol = function () {
834
- return getInternalURLState(this).scheme + ':';
835
- };
836
-
837
- var getUsername = function () {
838
- return getInternalURLState(this).username;
839
- };
840
-
841
- var getPassword = function () {
842
- return getInternalURLState(this).password;
843
- };
844
-
845
- var getHost = function () {
846
- var url = getInternalURLState(this);
847
- var host = url.host;
848
- var port = url.port;
849
- return host === null ? ''
850
- : port === null ? serializeHost(host)
851
- : serializeHost(host) + ':' + port;
852
- };
853
-
854
- var getHostname = function () {
855
- var host = getInternalURLState(this).host;
856
- return host === null ? '' : serializeHost(host);
857
- };
858
-
859
- var getPort = function () {
860
- var port = getInternalURLState(this).port;
861
- return port === null ? '' : $toString(port);
862
- };
863
-
864
- var getPathname = function () {
865
- var url = getInternalURLState(this);
866
- var path = url.path;
867
- return url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
868
- };
869
-
870
- var getSearch = function () {
871
- var query = getInternalURLState(this).query;
872
- return query ? '?' + query : '';
873
- };
874
-
875
- var getSearchParams = function () {
876
- return getInternalURLState(this).searchParams;
877
- };
878
-
879
- var getHash = function () {
880
- var fragment = getInternalURLState(this).fragment;
881
- return fragment ? '#' + fragment : '';
882
- };
883
-
884
962
  var accessorDescriptor = function (getter, setter) {
885
- return { get: getter, set: setter, configurable: true, enumerable: true };
963
+ return {
964
+ get: function () {
965
+ return getInternalURLState(this)[getter]();
966
+ },
967
+ set: setter && function (value) {
968
+ return getInternalURLState(this)[setter](value);
969
+ },
970
+ configurable: true,
971
+ enumerable: true
972
+ };
886
973
  };
887
974
 
888
975
  if (DESCRIPTORS) {
889
976
  defineProperties(URLPrototype, {
890
977
  // `URL.prototype.href` accessors pair
891
978
  // https://url.spec.whatwg.org/#dom-url-href
892
- href: accessorDescriptor(serializeURL, function (href) {
893
- var url = getInternalURLState(this);
894
- var urlString = $toString(href);
895
- var failure = parseURL(url, urlString);
896
- if (failure) throw TypeError(failure);
897
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
898
- }),
979
+ href: accessorDescriptor('serialize', 'setHref'),
899
980
  // `URL.prototype.origin` getter
900
981
  // https://url.spec.whatwg.org/#dom-url-origin
901
- origin: accessorDescriptor(getOrigin),
982
+ origin: accessorDescriptor('getOrigin'),
902
983
  // `URL.prototype.protocol` accessors pair
903
984
  // https://url.spec.whatwg.org/#dom-url-protocol
904
- protocol: accessorDescriptor(getProtocol, function (protocol) {
905
- var url = getInternalURLState(this);
906
- parseURL(url, $toString(protocol) + ':', SCHEME_START);
907
- }),
985
+ protocol: accessorDescriptor('getProtocol', 'setProtocol'),
908
986
  // `URL.prototype.username` accessors pair
909
987
  // https://url.spec.whatwg.org/#dom-url-username
910
- username: accessorDescriptor(getUsername, function (username) {
911
- var url = getInternalURLState(this);
912
- var codePoints = arrayFrom($toString(username));
913
- if (cannotHaveUsernamePasswordPort(url)) return;
914
- url.username = '';
915
- for (var i = 0; i < codePoints.length; i++) {
916
- url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
917
- }
918
- }),
988
+ username: accessorDescriptor('getUsername', 'setUsername'),
919
989
  // `URL.prototype.password` accessors pair
920
990
  // https://url.spec.whatwg.org/#dom-url-password
921
- password: accessorDescriptor(getPassword, function (password) {
922
- var url = getInternalURLState(this);
923
- var codePoints = arrayFrom($toString(password));
924
- if (cannotHaveUsernamePasswordPort(url)) return;
925
- url.password = '';
926
- for (var i = 0; i < codePoints.length; i++) {
927
- url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
928
- }
929
- }),
991
+ password: accessorDescriptor('getPassword', 'setPassword'),
930
992
  // `URL.prototype.host` accessors pair
931
993
  // https://url.spec.whatwg.org/#dom-url-host
932
- host: accessorDescriptor(getHost, function (host) {
933
- var url = getInternalURLState(this);
934
- if (url.cannotBeABaseURL) return;
935
- parseURL(url, $toString(host), HOST);
936
- }),
994
+ host: accessorDescriptor('getHost', 'setHost'),
937
995
  // `URL.prototype.hostname` accessors pair
938
996
  // https://url.spec.whatwg.org/#dom-url-hostname
939
- hostname: accessorDescriptor(getHostname, function (hostname) {
940
- var url = getInternalURLState(this);
941
- if (url.cannotBeABaseURL) return;
942
- parseURL(url, $toString(hostname), HOSTNAME);
943
- }),
997
+ hostname: accessorDescriptor('getHostname', 'setHostname'),
944
998
  // `URL.prototype.port` accessors pair
945
999
  // https://url.spec.whatwg.org/#dom-url-port
946
- port: accessorDescriptor(getPort, function (port) {
947
- var url = getInternalURLState(this);
948
- if (cannotHaveUsernamePasswordPort(url)) return;
949
- port = $toString(port);
950
- if (port == '') url.port = null;
951
- else parseURL(url, port, PORT);
952
- }),
1000
+ port: accessorDescriptor('getPort', 'setPort'),
953
1001
  // `URL.prototype.pathname` accessors pair
954
1002
  // https://url.spec.whatwg.org/#dom-url-pathname
955
- pathname: accessorDescriptor(getPathname, function (pathname) {
956
- var url = getInternalURLState(this);
957
- if (url.cannotBeABaseURL) return;
958
- url.path = [];
959
- parseURL(url, $toString(pathname), PATH_START);
960
- }),
1003
+ pathname: accessorDescriptor('getPathname', 'setPathname'),
961
1004
  // `URL.prototype.search` accessors pair
962
1005
  // https://url.spec.whatwg.org/#dom-url-search
963
- search: accessorDescriptor(getSearch, function (search) {
964
- var url = getInternalURLState(this);
965
- search = $toString(search);
966
- if (search == '') {
967
- url.query = null;
968
- } else {
969
- if ('?' == charAt(search, 0)) search = stringSlice(search, 1);
970
- url.query = '';
971
- parseURL(url, search, QUERY);
972
- }
973
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
974
- }),
1006
+ search: accessorDescriptor('getSearch', 'setSearch'),
975
1007
  // `URL.prototype.searchParams` getter
976
1008
  // https://url.spec.whatwg.org/#dom-url-searchparams
977
- searchParams: accessorDescriptor(getSearchParams),
1009
+ searchParams: accessorDescriptor('getSearchParams'),
978
1010
  // `URL.prototype.hash` accessors pair
979
1011
  // https://url.spec.whatwg.org/#dom-url-hash
980
- hash: accessorDescriptor(getHash, function (hash) {
981
- var url = getInternalURLState(this);
982
- hash = $toString(hash);
983
- if (hash == '') {
984
- url.fragment = null;
985
- return;
986
- }
987
- if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1);
988
- url.fragment = '';
989
- parseURL(url, hash, FRAGMENT);
990
- })
1012
+ hash: accessorDescriptor('getHash', 'setHash')
991
1013
  });
992
1014
  }
993
1015
 
994
1016
  // `URL.prototype.toJSON` method
995
1017
  // https://url.spec.whatwg.org/#dom-url-tojson
996
1018
  redefine(URLPrototype, 'toJSON', function toJSON() {
997
- return call(serializeURL, this);
1019
+ return getInternalURLState(this).serialize();
998
1020
  }, { enumerable: true });
999
1021
 
1000
1022
  // `URL.prototype.toString` method
1001
1023
  // https://url.spec.whatwg.org/#URL-stringification-behavior
1002
1024
  redefine(URLPrototype, 'toString', function toString() {
1003
- return call(serializeURL, this);
1025
+ return getInternalURLState(this).serialize();
1004
1026
  }, { enumerable: true });
1005
1027
 
1006
1028
  if (NativeURL) {