core-js 3.1.3 → 3.3.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 (307) hide show
  1. package/README.md +1 -1
  2. package/configurator.js +7 -0
  3. package/es/global-this.js +3 -0
  4. package/es/index.js +2 -0
  5. package/es/promise/all-settled.js +11 -0
  6. package/es/promise/index.js +1 -0
  7. package/features/array/index.js +1 -0
  8. package/features/array/is-template-object.js +4 -0
  9. package/features/async-iterator/as-indexed-pairs.js +10 -0
  10. package/features/async-iterator/drop.js +10 -0
  11. package/features/async-iterator/every.js +10 -0
  12. package/features/async-iterator/filter.js +10 -0
  13. package/features/async-iterator/find.js +10 -0
  14. package/features/async-iterator/flat-map.js +10 -0
  15. package/features/async-iterator/for-each.js +10 -0
  16. package/features/async-iterator/from.js +10 -0
  17. package/features/async-iterator/index.js +22 -0
  18. package/features/async-iterator/map.js +10 -0
  19. package/features/async-iterator/reduce.js +10 -0
  20. package/features/async-iterator/some.js +10 -0
  21. package/features/async-iterator/take.js +10 -0
  22. package/features/async-iterator/to-array.js +10 -0
  23. package/features/global-this.js +1 -3
  24. package/features/iterator/as-indexed-pairs.js +10 -0
  25. package/features/iterator/drop.js +9 -0
  26. package/features/iterator/every.js +9 -0
  27. package/features/iterator/filter.js +9 -0
  28. package/features/iterator/find.js +9 -0
  29. package/features/iterator/flat-map.js +9 -0
  30. package/features/iterator/for-each.js +9 -0
  31. package/features/iterator/from.js +9 -0
  32. package/features/iterator/index.js +21 -0
  33. package/features/iterator/map.js +9 -0
  34. package/features/iterator/reduce.js +9 -0
  35. package/features/iterator/some.js +9 -0
  36. package/features/iterator/take.js +9 -0
  37. package/features/iterator/to-array.js +9 -0
  38. package/features/map/from.js +2 -0
  39. package/features/map/index.js +3 -0
  40. package/features/map/of.js +2 -0
  41. package/features/map/update-or-insert.js +6 -0
  42. package/features/map/upsert.js +5 -0
  43. package/features/promise/all-settled.js +2 -9
  44. package/features/promise/index.js +1 -0
  45. package/features/set/difference.js +2 -0
  46. package/features/set/from.js +2 -0
  47. package/features/set/is-subset-of.js +2 -0
  48. package/features/set/of.js +2 -0
  49. package/features/set/symmetric-difference.js +2 -0
  50. package/features/set/union.js +2 -0
  51. package/features/symbol/async-dispose.js +4 -0
  52. package/features/symbol/index.js +1 -0
  53. package/features/weak-map/from.js +2 -0
  54. package/features/weak-map/index.js +1 -0
  55. package/features/weak-map/of.js +2 -0
  56. package/features/weak-map/upsert.js +5 -0
  57. package/features/weak-set/from.js +2 -0
  58. package/features/weak-set/of.js +2 -0
  59. package/internals/a-possible-prototype.js +7 -0
  60. package/internals/add-to-unscopables.js +2 -2
  61. package/internals/advance-string-index.js +2 -2
  62. package/internals/array-buffer-view-core.js +5 -4
  63. package/internals/array-buffer.js +21 -16
  64. package/internals/array-copy-within.js +3 -1
  65. package/internals/array-for-each.js +3 -6
  66. package/internals/array-from.js +4 -3
  67. package/internals/array-includes.js +12 -7
  68. package/internals/{array-methods.js → array-iteration.js} +30 -18
  69. package/internals/array-last-index-of.js +3 -2
  70. package/internals/array-reduce.js +30 -21
  71. package/internals/async-iterator-iteration.js +61 -0
  72. package/internals/async-iterator-prototype.js +37 -0
  73. package/internals/collection-delete-all.js +3 -1
  74. package/internals/collection-from.js +3 -2
  75. package/internals/collection-weak.js +5 -5
  76. package/internals/collection.js +14 -14
  77. package/internals/composite-key.js +1 -0
  78. package/internals/create-async-iterator-proxy.js +61 -0
  79. package/internals/create-iterator-proxy.js +51 -0
  80. package/internals/{hide.js → create-non-enumerable-property.js} +0 -0
  81. package/internals/date-to-iso-string.js +12 -14
  82. package/internals/define-iterator.js +3 -3
  83. package/internals/document-create-element.js +2 -2
  84. package/internals/export.js +2 -2
  85. package/internals/fix-regexp-well-known-symbol-logic.js +2 -2
  86. package/internals/function-bind.js +3 -3
  87. package/internals/get-async-iterator-method.js +9 -0
  88. package/internals/global.js +4 -5
  89. package/internals/html.js +2 -4
  90. package/internals/indexed-object.js +1 -1
  91. package/internals/inherit-if-required.js +13 -6
  92. package/internals/internal-state.js +2 -2
  93. package/internals/iterate.js +21 -12
  94. package/internals/iterators-core.js +4 -2
  95. package/internals/map-upsert.js +23 -0
  96. package/internals/math-expm1.js +2 -1
  97. package/internals/math-fround.js +2 -1
  98. package/internals/math-log1p.js +3 -1
  99. package/internals/microtask.js +4 -3
  100. package/internals/native-promise-constructor.js +3 -0
  101. package/internals/native-url.js +13 -4
  102. package/internals/not-a-regexp.js +7 -0
  103. package/internals/object-assign.js +2 -1
  104. package/internals/object-create.js +2 -1
  105. package/internals/object-define-properties.js +4 -2
  106. package/internals/object-define-property.js +2 -0
  107. package/internals/object-get-own-property-descriptor.js +2 -0
  108. package/internals/object-get-own-property-names.js +2 -1
  109. package/internals/object-get-prototype-of.js +2 -1
  110. package/internals/object-keys-internal.js +2 -4
  111. package/internals/object-keys.js +2 -1
  112. package/internals/object-property-is-enumerable.js +2 -0
  113. package/internals/object-set-prototype-of.js +9 -5
  114. package/internals/object-to-array.js +25 -15
  115. package/internals/own-keys.js +2 -4
  116. package/internals/parse-float.js +7 -5
  117. package/internals/parse-int.js +6 -4
  118. package/internals/punycode-to-ascii.js +2 -4
  119. package/internals/redefine.js +3 -3
  120. package/internals/reflect-metadata.js +1 -0
  121. package/internals/regexp-flags.js +1 -0
  122. package/internals/set-global.js +2 -2
  123. package/internals/set-species.js +8 -5
  124. package/internals/shared-store.js +7 -0
  125. package/internals/shared.js +2 -6
  126. package/internals/string-multibyte.js +27 -0
  127. package/internals/string-pad.js +25 -11
  128. package/internals/string-trim.js +20 -8
  129. package/internals/task.js +3 -1
  130. package/internals/to-offset.js +3 -3
  131. package/internals/to-positive-integer.js +7 -0
  132. package/internals/to-primitive.js +7 -6
  133. package/internals/typed-array-constructor.js +15 -12
  134. package/internals/typed-array-from.js +3 -2
  135. package/internals/uid.js +1 -1
  136. package/internals/user-agent.js +2 -4
  137. package/modules/es.array.every.js +3 -6
  138. package/modules/es.array.fill.js +3 -1
  139. package/modules/es.array.filter.js +3 -6
  140. package/modules/es.array.find-index.js +2 -3
  141. package/modules/es.array.find.js +2 -3
  142. package/modules/es.array.flat-map.js +1 -1
  143. package/modules/es.array.flat.js +1 -1
  144. package/modules/es.array.includes.js +2 -4
  145. package/modules/es.array.index-of.js +2 -3
  146. package/modules/es.array.is-array.js +3 -1
  147. package/modules/es.array.map.js +3 -6
  148. package/modules/es.array.reduce-right.js +3 -4
  149. package/modules/es.array.reduce.js +3 -5
  150. package/modules/es.array.slice.js +1 -3
  151. package/modules/es.array.some.js +3 -6
  152. package/modules/es.array.splice.js +1 -3
  153. package/modules/es.date.to-primitive.js +4 -2
  154. package/modules/es.global-this.js +8 -0
  155. package/modules/es.map.js +1 -1
  156. package/modules/es.math.hypot.js +6 -1
  157. package/modules/es.number.constructor.js +9 -10
  158. package/modules/es.number.to-fixed.js +57 -53
  159. package/modules/es.object.entries.js +2 -2
  160. package/modules/es.object.get-own-property-descriptors.js +3 -3
  161. package/modules/es.object.get-prototype-of.js +1 -0
  162. package/modules/es.object.values.js +2 -2
  163. package/modules/es.promise.all-settled.js +43 -0
  164. package/modules/es.promise.finally.js +8 -0
  165. package/modules/es.promise.js +30 -14
  166. package/modules/es.reflect.apply.js +2 -2
  167. package/modules/es.reflect.construct.js +4 -4
  168. package/modules/es.reflect.define-property.js +5 -5
  169. package/modules/es.reflect.delete-property.js +1 -1
  170. package/modules/es.reflect.get-own-property-descriptor.js +2 -2
  171. package/modules/es.reflect.get-prototype-of.js +1 -1
  172. package/modules/es.reflect.get.js +3 -3
  173. package/modules/es.reflect.set-prototype-of.js +4 -2
  174. package/modules/es.reflect.set.js +3 -3
  175. package/modules/es.regexp.constructor.js +3 -3
  176. package/modules/es.regexp.to-string.js +1 -1
  177. package/modules/es.set.js +1 -1
  178. package/modules/es.string.code-point-at.js +2 -2
  179. package/modules/es.string.ends-with.js +6 -5
  180. package/modules/es.string.includes.js +4 -3
  181. package/modules/es.string.iterator.js +2 -2
  182. package/modules/es.string.match-all.js +22 -7
  183. package/modules/es.string.pad-end.js +2 -2
  184. package/modules/es.string.pad-start.js +2 -2
  185. package/modules/es.string.starts-with.js +8 -6
  186. package/modules/es.string.trim-end.js +2 -2
  187. package/modules/es.string.trim-start.js +2 -2
  188. package/modules/es.string.trim.js +3 -5
  189. package/modules/es.symbol.js +97 -87
  190. package/modules/es.typed-array.copy-within.js +2 -2
  191. package/modules/es.typed-array.every.js +2 -3
  192. package/modules/es.typed-array.fill.js +2 -2
  193. package/modules/es.typed-array.filter.js +3 -4
  194. package/modules/es.typed-array.find-index.js +2 -3
  195. package/modules/es.typed-array.find.js +2 -3
  196. package/modules/es.typed-array.for-each.js +2 -3
  197. package/modules/es.typed-array.includes.js +2 -3
  198. package/modules/es.typed-array.index-of.js +2 -3
  199. package/modules/es.typed-array.iterator.js +1 -1
  200. package/modules/es.typed-array.join.js +2 -2
  201. package/modules/es.typed-array.last-index-of.js +2 -2
  202. package/modules/es.typed-array.map.js +5 -7
  203. package/modules/es.typed-array.of.js +1 -1
  204. package/modules/es.typed-array.reduce-right.js +2 -2
  205. package/modules/es.typed-array.reduce.js +2 -2
  206. package/modules/es.typed-array.reverse.js +2 -1
  207. package/modules/es.typed-array.set.js +2 -2
  208. package/modules/es.typed-array.slice.js +3 -3
  209. package/modules/es.typed-array.some.js +2 -3
  210. package/modules/es.typed-array.sort.js +2 -2
  211. package/modules/es.typed-array.subarray.js +1 -1
  212. package/modules/es.typed-array.to-locale-string.js +7 -6
  213. package/modules/es.weak-map.js +1 -1
  214. package/modules/es.weak-set.js +1 -1
  215. package/modules/esnext.aggregate-error.js +28 -4
  216. package/modules/esnext.array.is-template-object.js +28 -0
  217. package/modules/esnext.async-iterator.as-indexed-pairs.js +27 -0
  218. package/modules/esnext.async-iterator.constructor.js +25 -0
  219. package/modules/esnext.async-iterator.drop.js +41 -0
  220. package/modules/esnext.async-iterator.every.js +10 -0
  221. package/modules/esnext.async-iterator.filter.js +42 -0
  222. package/modules/esnext.async-iterator.find.js +10 -0
  223. package/modules/esnext.async-iterator.flat-map.js +67 -0
  224. package/modules/esnext.async-iterator.for-each.js +10 -0
  225. package/modules/esnext.async-iterator.from.js +30 -0
  226. package/modules/esnext.async-iterator.map.js +30 -0
  227. package/modules/esnext.async-iterator.reduce.js +46 -0
  228. package/modules/esnext.async-iterator.some.js +10 -0
  229. package/modules/esnext.async-iterator.take.js +22 -0
  230. package/modules/esnext.async-iterator.to-array.js +10 -0
  231. package/modules/esnext.global-this.js +2 -6
  232. package/modules/esnext.iterator.as-indexed-pairs.js +20 -0
  233. package/modules/esnext.iterator.constructor.js +39 -0
  234. package/modules/esnext.iterator.drop.js +30 -0
  235. package/modules/esnext.iterator.every.js +16 -0
  236. package/modules/esnext.iterator.filter.js +30 -0
  237. package/modules/esnext.iterator.find.js +16 -0
  238. package/modules/esnext.iterator.flat-map.js +45 -0
  239. package/modules/esnext.iterator.for-each.js +11 -0
  240. package/modules/esnext.iterator.from.js +32 -0
  241. package/modules/esnext.iterator.map.js +23 -0
  242. package/modules/esnext.iterator.reduce.js +25 -0
  243. package/modules/esnext.iterator.some.js +16 -0
  244. package/modules/esnext.iterator.take.js +25 -0
  245. package/modules/esnext.iterator.to-array.js +15 -0
  246. package/modules/esnext.map.every.js +4 -5
  247. package/modules/esnext.map.filter.js +4 -5
  248. package/modules/esnext.map.find-key.js +4 -5
  249. package/modules/esnext.map.find.js +4 -5
  250. package/modules/esnext.map.includes.js +4 -7
  251. package/modules/esnext.map.key-of.js +4 -7
  252. package/modules/esnext.map.map-keys.js +4 -5
  253. package/modules/esnext.map.map-values.js +4 -5
  254. package/modules/esnext.map.reduce.js +12 -11
  255. package/modules/esnext.map.some.js +4 -5
  256. package/modules/esnext.map.update-or-insert.js +11 -0
  257. package/modules/esnext.map.update.js +3 -2
  258. package/modules/esnext.map.upsert.js +10 -0
  259. package/modules/esnext.math.signbit.js +0 -1
  260. package/modules/esnext.observable.js +26 -25
  261. package/modules/esnext.promise.all-settled.js +2 -43
  262. package/modules/esnext.reflect.get-metadata-keys.js +1 -0
  263. package/modules/esnext.set.every.js +4 -4
  264. package/modules/esnext.set.filter.js +4 -4
  265. package/modules/esnext.set.find.js +4 -4
  266. package/modules/esnext.set.is-disjoint-from.js +3 -5
  267. package/modules/esnext.set.is-subset-of.js +3 -5
  268. package/modules/esnext.set.is-superset-of.js +3 -5
  269. package/modules/esnext.set.join.js +2 -2
  270. package/modules/esnext.set.map.js +4 -4
  271. package/modules/esnext.set.reduce.js +12 -10
  272. package/modules/esnext.set.some.js +4 -4
  273. package/modules/esnext.string.at.js +2 -2
  274. package/modules/esnext.string.code-points.js +5 -3
  275. package/modules/esnext.string.match-all.js +0 -1
  276. package/modules/esnext.string.replace-all.js +16 -22
  277. package/modules/esnext.symbol.async-dispose.js +5 -0
  278. package/modules/esnext.symbol.dispose.js +1 -1
  279. package/modules/esnext.symbol.replace-all.js +1 -2
  280. package/modules/esnext.weak-map.upsert.js +10 -0
  281. package/modules/web.dom-collections.for-each.js +2 -2
  282. package/modules/web.dom-collections.iterator.js +6 -4
  283. package/modules/web.immediate.js +5 -0
  284. package/modules/web.timers.js +12 -7
  285. package/modules/web.url-search-params.js +52 -41
  286. package/modules/web.url.js +45 -43
  287. package/package.json +2 -2
  288. package/postinstall.js +49 -0
  289. package/proposals/array-is-template-object.js +1 -0
  290. package/proposals/iterator-helpers.js +20 -0
  291. package/proposals/map-update-or-insert.js +2 -0
  292. package/proposals/map-upsert.js +5 -0
  293. package/proposals/promise-all-settled.js +1 -0
  294. package/proposals/string-match-all.js +0 -2
  295. package/proposals/using-statement.js +1 -0
  296. package/stable/global-this.js +1 -3
  297. package/stable/promise/all-settled.js +1 -0
  298. package/stage/1.js +1 -3
  299. package/stage/2.js +4 -1
  300. package/stage/3.js +2 -2
  301. package/stage/4.js +2 -0
  302. package/LICENSE +0 -19
  303. package/internals/enum-keys.js +0 -16
  304. package/internals/string-at.js +0 -17
  305. package/internals/validate-set-prototype-of-arguments.js +0 -9
  306. package/internals/validate-string-method-arguments.js +0 -9
  307. package/scripts/postinstall.js +0 -23
@@ -22,17 +22,17 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
22
22
  var fixMethod = function (KEY) {
23
23
  var nativeMethod = NativePrototype[KEY];
24
24
  redefine(NativePrototype, KEY,
25
- KEY == 'add' ? function add(a) {
26
- nativeMethod.call(this, a === 0 ? 0 : a);
25
+ KEY == 'add' ? function add(value) {
26
+ nativeMethod.call(this, value === 0 ? 0 : value);
27
27
  return this;
28
- } : KEY == 'delete' ? function (a) {
29
- return IS_WEAK && !isObject(a) ? false : nativeMethod.call(this, a === 0 ? 0 : a);
30
- } : KEY == 'get' ? function get(a) {
31
- return IS_WEAK && !isObject(a) ? undefined : nativeMethod.call(this, a === 0 ? 0 : a);
32
- } : KEY == 'has' ? function has(a) {
33
- return IS_WEAK && !isObject(a) ? false : nativeMethod.call(this, a === 0 ? 0 : a);
34
- } : function set(a, b) {
35
- nativeMethod.call(this, a === 0 ? 0 : a, b);
28
+ } : KEY == 'delete' ? function (key) {
29
+ return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
30
+ } : KEY == 'get' ? function get(key) {
31
+ return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
32
+ } : KEY == 'has' ? function has(key) {
33
+ return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
34
+ } : function set(key, value) {
35
+ nativeMethod.call(this, key === 0 ? 0 : key, value);
36
36
  return this;
37
37
  }
38
38
  );
@@ -49,7 +49,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
49
49
  var instance = new Constructor();
50
50
  // early implementations not supports chaining
51
51
  var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
52
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
52
+ // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
53
53
  var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
54
54
  // most early implementations doesn't supports iterables, most modern - not close it correctly
55
55
  // eslint-disable-next-line no-new
@@ -64,9 +64,9 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
64
64
  });
65
65
 
66
66
  if (!ACCEPT_ITERABLES) {
67
- Constructor = wrapper(function (target, iterable) {
68
- anInstance(target, Constructor, CONSTRUCTOR_NAME);
69
- var that = inheritIfRequired(new NativeConstructor(), target, Constructor);
67
+ Constructor = wrapper(function (dummy, iterable) {
68
+ anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
69
+ var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
70
70
  if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
71
71
  return that;
72
72
  });
@@ -1,3 +1,4 @@
1
+ // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
1
2
  var Map = require('../modules/es.map');
2
3
  var WeakMap = require('../modules/es.weak-map');
3
4
  var create = require('../internals/object-create');
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+ var path = require('../internals/path');
3
+ var aFunction = require('../internals/a-function');
4
+ var anObject = require('../internals/an-object');
5
+ var create = require('../internals/object-create');
6
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
7
+ var redefineAll = require('../internals/redefine-all');
8
+ var wellKnownSymbol = require('../internals/well-known-symbol');
9
+ var InternalStateModule = require('../internals/internal-state');
10
+ var getBuiltIn = require('../internals/get-built-in');
11
+
12
+ var Promise = getBuiltIn('Promise');
13
+
14
+ var setInternalState = InternalStateModule.set;
15
+ var getInternalState = InternalStateModule.get;
16
+
17
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
18
+
19
+ var $return = function (value) {
20
+ var iterator = getInternalState(this).iterator;
21
+ var $$return = iterator['return'];
22
+ return $$return === undefined
23
+ ? Promise.resolve({ done: true, value: value })
24
+ : anObject($$return.call(iterator, value));
25
+ };
26
+
27
+ var $throw = function (value) {
28
+ var iterator = getInternalState(this).iterator;
29
+ var $$throw = iterator['throw'];
30
+ return $$throw === undefined
31
+ ? Promise.reject(value)
32
+ : $$throw.call(iterator, value);
33
+ };
34
+
35
+ module.exports = function (nextHandler, IS_ITERATOR) {
36
+ var AsyncIteratorProxy = function AsyncIterator(state) {
37
+ state.next = aFunction(state.iterator.next);
38
+ state.done = false;
39
+ setInternalState(this, state);
40
+ };
41
+
42
+ AsyncIteratorProxy.prototype = redefineAll(create(path.AsyncIterator.prototype), {
43
+ next: function next(arg) {
44
+ var state = getInternalState(this);
45
+ if (state.done) return Promise.resolve({ done: true, value: undefined });
46
+ try {
47
+ return Promise.resolve(anObject(nextHandler.call(state, arg, Promise)));
48
+ } catch (error) {
49
+ return Promise.reject(error);
50
+ }
51
+ },
52
+ 'return': $return,
53
+ 'throw': $throw
54
+ });
55
+
56
+ if (!IS_ITERATOR) {
57
+ createNonEnumerableProperty(AsyncIteratorProxy.prototype, TO_STRING_TAG, 'Generator');
58
+ }
59
+
60
+ return AsyncIteratorProxy;
61
+ };
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+ var path = require('../internals/path');
3
+ var aFunction = require('../internals/a-function');
4
+ var anObject = require('../internals/an-object');
5
+ var create = require('../internals/object-create');
6
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
7
+ var redefineAll = require('../internals/redefine-all');
8
+ var wellKnownSymbol = require('../internals/well-known-symbol');
9
+ var InternalStateModule = require('../internals/internal-state');
10
+
11
+ var setInternalState = InternalStateModule.set;
12
+ var getInternalState = InternalStateModule.get;
13
+
14
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
15
+
16
+ var $return = function (value) {
17
+ var iterator = getInternalState(this).iterator;
18
+ var $$return = iterator['return'];
19
+ return $$return === undefined ? { done: true, value: value } : anObject($$return.call(iterator, value));
20
+ };
21
+
22
+ var $throw = function (value) {
23
+ var iterator = getInternalState(this).iterator;
24
+ var $$throw = iterator['throw'];
25
+ if ($$throw === undefined) throw value;
26
+ return $$throw.call(iterator, value);
27
+ };
28
+
29
+ module.exports = function (nextHandler, IS_ITERATOR) {
30
+ var IteratorProxy = function Iterator(state) {
31
+ state.next = aFunction(state.iterator.next);
32
+ state.done = false;
33
+ setInternalState(this, state);
34
+ };
35
+
36
+ IteratorProxy.prototype = redefineAll(create(path.Iterator.prototype), {
37
+ next: function next() {
38
+ var state = getInternalState(this);
39
+ var result = state.done ? undefined : nextHandler.apply(state, arguments);
40
+ return { done: state.done, value: result };
41
+ },
42
+ 'return': $return,
43
+ 'throw': $throw
44
+ });
45
+
46
+ if (!IS_ITERATOR) {
47
+ createNonEnumerableProperty(IteratorProxy.prototype, TO_STRING_TAG, 'Generator');
48
+ }
49
+
50
+ return IteratorProxy;
51
+ };
@@ -1,13 +1,11 @@
1
1
  'use strict';
2
2
  var fails = require('../internals/fails');
3
+ var padStart = require('../internals/string-pad').start;
3
4
 
4
- var prototype = Date.prototype;
5
- var getTime = prototype.getTime;
6
- var nativeDateToISOString = prototype.toISOString;
7
-
8
- var leadingZero = function (number) {
9
- return number > 9 ? number : '0' + number;
10
- };
5
+ var abs = Math.abs;
6
+ var DatePrototype = Date.prototype;
7
+ var getTime = DatePrototype.getTime;
8
+ var nativeDateToISOString = DatePrototype.toISOString;
11
9
 
12
10
  // `Date.prototype.toISOString` method implementation
13
11
  // https://tc39.github.io/ecma262/#sec-date.prototype.toisostring
@@ -22,12 +20,12 @@ module.exports = (fails(function () {
22
20
  var year = date.getUTCFullYear();
23
21
  var milliseconds = date.getUTCMilliseconds();
24
22
  var sign = year < 0 ? '-' : year > 9999 ? '+' : '';
25
- return sign + ('00000' + Math.abs(year)).slice(sign ? -6 : -4) +
26
- '-' + leadingZero(date.getUTCMonth() + 1) +
27
- '-' + leadingZero(date.getUTCDate()) +
28
- 'T' + leadingZero(date.getUTCHours()) +
29
- ':' + leadingZero(date.getUTCMinutes()) +
30
- ':' + leadingZero(date.getUTCSeconds()) +
31
- '.' + (milliseconds > 99 ? milliseconds : '0' + leadingZero(milliseconds)) +
23
+ return sign + padStart(abs(year), sign ? 6 : 4, 0) +
24
+ '-' + padStart(date.getUTCMonth() + 1, 2, 0) +
25
+ '-' + padStart(date.getUTCDate(), 2, 0) +
26
+ 'T' + padStart(date.getUTCHours(), 2, 0) +
27
+ ':' + padStart(date.getUTCMinutes(), 2, 0) +
28
+ ':' + padStart(date.getUTCSeconds(), 2, 0) +
29
+ '.' + padStart(milliseconds, 3, 0) +
32
30
  'Z';
33
31
  } : nativeDateToISOString;
@@ -4,7 +4,7 @@ var createIteratorConstructor = require('../internals/create-iterator-constructo
4
4
  var getPrototypeOf = require('../internals/object-get-prototype-of');
5
5
  var setPrototypeOf = require('../internals/object-set-prototype-of');
6
6
  var setToStringTag = require('../internals/set-to-string-tag');
7
- var hide = require('../internals/hide');
7
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
8
8
  var redefine = require('../internals/redefine');
9
9
  var wellKnownSymbol = require('../internals/well-known-symbol');
10
10
  var IS_PURE = require('../internals/is-pure');
@@ -51,7 +51,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
51
51
  if (setPrototypeOf) {
52
52
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
53
53
  } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
54
- hide(CurrentIteratorPrototype, ITERATOR, returnThis);
54
+ createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
55
55
  }
56
56
  }
57
57
  // Set @@toStringTag to native iterators
@@ -68,7 +68,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
68
68
 
69
69
  // define iterator
70
70
  if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
71
- hide(IterablePrototype, ITERATOR, defaultIterator);
71
+ createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
72
72
  }
73
73
  Iterators[NAME] = defaultIterator;
74
74
 
@@ -3,8 +3,8 @@ var isObject = require('../internals/is-object');
3
3
 
4
4
  var document = global.document;
5
5
  // typeof document.createElement is 'object' in old IE
6
- var exist = isObject(document) && isObject(document.createElement);
6
+ var EXISTS = isObject(document) && isObject(document.createElement);
7
7
 
8
8
  module.exports = function (it) {
9
- return exist ? document.createElement(it) : {};
9
+ return EXISTS ? document.createElement(it) : {};
10
10
  };
@@ -1,6 +1,6 @@
1
1
  var global = require('../internals/global');
2
2
  var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
3
- var hide = require('../internals/hide');
3
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
4
4
  var redefine = require('../internals/redefine');
5
5
  var setGlobal = require('../internals/set-global');
6
6
  var copyConstructorProperties = require('../internals/copy-constructor-properties');
@@ -46,7 +46,7 @@ module.exports = function (options, source) {
46
46
  }
47
47
  // add a flag to not completely full polyfills
48
48
  if (options.sham || (targetProperty && targetProperty.sham)) {
49
- hide(sourceProperty, 'sham', true);
49
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
50
50
  }
51
51
  // extend global
52
52
  redefine(target, key, sourceProperty, options);
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- var hide = require('../internals/hide');
2
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
3
3
  var redefine = require('../internals/redefine');
4
4
  var fails = require('../internals/fails');
5
5
  var wellKnownSymbol = require('../internals/well-known-symbol');
@@ -88,6 +88,6 @@ module.exports = function (KEY, length, exec, sham) {
88
88
  // 21.2.5.9 RegExp.prototype[@@search](string)
89
89
  : function (string) { return regexMethod.call(string, this); }
90
90
  );
91
- if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
91
+ if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
92
92
  }
93
93
  };
@@ -2,7 +2,7 @@
2
2
  var aFunction = require('../internals/a-function');
3
3
  var isObject = require('../internals/is-object');
4
4
 
5
- var arraySlice = [].slice;
5
+ var slice = [].slice;
6
6
  var factories = {};
7
7
 
8
8
  var construct = function (C, argsLength, args) {
@@ -17,9 +17,9 @@ var construct = function (C, argsLength, args) {
17
17
  // https://tc39.github.io/ecma262/#sec-function.prototype.bind
18
18
  module.exports = Function.bind || function bind(that /* , ...args */) {
19
19
  var fn = aFunction(this);
20
- var partArgs = arraySlice.call(arguments, 1);
20
+ var partArgs = slice.call(arguments, 1);
21
21
  var boundFunction = function bound(/* args... */) {
22
- var args = partArgs.concat(arraySlice.call(arguments));
22
+ var args = partArgs.concat(slice.call(arguments));
23
23
  return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);
24
24
  };
25
25
  if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;
@@ -0,0 +1,9 @@
1
+ var getIteratorMethod = require('../internals/get-iterator-method');
2
+ var wellKnownSymbol = require('../internals/well-known-symbol');
3
+
4
+ var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
5
+
6
+ module.exports = function (it) {
7
+ var method = it[ASYNC_ITERATOR];
8
+ return method === undefined ? getIteratorMethod(it) : method;
9
+ };
@@ -1,4 +1,3 @@
1
- var O = 'object';
2
1
  var check = function (it) {
3
2
  return it && it.Math == Math && it;
4
3
  };
@@ -6,9 +5,9 @@ var check = function (it) {
6
5
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
7
6
  module.exports =
8
7
  // eslint-disable-next-line no-undef
9
- check(typeof globalThis == O && globalThis) ||
10
- check(typeof window == O && window) ||
11
- check(typeof self == O && self) ||
12
- check(typeof global == O && global) ||
8
+ check(typeof globalThis == 'object' && globalThis) ||
9
+ check(typeof window == 'object' && window) ||
10
+ check(typeof self == 'object' && self) ||
11
+ check(typeof global == 'object' && global) ||
13
12
  // eslint-disable-next-line no-new-func
14
13
  Function('return this')();
package/internals/html.js CHANGED
@@ -1,5 +1,3 @@
1
- var global = require('../internals/global');
1
+ var getBuiltIn = require('../internals/get-built-in');
2
2
 
3
- var document = global.document;
4
-
5
- module.exports = document && document.documentElement;
3
+ module.exports = getBuiltIn('document', 'documentElement');
@@ -1,9 +1,9 @@
1
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
2
1
  var fails = require('../internals/fails');
3
2
  var classof = require('../internals/classof-raw');
4
3
 
5
4
  var split = ''.split;
6
5
 
6
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
7
7
  module.exports = fails(function () {
8
8
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
9
9
  // eslint-disable-next-line no-prototype-builtins
@@ -1,10 +1,17 @@
1
1
  var isObject = require('../internals/is-object');
2
2
  var setPrototypeOf = require('../internals/object-set-prototype-of');
3
3
 
4
- module.exports = function (that, target, C) {
5
- var S = target.constructor;
6
- var P;
7
- if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
8
- setPrototypeOf(that, P);
9
- } return that;
4
+ // makes subclassing work correct for wrapped built-ins
5
+ module.exports = function ($this, dummy, Wrapper) {
6
+ var NewTarget, NewTargetPrototype;
7
+ if (
8
+ // it can work only with native `setPrototypeOf`
9
+ setPrototypeOf &&
10
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
11
+ typeof (NewTarget = dummy.constructor) == 'function' &&
12
+ NewTarget !== Wrapper &&
13
+ isObject(NewTargetPrototype = NewTarget.prototype) &&
14
+ NewTargetPrototype !== Wrapper.prototype
15
+ ) setPrototypeOf($this, NewTargetPrototype);
16
+ return $this;
10
17
  };
@@ -1,7 +1,7 @@
1
1
  var NATIVE_WEAK_MAP = require('../internals/native-weak-map');
2
2
  var global = require('../internals/global');
3
3
  var isObject = require('../internals/is-object');
4
- var hide = require('../internals/hide');
4
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
5
5
  var objectHas = require('../internals/has');
6
6
  var sharedKey = require('../internals/shared-key');
7
7
  var hiddenKeys = require('../internals/hidden-keys');
@@ -41,7 +41,7 @@ if (NATIVE_WEAK_MAP) {
41
41
  var STATE = sharedKey('state');
42
42
  hiddenKeys[STATE] = true;
43
43
  set = function (it, metadata) {
44
- hide(it, STATE, metadata);
44
+ createNonEnumerableProperty(it, STATE, metadata);
45
45
  return metadata;
46
46
  };
47
47
  get = function (it) {
@@ -5,13 +5,16 @@ var bind = require('../internals/bind-context');
5
5
  var getIteratorMethod = require('../internals/get-iterator-method');
6
6
  var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
7
7
 
8
- var BREAK = {};
8
+ var Result = function (stopped, result) {
9
+ this.stopped = stopped;
10
+ this.result = result;
11
+ };
9
12
 
10
- var exports = module.exports = function (iterable, fn, that, ENTRIES, ITERATOR) {
11
- var boundFunction = bind(fn, that, ENTRIES ? 2 : 1);
12
- var iterator, iterFn, index, length, result, step;
13
+ var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
14
+ var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);
15
+ var iterator, iterFn, index, length, result, next, step;
13
16
 
14
- if (ITERATOR) {
17
+ if (IS_ITERATOR) {
15
18
  iterator = iterable;
16
19
  } else {
17
20
  iterFn = getIteratorMethod(iterable);
@@ -19,16 +22,22 @@ var exports = module.exports = function (iterable, fn, that, ENTRIES, ITERATOR)
19
22
  // optimisation for array iterators
20
23
  if (isArrayIteratorMethod(iterFn)) {
21
24
  for (index = 0, length = toLength(iterable.length); length > index; index++) {
22
- result = ENTRIES ? boundFunction(anObject(step = iterable[index])[0], step[1]) : boundFunction(iterable[index]);
23
- if (result === BREAK) return BREAK;
24
- } return;
25
+ result = AS_ENTRIES
26
+ ? boundFunction(anObject(step = iterable[index])[0], step[1])
27
+ : boundFunction(iterable[index]);
28
+ if (result && result instanceof Result) return result;
29
+ } return new Result(false);
25
30
  }
26
31
  iterator = iterFn.call(iterable);
27
32
  }
28
33
 
29
- while (!(step = iterator.next()).done) {
30
- if (callWithSafeIterationClosing(iterator, boundFunction, step.value, ENTRIES) === BREAK) return BREAK;
31
- }
34
+ next = iterator.next;
35
+ while (!(step = next.call(iterator)).done) {
36
+ result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
37
+ if (typeof result == 'object' && result && result instanceof Result) return result;
38
+ } return new Result(false);
32
39
  };
33
40
 
34
- exports.BREAK = BREAK;
41
+ iterate.stop = function (result) {
42
+ return new Result(true, result);
43
+ };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  var getPrototypeOf = require('../internals/object-get-prototype-of');
3
- var hide = require('../internals/hide');
3
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
4
4
  var has = require('../internals/has');
5
5
  var wellKnownSymbol = require('../internals/well-known-symbol');
6
6
  var IS_PURE = require('../internals/is-pure');
@@ -27,7 +27,9 @@ if ([].keys) {
27
27
  if (IteratorPrototype == undefined) IteratorPrototype = {};
28
28
 
29
29
  // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
30
- if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
30
+ if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
31
+ createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
32
+ }
31
33
 
32
34
  module.exports = {
33
35
  IteratorPrototype: IteratorPrototype,
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+ var anObject = require('../internals/an-object');
3
+
4
+ // `Map.prototype.upsert` method
5
+ // https://github.com/thumbsupep/proposal-upsert
6
+ module.exports = function upsert(key, updateFn /* , insertFn */) {
7
+ var map = anObject(this);
8
+ var insertFn = arguments.length > 2 ? arguments[2] : undefined;
9
+ var value;
10
+ if (typeof updateFn != 'function' && typeof insertFn != 'function') {
11
+ throw TypeError('At least one callback required');
12
+ }
13
+ if (map.has(key)) {
14
+ value = map.get(key);
15
+ if (typeof updateFn == 'function') {
16
+ value = updateFn(value);
17
+ map.set(key, value);
18
+ }
19
+ } else if (typeof insertFn == 'function') {
20
+ value = insertFn();
21
+ map.set(key, value);
22
+ } return value;
23
+ };
@@ -1,4 +1,5 @@
1
1
  var nativeExpm1 = Math.expm1;
2
+ var exp = Math.exp;
2
3
 
3
4
  // `Math.expm1` method implementation
4
5
  // https://tc39.github.io/ecma262/#sec-math.expm1
@@ -8,5 +9,5 @@ module.exports = (!nativeExpm1
8
9
  // Tor Browser bug
9
10
  || nativeExpm1(-2e-17) != -2e-17
10
11
  ) ? function expm1(x) {
11
- return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
12
+ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
12
13
  } : nativeExpm1;
@@ -1,5 +1,6 @@
1
1
  var sign = require('../internals/math-sign');
2
2
 
3
+ var abs = Math.abs;
3
4
  var pow = Math.pow;
4
5
  var EPSILON = pow(2, -52);
5
6
  var EPSILON32 = pow(2, -23);
@@ -13,7 +14,7 @@ var roundTiesToEven = function (n) {
13
14
  // `Math.fround` method implementation
14
15
  // https://tc39.github.io/ecma262/#sec-math.fround
15
16
  module.exports = Math.fround || function fround(x) {
16
- var $abs = Math.abs(x);
17
+ var $abs = abs(x);
17
18
  var $sign = sign(x);
18
19
  var a, result;
19
20
  if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
@@ -1,5 +1,7 @@
1
+ var log = Math.log;
2
+
1
3
  // `Math.log1p` method implementation
2
4
  // https://tc39.github.io/ecma262/#sec-math.log1p
3
5
  module.exports = Math.log1p || function log1p(x) {
4
- return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
6
+ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
5
7
  };
@@ -12,7 +12,7 @@ var IS_NODE = classof(process) == 'process';
12
12
  var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
13
13
  var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
14
14
 
15
- var flush, head, last, notify, toggle, node, promise;
15
+ var flush, head, last, notify, toggle, node, promise, then;
16
16
 
17
17
  // modern engines have queueMicrotask method
18
18
  if (!queueMicrotask) {
@@ -42,7 +42,7 @@ if (!queueMicrotask) {
42
42
  } else if (MutationObserver && !/(iphone|ipod|ipad).*applewebkit/i.test(userAgent)) {
43
43
  toggle = true;
44
44
  node = document.createTextNode('');
45
- new MutationObserver(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
45
+ new MutationObserver(flush).observe(node, { characterData: true });
46
46
  notify = function () {
47
47
  node.data = toggle = !toggle;
48
48
  };
@@ -50,8 +50,9 @@ if (!queueMicrotask) {
50
50
  } else if (Promise && Promise.resolve) {
51
51
  // Promise.resolve without an argument throws an error in LG WebOS 2
52
52
  promise = Promise.resolve(undefined);
53
+ then = promise.then;
53
54
  notify = function () {
54
- promise.then(flush);
55
+ then.call(promise, flush);
55
56
  };
56
57
  // for other environments - macrotask based on:
57
58
  // - setImmediate
@@ -0,0 +1,3 @@
1
+ var global = require('../internals/global');
2
+
3
+ module.exports = global.Promise;
@@ -5,13 +5,18 @@ var IS_PURE = require('../internals/is-pure');
5
5
  var ITERATOR = wellKnownSymbol('iterator');
6
6
 
7
7
  module.exports = !fails(function () {
8
- var url = new URL('b?e=1', 'http://a');
8
+ var url = new URL('b?a=1&b=2&c=3', 'http://a');
9
9
  var searchParams = url.searchParams;
10
+ var result = '';
10
11
  url.pathname = 'c%20d';
12
+ searchParams.forEach(function (value, key) {
13
+ searchParams['delete']('b');
14
+ result += key + value;
15
+ });
11
16
  return (IS_PURE && !url.toJSON)
12
17
  || !searchParams.sort
13
- || url.href !== 'http://a/c%20d?e=1'
14
- || searchParams.get('e') !== '1'
18
+ || url.href !== 'http://a/c%20d?a=1&c=3'
19
+ || searchParams.get('c') !== '3'
15
20
  || String(new URLSearchParams('?a=1')) !== 'a=1'
16
21
  || !searchParams[ITERATOR]
17
22
  // throws in Edge
@@ -20,5 +25,9 @@ module.exports = !fails(function () {
20
25
  // not punycoded in Edge
21
26
  || new URL('http://тест').host !== 'xn--e1aybc'
22
27
  // not escaped in Chrome 62-
23
- || new URL('http://a#б').hash !== '#%D0%B1';
28
+ || new URL('http://a#б').hash !== '#%D0%B1'
29
+ // fails in Chrome 66-
30
+ || result !== 'a1c3'
31
+ // throws in Safari
32
+ || new URL('http://x', undefined).host !== 'x';
24
33
  });
@@ -0,0 +1,7 @@
1
+ var isRegExp = require('../internals/is-regexp');
2
+
3
+ module.exports = function (it) {
4
+ if (isRegExp(it)) {
5
+ throw TypeError("The method doesn't accept regular expressions");
6
+ } return it;
7
+ };
@@ -9,7 +9,8 @@ var IndexedObject = require('../internals/indexed-object');
9
9
 
10
10
  var nativeAssign = Object.assign;
11
11
 
12
- // 19.1.2.1 Object.assign(target, source, ...)
12
+ // `Object.assign` method
13
+ // https://tc39.github.io/ecma262/#sec-object.assign
13
14
  // should work with symbols and should have deterministic property order (V8 bug)
14
15
  module.exports = !nativeAssign || fails(function () {
15
16
  var A = {};
@@ -32,7 +32,8 @@ var createDict = function () {
32
32
  return createDict();
33
33
  };
34
34
 
35
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
35
+ // `Object.create` method
36
+ // https://tc39.github.io/ecma262/#sec-object.create
36
37
  module.exports = Object.create || function create(O, Properties) {
37
38
  var result;
38
39
  if (O !== null) {