From 466d5c52658ba997b0a3b77b9ff18bb2b67b8ca6 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Wed, 25 Sep 2019 13:30:05 +0530 Subject: [PATCH] New upstream version 12.0.9 --- core-js/LICENSE | 19 + core-js/README.md | 58 + core-js/configurator.js | 16 + core-js/es/README.md | 1 + core-js/es/array-buffer/constructor.js | 5 + core-js/es/array-buffer/index.js | 7 + core-js/es/array-buffer/is-view.js | 4 + core-js/es/array-buffer/slice.js | 1 + core-js/es/array/concat.js | 4 + core-js/es/array/copy-within.js | 4 + core-js/es/array/entries.js | 4 + core-js/es/array/every.js | 4 + core-js/es/array/fill.js | 4 + core-js/es/array/filter.js | 4 + core-js/es/array/find-index.js | 4 + core-js/es/array/find.js | 4 + core-js/es/array/flat-map.js | 5 + core-js/es/array/flat.js | 5 + core-js/es/array/for-each.js | 4 + core-js/es/array/from.js | 5 + core-js/es/array/includes.js | 4 + core-js/es/array/index-of.js | 4 + core-js/es/array/index.js | 33 + core-js/es/array/is-array.js | 4 + core-js/es/array/iterator.js | 4 + core-js/es/array/join.js | 4 + core-js/es/array/keys.js | 4 + core-js/es/array/last-index-of.js | 4 + core-js/es/array/map.js | 4 + core-js/es/array/of.js | 4 + core-js/es/array/reduce-right.js | 4 + core-js/es/array/reduce.js | 4 + core-js/es/array/reverse.js | 4 + core-js/es/array/slice.js | 4 + core-js/es/array/some.js | 4 + core-js/es/array/sort.js | 4 + core-js/es/array/splice.js | 4 + core-js/es/array/values.js | 4 + core-js/es/array/virtual/concat.js | 4 + core-js/es/array/virtual/copy-within.js | 4 + core-js/es/array/virtual/entries.js | 4 + core-js/es/array/virtual/every.js | 4 + core-js/es/array/virtual/fill.js | 4 + core-js/es/array/virtual/filter.js | 4 + core-js/es/array/virtual/find-index.js | 4 + core-js/es/array/virtual/find.js | 4 + core-js/es/array/virtual/flat-map.js | 5 + core-js/es/array/virtual/flat.js | 5 + core-js/es/array/virtual/for-each.js | 4 + core-js/es/array/virtual/includes.js | 4 + core-js/es/array/virtual/index-of.js | 4 + core-js/es/array/virtual/index.js | 29 + core-js/es/array/virtual/iterator.js | 4 + core-js/es/array/virtual/join.js | 4 + core-js/es/array/virtual/keys.js | 4 + core-js/es/array/virtual/last-index-of.js | 4 + core-js/es/array/virtual/map.js | 4 + core-js/es/array/virtual/reduce-right.js | 4 + core-js/es/array/virtual/reduce.js | 4 + core-js/es/array/virtual/reverse.js | 4 + core-js/es/array/virtual/slice.js | 4 + core-js/es/array/virtual/some.js | 4 + core-js/es/array/virtual/sort.js | 4 + core-js/es/array/virtual/splice.js | 4 + core-js/es/array/virtual/values.js | 4 + core-js/es/data-view/index.js | 5 + core-js/es/date/index.js | 8 + core-js/es/date/now.js | 4 + core-js/es/date/to-iso-string.js | 5 + core-js/es/date/to-json.js | 4 + core-js/es/date/to-primitive.js | 6 + core-js/es/date/to-string.js | 6 + core-js/es/function/bind.js | 4 + core-js/es/function/has-instance.js | 4 + core-js/es/function/index.js | 6 + core-js/es/function/name.js | 1 + core-js/es/function/virtual/bind.js | 4 + core-js/es/function/virtual/index.js | 4 + core-js/es/index.js | 205 ++++ core-js/es/instance/bind.js | 8 + core-js/es/instance/code-point-at.js | 9 + core-js/es/instance/concat.js | 8 + core-js/es/instance/copy-within.js | 8 + core-js/es/instance/ends-with.js | 9 + core-js/es/instance/entries.js | 8 + core-js/es/instance/every.js | 8 + core-js/es/instance/fill.js | 8 + core-js/es/instance/filter.js | 8 + core-js/es/instance/find-index.js | 8 + core-js/es/instance/find.js | 8 + core-js/es/instance/flags.js | 7 + core-js/es/instance/flat-map.js | 8 + core-js/es/instance/flat.js | 8 + core-js/es/instance/for-each.js | 8 + core-js/es/instance/includes.js | 13 + core-js/es/instance/index-of.js | 8 + core-js/es/instance/keys.js | 8 + core-js/es/instance/last-index-of.js | 8 + core-js/es/instance/map.js | 8 + core-js/es/instance/match-all.js | 9 + core-js/es/instance/pad-end.js | 9 + core-js/es/instance/pad-start.js | 9 + core-js/es/instance/reduce-right.js | 8 + core-js/es/instance/reduce.js | 8 + core-js/es/instance/repeat.js | 9 + core-js/es/instance/reverse.js | 8 + core-js/es/instance/slice.js | 8 + core-js/es/instance/some.js | 8 + core-js/es/instance/sort.js | 8 + core-js/es/instance/splice.js | 8 + core-js/es/instance/starts-with.js | 9 + core-js/es/instance/trim-end.js | 9 + core-js/es/instance/trim-left.js | 9 + core-js/es/instance/trim-right.js | 9 + core-js/es/instance/trim-start.js | 9 + core-js/es/instance/trim.js | 9 + core-js/es/instance/values.js | 8 + core-js/es/json/index.js | 4 + core-js/es/json/stringify.js | 6 + core-js/es/json/to-string-tag.js | 3 + core-js/es/map/index.js | 7 + core-js/es/math/acosh.js | 4 + core-js/es/math/asinh.js | 4 + core-js/es/math/atanh.js | 4 + core-js/es/math/cbrt.js | 4 + core-js/es/math/clz32.js | 4 + core-js/es/math/cosh.js | 4 + core-js/es/math/expm1.js | 4 + core-js/es/math/fround.js | 4 + core-js/es/math/hypot.js | 4 + core-js/es/math/imul.js | 4 + core-js/es/math/index.js | 21 + core-js/es/math/log10.js | 4 + core-js/es/math/log1p.js | 4 + core-js/es/math/log2.js | 4 + core-js/es/math/sign.js | 4 + core-js/es/math/sinh.js | 4 + core-js/es/math/tanh.js | 4 + core-js/es/math/to-string-tag.js | 3 + core-js/es/math/trunc.js | 4 + core-js/es/number/constructor.js | 3 + core-js/es/number/epsilon.js | 3 + core-js/es/number/index.js | 15 + core-js/es/number/is-finite.js | 4 + core-js/es/number/is-integer.js | 4 + core-js/es/number/is-nan.js | 4 + core-js/es/number/is-safe-integer.js | 4 + core-js/es/number/max-safe-integer.js | 3 + core-js/es/number/min-safe-integer.js | 3 + core-js/es/number/parse-float.js | 4 + core-js/es/number/parse-int.js | 4 + core-js/es/number/to-fixed.js | 4 + core-js/es/number/to-precision.js | 4 + core-js/es/number/virtual/index.js | 5 + core-js/es/number/virtual/to-fixed.js | 4 + core-js/es/number/virtual/to-precision.js | 4 + core-js/es/object/assign.js | 4 + core-js/es/object/create.js | 8 + core-js/es/object/define-getter.js | 4 + core-js/es/object/define-properties.js | 10 + core-js/es/object/define-property.js | 10 + core-js/es/object/define-setter.js | 4 + core-js/es/object/entries.js | 4 + core-js/es/object/freeze.js | 4 + core-js/es/object/from-entries.js | 5 + .../es/object/get-own-property-descriptor.js | 10 + .../es/object/get-own-property-descriptors.js | 4 + core-js/es/object/get-own-property-names.js | 8 + core-js/es/object/get-own-property-symbols.js | 4 + core-js/es/object/get-prototype-of.js | 4 + core-js/es/object/index.js | 31 + core-js/es/object/is-extensible.js | 4 + core-js/es/object/is-frozen.js | 4 + core-js/es/object/is-sealed.js | 4 + core-js/es/object/is.js | 4 + core-js/es/object/keys.js | 4 + core-js/es/object/lookup-getter.js | 4 + core-js/es/object/lookup-setter.js | 4 + core-js/es/object/prevent-extensions.js | 4 + core-js/es/object/seal.js | 4 + core-js/es/object/set-prototype-of.js | 4 + core-js/es/object/to-string.js | 8 + core-js/es/object/values.js | 4 + core-js/es/parse-float.js | 4 + core-js/es/parse-int.js | 4 + core-js/es/promise/all-settled.js | 11 + core-js/es/promise/finally.js | 5 + core-js/es/promise/index.js | 9 + core-js/es/reflect/apply.js | 4 + core-js/es/reflect/construct.js | 4 + core-js/es/reflect/define-property.js | 4 + core-js/es/reflect/delete-property.js | 4 + .../es/reflect/get-own-property-descriptor.js | 4 + core-js/es/reflect/get-prototype-of.js | 4 + core-js/es/reflect/get.js | 4 + core-js/es/reflect/has.js | 4 + core-js/es/reflect/index.js | 16 + core-js/es/reflect/is-extensible.js | 4 + core-js/es/reflect/own-keys.js | 4 + core-js/es/reflect/prevent-extensions.js | 4 + core-js/es/reflect/set-prototype-of.js | 4 + core-js/es/reflect/set.js | 4 + core-js/es/regexp/constructor.js | 3 + core-js/es/regexp/flags.js | 6 + core-js/es/regexp/index.js | 8 + core-js/es/regexp/match.js | 8 + core-js/es/regexp/replace.js | 8 + core-js/es/regexp/search.js | 8 + core-js/es/regexp/split.js | 8 + core-js/es/regexp/to-string.js | 5 + core-js/es/set/index.js | 7 + core-js/es/string/anchor.js | 4 + core-js/es/string/big.js | 4 + core-js/es/string/blink.js | 4 + core-js/es/string/bold.js | 4 + core-js/es/string/code-point-at.js | 4 + core-js/es/string/ends-with.js | 4 + core-js/es/string/fixed.js | 4 + core-js/es/string/fontcolor.js | 4 + core-js/es/string/fontsize.js | 4 + core-js/es/string/from-code-point.js | 4 + core-js/es/string/includes.js | 4 + core-js/es/string/index.js | 34 + core-js/es/string/italics.js | 4 + core-js/es/string/iterator.js | 8 + core-js/es/string/link.js | 4 + core-js/es/string/match-all.js | 4 + core-js/es/string/match.js | 4 + core-js/es/string/pad-end.js | 4 + core-js/es/string/pad-start.js | 4 + core-js/es/string/raw.js | 4 + core-js/es/string/repeat.js | 4 + core-js/es/string/replace.js | 4 + core-js/es/string/search.js | 4 + core-js/es/string/small.js | 4 + core-js/es/string/split.js | 4 + core-js/es/string/starts-with.js | 4 + core-js/es/string/strike.js | 4 + core-js/es/string/sub.js | 4 + core-js/es/string/sup.js | 4 + core-js/es/string/trim-end.js | 4 + core-js/es/string/trim-left.js | 4 + core-js/es/string/trim-right.js | 4 + core-js/es/string/trim-start.js | 4 + core-js/es/string/trim.js | 4 + core-js/es/string/virtual/anchor.js | 4 + core-js/es/string/virtual/big.js | 4 + core-js/es/string/virtual/blink.js | 4 + core-js/es/string/virtual/bold.js | 4 + core-js/es/string/virtual/code-point-at.js | 4 + core-js/es/string/virtual/ends-with.js | 4 + core-js/es/string/virtual/fixed.js | 4 + core-js/es/string/virtual/fontcolor.js | 4 + core-js/es/string/virtual/fontsize.js | 4 + core-js/es/string/virtual/includes.js | 4 + core-js/es/string/virtual/index.js | 32 + core-js/es/string/virtual/italics.js | 4 + core-js/es/string/virtual/iterator.js | 4 + core-js/es/string/virtual/link.js | 4 + core-js/es/string/virtual/match-all.js | 4 + core-js/es/string/virtual/pad-end.js | 4 + core-js/es/string/virtual/pad-start.js | 4 + core-js/es/string/virtual/repeat.js | 4 + core-js/es/string/virtual/small.js | 4 + core-js/es/string/virtual/starts-with.js | 4 + core-js/es/string/virtual/strike.js | 4 + core-js/es/string/virtual/sub.js | 4 + core-js/es/string/virtual/sup.js | 4 + core-js/es/string/virtual/trim-end.js | 4 + core-js/es/string/virtual/trim-left.js | 4 + core-js/es/string/virtual/trim-right.js | 4 + core-js/es/string/virtual/trim-start.js | 4 + core-js/es/string/virtual/trim.js | 4 + core-js/es/symbol/async-iterator.js | 4 + core-js/es/symbol/description.js | 1 + core-js/es/symbol/for.js | 4 + core-js/es/symbol/has-instance.js | 5 + core-js/es/symbol/index.js | 22 + core-js/es/symbol/is-concat-spreadable.js | 5 + core-js/es/symbol/iterator.js | 6 + core-js/es/symbol/key-for.js | 4 + core-js/es/symbol/match-all.js | 5 + core-js/es/symbol/match.js | 5 + core-js/es/symbol/replace.js | 5 + core-js/es/symbol/search.js | 5 + core-js/es/symbol/species.js | 4 + core-js/es/symbol/split.js | 5 + core-js/es/symbol/to-primitive.js | 4 + core-js/es/symbol/to-string-tag.js | 7 + core-js/es/symbol/unscopables.js | 4 + core-js/es/typed-array/copy-within.js | 1 + core-js/es/typed-array/entries.js | 1 + core-js/es/typed-array/every.js | 1 + core-js/es/typed-array/fill.js | 1 + core-js/es/typed-array/filter.js | 1 + core-js/es/typed-array/find-index.js | 1 + core-js/es/typed-array/find.js | 1 + core-js/es/typed-array/float32-array.js | 5 + core-js/es/typed-array/float64-array.js | 5 + core-js/es/typed-array/for-each.js | 1 + core-js/es/typed-array/from.js | 1 + core-js/es/typed-array/includes.js | 1 + core-js/es/typed-array/index-of.js | 1 + core-js/es/typed-array/index.js | 12 + core-js/es/typed-array/int16-array.js | 5 + core-js/es/typed-array/int32-array.js | 5 + core-js/es/typed-array/int8-array.js | 5 + core-js/es/typed-array/iterator.js | 1 + core-js/es/typed-array/join.js | 1 + core-js/es/typed-array/keys.js | 1 + core-js/es/typed-array/last-index-of.js | 1 + core-js/es/typed-array/map.js | 1 + core-js/es/typed-array/methods.js | 26 + core-js/es/typed-array/of.js | 1 + core-js/es/typed-array/reduce-right.js | 1 + core-js/es/typed-array/reduce.js | 1 + core-js/es/typed-array/reverse.js | 1 + core-js/es/typed-array/set.js | 1 + core-js/es/typed-array/slice.js | 1 + core-js/es/typed-array/some.js | 1 + core-js/es/typed-array/sort.js | 1 + core-js/es/typed-array/subarray.js | 1 + core-js/es/typed-array/to-locale-string.js | 1 + core-js/es/typed-array/to-string.js | 1 + core-js/es/typed-array/uint16-array.js | 5 + core-js/es/typed-array/uint32-array.js | 5 + core-js/es/typed-array/uint8-array.js | 5 + core-js/es/typed-array/uint8-clamped-array.js | 5 + core-js/es/typed-array/values.js | 1 + core-js/es/weak-map/index.js | 6 + core-js/es/weak-set/index.js | 6 + core-js/features/README.md | 1 + core-js/features/aggregate-error.js | 6 + core-js/features/array-buffer/constructor.js | 1 + core-js/features/array-buffer/index.js | 1 + core-js/features/array-buffer/is-view.js | 1 + core-js/features/array-buffer/slice.js | 1 + core-js/features/array/concat.js | 1 + core-js/features/array/copy-within.js | 1 + core-js/features/array/entries.js | 1 + core-js/features/array/every.js | 1 + core-js/features/array/fill.js | 1 + core-js/features/array/filter.js | 1 + core-js/features/array/find-index.js | 1 + core-js/features/array/find.js | 1 + core-js/features/array/flat-map.js | 1 + core-js/features/array/flat.js | 1 + core-js/features/array/for-each.js | 1 + core-js/features/array/from.js | 1 + core-js/features/array/includes.js | 1 + core-js/features/array/index-of.js | 1 + core-js/features/array/index.js | 5 + core-js/features/array/is-array.js | 1 + core-js/features/array/is-template-object.js | 4 + core-js/features/array/iterator.js | 1 + core-js/features/array/join.js | 1 + core-js/features/array/keys.js | 1 + core-js/features/array/last-index-of.js | 1 + core-js/features/array/last-index.js | 1 + core-js/features/array/last-item.js | 1 + core-js/features/array/map.js | 1 + core-js/features/array/of.js | 1 + core-js/features/array/reduce-right.js | 1 + core-js/features/array/reduce.js | 1 + core-js/features/array/reverse.js | 1 + core-js/features/array/slice.js | 1 + core-js/features/array/some.js | 1 + core-js/features/array/sort.js | 1 + core-js/features/array/splice.js | 1 + core-js/features/array/values.js | 1 + core-js/features/array/virtual/concat.js | 1 + core-js/features/array/virtual/copy-within.js | 1 + core-js/features/array/virtual/entries.js | 1 + core-js/features/array/virtual/every.js | 1 + core-js/features/array/virtual/fill.js | 1 + core-js/features/array/virtual/filter.js | 1 + core-js/features/array/virtual/find-index.js | 1 + core-js/features/array/virtual/find.js | 1 + core-js/features/array/virtual/flat-map.js | 1 + core-js/features/array/virtual/flat.js | 1 + core-js/features/array/virtual/for-each.js | 1 + core-js/features/array/virtual/includes.js | 1 + core-js/features/array/virtual/index-of.js | 1 + core-js/features/array/virtual/index.js | 1 + core-js/features/array/virtual/iterator.js | 1 + core-js/features/array/virtual/join.js | 1 + core-js/features/array/virtual/keys.js | 1 + .../features/array/virtual/last-index-of.js | 1 + core-js/features/array/virtual/map.js | 1 + .../features/array/virtual/reduce-right.js | 1 + core-js/features/array/virtual/reduce.js | 1 + core-js/features/array/virtual/reverse.js | 1 + core-js/features/array/virtual/slice.js | 1 + core-js/features/array/virtual/some.js | 1 + core-js/features/array/virtual/sort.js | 1 + core-js/features/array/virtual/splice.js | 1 + core-js/features/array/virtual/values.js | 1 + core-js/features/clear-immediate.js | 1 + core-js/features/composite-key.js | 4 + core-js/features/composite-symbol.js | 5 + core-js/features/data-view/index.js | 1 + core-js/features/date/index.js | 1 + core-js/features/date/now.js | 1 + core-js/features/date/to-iso-string.js | 1 + core-js/features/date/to-json.js | 1 + core-js/features/date/to-primitive.js | 1 + core-js/features/date/to-string.js | 1 + core-js/features/dom-collections/for-each.js | 1 + core-js/features/dom-collections/index.js | 1 + core-js/features/dom-collections/iterator.js | 1 + core-js/features/function/bind.js | 1 + core-js/features/function/has-instance.js | 1 + core-js/features/function/index.js | 1 + core-js/features/function/name.js | 1 + core-js/features/function/virtual/bind.js | 1 + core-js/features/function/virtual/index.js | 1 + core-js/features/get-iterator-method.js | 4 + core-js/features/get-iterator.js | 4 + core-js/features/global-this.js | 3 + core-js/features/index.js | 1 + core-js/features/instance/at.js | 9 + core-js/features/instance/bind.js | 1 + core-js/features/instance/code-point-at.js | 1 + core-js/features/instance/code-points.js | 9 + core-js/features/instance/concat.js | 1 + core-js/features/instance/copy-within.js | 1 + core-js/features/instance/ends-with.js | 1 + core-js/features/instance/entries.js | 1 + core-js/features/instance/every.js | 1 + core-js/features/instance/fill.js | 1 + core-js/features/instance/filter.js | 1 + core-js/features/instance/find-index.js | 1 + core-js/features/instance/find.js | 1 + core-js/features/instance/flags.js | 1 + core-js/features/instance/flat-map.js | 1 + core-js/features/instance/flat.js | 1 + core-js/features/instance/for-each.js | 1 + core-js/features/instance/includes.js | 1 + core-js/features/instance/index-of.js | 1 + core-js/features/instance/keys.js | 1 + core-js/features/instance/last-index-of.js | 1 + core-js/features/instance/map.js | 1 + core-js/features/instance/match-all.js | 1 + core-js/features/instance/pad-end.js | 1 + core-js/features/instance/pad-start.js | 1 + core-js/features/instance/reduce-right.js | 1 + core-js/features/instance/reduce.js | 1 + core-js/features/instance/repeat.js | 1 + core-js/features/instance/replace-all.js | 9 + core-js/features/instance/reverse.js | 1 + core-js/features/instance/slice.js | 1 + core-js/features/instance/some.js | 1 + core-js/features/instance/sort.js | 1 + core-js/features/instance/splice.js | 1 + core-js/features/instance/starts-with.js | 1 + core-js/features/instance/trim-end.js | 1 + core-js/features/instance/trim-left.js | 1 + core-js/features/instance/trim-right.js | 1 + core-js/features/instance/trim-start.js | 1 + core-js/features/instance/trim.js | 1 + core-js/features/instance/values.js | 1 + core-js/features/is-iterable.js | 4 + core-js/features/json/index.js | 1 + core-js/features/json/stringify.js | 1 + core-js/features/json/to-string-tag.js | 1 + core-js/features/map/delete-all.js | 5 + core-js/features/map/every.js | 5 + core-js/features/map/filter.js | 5 + core-js/features/map/find-key.js | 5 + core-js/features/map/find.js | 5 + core-js/features/map/from.js | 13 + core-js/features/map/group-by.js | 11 + core-js/features/map/includes.js | 5 + core-js/features/map/index.js | 20 + core-js/features/map/key-by.js | 11 + core-js/features/map/key-of.js | 5 + core-js/features/map/map-keys.js | 5 + core-js/features/map/map-values.js | 5 + core-js/features/map/merge.js | 5 + core-js/features/map/of.js | 13 + core-js/features/map/reduce.js | 5 + core-js/features/map/some.js | 5 + core-js/features/map/update-or-insert.js | 5 + core-js/features/map/update.js | 5 + core-js/features/math/acosh.js | 1 + core-js/features/math/asinh.js | 1 + core-js/features/math/atanh.js | 1 + core-js/features/math/cbrt.js | 1 + core-js/features/math/clamp.js | 4 + core-js/features/math/clz32.js | 1 + core-js/features/math/cosh.js | 1 + core-js/features/math/deg-per-rad.js | 3 + core-js/features/math/degrees.js | 4 + core-js/features/math/expm1.js | 1 + core-js/features/math/fround.js | 1 + core-js/features/math/fscale.js | 4 + core-js/features/math/hypot.js | 1 + core-js/features/math/iaddh.js | 4 + core-js/features/math/imul.js | 1 + core-js/features/math/imulh.js | 4 + core-js/features/math/index.js | 15 + core-js/features/math/isubh.js | 4 + core-js/features/math/log10.js | 1 + core-js/features/math/log1p.js | 1 + core-js/features/math/log2.js | 1 + core-js/features/math/rad-per-deg.js | 3 + core-js/features/math/radians.js | 4 + core-js/features/math/scale.js | 4 + core-js/features/math/seeded-prng.js | 4 + core-js/features/math/sign.js | 1 + core-js/features/math/signbit.js | 4 + core-js/features/math/sinh.js | 1 + core-js/features/math/tanh.js | 1 + core-js/features/math/to-string-tag.js | 1 + core-js/features/math/trunc.js | 1 + core-js/features/math/umulh.js | 4 + core-js/features/number/constructor.js | 1 + core-js/features/number/epsilon.js | 1 + core-js/features/number/from-string.js | 4 + core-js/features/number/index.js | 3 + core-js/features/number/is-finite.js | 1 + core-js/features/number/is-integer.js | 1 + core-js/features/number/is-nan.js | 1 + core-js/features/number/is-safe-integer.js | 1 + core-js/features/number/max-safe-integer.js | 1 + core-js/features/number/min-safe-integer.js | 1 + core-js/features/number/parse-float.js | 1 + core-js/features/number/parse-int.js | 1 + core-js/features/number/to-fixed.js | 1 + core-js/features/number/to-precision.js | 1 + core-js/features/number/virtual/index.js | 1 + core-js/features/number/virtual/to-fixed.js | 1 + .../features/number/virtual/to-precision.js | 1 + core-js/features/object/assign.js | 1 + core-js/features/object/create.js | 1 + core-js/features/object/define-getter.js | 1 + core-js/features/object/define-properties.js | 1 + core-js/features/object/define-property.js | 1 + core-js/features/object/define-setter.js | 1 + core-js/features/object/entries.js | 1 + core-js/features/object/freeze.js | 1 + core-js/features/object/from-entries.js | 1 + .../object/get-own-property-descriptor.js | 1 + .../object/get-own-property-descriptors.js | 1 + .../features/object/get-own-property-names.js | 1 + .../object/get-own-property-symbols.js | 1 + core-js/features/object/get-prototype-of.js | 1 + core-js/features/object/index.js | 1 + core-js/features/object/is-extensible.js | 1 + core-js/features/object/is-frozen.js | 1 + core-js/features/object/is-sealed.js | 1 + core-js/features/object/is.js | 1 + core-js/features/object/keys.js | 1 + core-js/features/object/lookup-getter.js | 1 + core-js/features/object/lookup-setter.js | 1 + core-js/features/object/prevent-extensions.js | 1 + core-js/features/object/seal.js | 1 + core-js/features/object/set-prototype-of.js | 1 + core-js/features/object/to-string.js | 1 + core-js/features/object/values.js | 1 + core-js/features/observable/index.js | 8 + core-js/features/parse-float.js | 1 + core-js/features/parse-int.js | 1 + core-js/features/promise/all-settled.js | 4 + core-js/features/promise/any.js | 12 + core-js/features/promise/finally.js | 1 + core-js/features/promise/index.js | 7 + core-js/features/promise/try.js | 11 + core-js/features/queue-microtask.js | 1 + core-js/features/reflect/apply.js | 1 + core-js/features/reflect/construct.js | 1 + core-js/features/reflect/define-metadata.js | 4 + core-js/features/reflect/define-property.js | 1 + core-js/features/reflect/delete-metadata.js | 4 + core-js/features/reflect/delete-property.js | 1 + core-js/features/reflect/get-metadata-keys.js | 4 + core-js/features/reflect/get-metadata.js | 4 + .../features/reflect/get-own-metadata-keys.js | 4 + core-js/features/reflect/get-own-metadata.js | 4 + .../reflect/get-own-property-descriptor.js | 1 + core-js/features/reflect/get-prototype-of.js | 1 + core-js/features/reflect/get.js | 1 + core-js/features/reflect/has-metadata.js | 4 + core-js/features/reflect/has-own-metadata.js | 4 + core-js/features/reflect/has.js | 1 + core-js/features/reflect/index.js | 11 + core-js/features/reflect/is-extensible.js | 1 + core-js/features/reflect/metadata.js | 4 + core-js/features/reflect/own-keys.js | 1 + .../features/reflect/prevent-extensions.js | 1 + core-js/features/reflect/set-prototype-of.js | 1 + core-js/features/reflect/set.js | 1 + core-js/features/regexp/constructor.js | 1 + core-js/features/regexp/flags.js | 1 + core-js/features/regexp/index.js | 1 + core-js/features/regexp/match.js | 1 + core-js/features/regexp/replace.js | 1 + core-js/features/regexp/search.js | 1 + core-js/features/regexp/split.js | 1 + core-js/features/regexp/to-string.js | 1 + core-js/features/set-immediate.js | 1 + core-js/features/set-interval.js | 1 + core-js/features/set-timeout.js | 1 + core-js/features/set/add-all.js | 5 + core-js/features/set/delete-all.js | 5 + core-js/features/set/difference.js | 7 + core-js/features/set/every.js | 5 + core-js/features/set/filter.js | 5 + core-js/features/set/find.js | 5 + core-js/features/set/from.js | 13 + core-js/features/set/index.js | 20 + core-js/features/set/intersection.js | 5 + core-js/features/set/is-disjoint-from.js | 5 + core-js/features/set/is-subset-of.js | 7 + core-js/features/set/is-superset-of.js | 5 + core-js/features/set/join.js | 5 + core-js/features/set/map.js | 5 + core-js/features/set/of.js | 13 + core-js/features/set/reduce.js | 5 + core-js/features/set/some.js | 5 + core-js/features/set/symmetric-difference.js | 7 + core-js/features/set/union.js | 7 + core-js/features/string/anchor.js | 1 + core-js/features/string/at.js | 4 + core-js/features/string/big.js | 1 + core-js/features/string/blink.js | 1 + core-js/features/string/bold.js | 1 + core-js/features/string/code-point-at.js | 1 + core-js/features/string/code-points.js | 3 + core-js/features/string/ends-with.js | 1 + core-js/features/string/fixed.js | 1 + core-js/features/string/fontcolor.js | 1 + core-js/features/string/fontsize.js | 1 + core-js/features/string/from-code-point.js | 1 + core-js/features/string/includes.js | 1 + core-js/features/string/index.js | 6 + core-js/features/string/italics.js | 1 + core-js/features/string/iterator.js | 1 + core-js/features/string/link.js | 1 + core-js/features/string/match-all.js | 4 + core-js/features/string/match.js | 1 + core-js/features/string/pad-end.js | 1 + core-js/features/string/pad-start.js | 1 + core-js/features/string/raw.js | 1 + core-js/features/string/repeat.js | 1 + core-js/features/string/replace-all.js | 4 + core-js/features/string/replace.js | 1 + core-js/features/string/search.js | 1 + core-js/features/string/small.js | 1 + core-js/features/string/split.js | 1 + core-js/features/string/starts-with.js | 1 + core-js/features/string/strike.js | 1 + core-js/features/string/sub.js | 1 + core-js/features/string/sup.js | 1 + core-js/features/string/trim-end.js | 1 + core-js/features/string/trim-left.js | 1 + core-js/features/string/trim-right.js | 1 + core-js/features/string/trim-start.js | 1 + core-js/features/string/trim.js | 1 + core-js/features/string/virtual/anchor.js | 1 + core-js/features/string/virtual/at.js | 4 + core-js/features/string/virtual/big.js | 1 + core-js/features/string/virtual/blink.js | 1 + core-js/features/string/virtual/bold.js | 1 + .../features/string/virtual/code-point-at.js | 1 + .../features/string/virtual/code-points.js | 3 + core-js/features/string/virtual/ends-with.js | 1 + core-js/features/string/virtual/fixed.js | 1 + core-js/features/string/virtual/fontcolor.js | 1 + core-js/features/string/virtual/fontsize.js | 1 + core-js/features/string/virtual/includes.js | 1 + core-js/features/string/virtual/index.js | 6 + core-js/features/string/virtual/italics.js | 1 + core-js/features/string/virtual/iterator.js | 1 + core-js/features/string/virtual/link.js | 1 + core-js/features/string/virtual/match-all.js | 4 + core-js/features/string/virtual/pad-end.js | 1 + core-js/features/string/virtual/pad-start.js | 1 + core-js/features/string/virtual/repeat.js | 1 + .../features/string/virtual/replace-all.js | 4 + core-js/features/string/virtual/small.js | 1 + .../features/string/virtual/starts-with.js | 1 + core-js/features/string/virtual/strike.js | 1 + core-js/features/string/virtual/sub.js | 1 + core-js/features/string/virtual/sup.js | 1 + core-js/features/string/virtual/trim-end.js | 1 + core-js/features/string/virtual/trim-left.js | 1 + core-js/features/string/virtual/trim-right.js | 1 + core-js/features/string/virtual/trim-start.js | 1 + core-js/features/string/virtual/trim.js | 1 + core-js/features/symbol/async-dispose.js | 4 + core-js/features/symbol/async-iterator.js | 1 + core-js/features/symbol/description.js | 1 + core-js/features/symbol/dispose.js | 4 + core-js/features/symbol/for.js | 1 + core-js/features/symbol/has-instance.js | 1 + core-js/features/symbol/index.js | 7 + .../features/symbol/is-concat-spreadable.js | 1 + core-js/features/symbol/iterator.js | 1 + core-js/features/symbol/key-for.js | 1 + core-js/features/symbol/match-all.js | 1 + core-js/features/symbol/match.js | 1 + core-js/features/symbol/observable.js | 4 + core-js/features/symbol/pattern-match.js | 4 + core-js/features/symbol/replace-all.js | 4 + core-js/features/symbol/replace.js | 1 + core-js/features/symbol/search.js | 1 + core-js/features/symbol/species.js | 1 + core-js/features/symbol/split.js | 1 + core-js/features/symbol/to-primitive.js | 1 + core-js/features/symbol/to-string-tag.js | 1 + core-js/features/symbol/unscopables.js | 1 + core-js/features/typed-array/copy-within.js | 1 + core-js/features/typed-array/entries.js | 1 + core-js/features/typed-array/every.js | 1 + core-js/features/typed-array/fill.js | 1 + core-js/features/typed-array/filter.js | 1 + core-js/features/typed-array/find-index.js | 1 + core-js/features/typed-array/find.js | 1 + core-js/features/typed-array/float32-array.js | 1 + core-js/features/typed-array/float64-array.js | 1 + core-js/features/typed-array/for-each.js | 1 + core-js/features/typed-array/from.js | 1 + core-js/features/typed-array/includes.js | 1 + core-js/features/typed-array/index-of.js | 1 + core-js/features/typed-array/index.js | 1 + core-js/features/typed-array/int16-array.js | 1 + core-js/features/typed-array/int32-array.js | 1 + core-js/features/typed-array/int8-array.js | 1 + core-js/features/typed-array/iterator.js | 1 + core-js/features/typed-array/join.js | 1 + core-js/features/typed-array/keys.js | 1 + core-js/features/typed-array/last-index-of.js | 1 + core-js/features/typed-array/map.js | 1 + core-js/features/typed-array/of.js | 1 + core-js/features/typed-array/reduce-right.js | 1 + core-js/features/typed-array/reduce.js | 1 + core-js/features/typed-array/reverse.js | 1 + core-js/features/typed-array/set.js | 1 + core-js/features/typed-array/slice.js | 1 + core-js/features/typed-array/some.js | 1 + core-js/features/typed-array/sort.js | 1 + core-js/features/typed-array/subarray.js | 1 + .../features/typed-array/to-locale-string.js | 1 + core-js/features/typed-array/to-string.js | 1 + core-js/features/typed-array/uint16-array.js | 1 + core-js/features/typed-array/uint32-array.js | 1 + core-js/features/typed-array/uint8-array.js | 1 + .../typed-array/uint8-clamped-array.js | 1 + core-js/features/typed-array/values.js | 1 + core-js/features/url-search-params/index.js | 1 + core-js/features/url/index.js | 1 + core-js/features/url/to-json.js | 1 + core-js/features/weak-map/delete-all.js | 5 + core-js/features/weak-map/from.js | 13 + core-js/features/weak-map/index.js | 5 + core-js/features/weak-map/of.js | 13 + core-js/features/weak-set/add-all.js | 5 + core-js/features/weak-set/delete-all.js | 5 + core-js/features/weak-set/from.js | 13 + core-js/features/weak-set/index.js | 6 + core-js/features/weak-set/of.js | 13 + core-js/index.js | 5 + core-js/internals/README.md | 1 + core-js/internals/a-function.js | 5 + core-js/internals/a-possible-prototype.js | 7 + core-js/internals/add-to-unscopables.js | 17 + core-js/internals/advance-string-index.js | 8 + core-js/internals/an-instance.js | 5 + core-js/internals/an-object.js | 7 + core-js/internals/array-buffer-view-core.js | 164 +++ core-js/internals/array-buffer.js | 293 +++++ core-js/internals/array-copy-within.js | 29 + core-js/internals/array-fill.js | 17 + core-js/internals/array-for-each.js | 9 + core-js/internals/array-from.js | 41 + core-js/internals/array-includes.js | 32 + core-js/internals/array-iteration.js | 65 ++ core-js/internals/array-last-index-of.js | 24 + .../array-method-has-species-support.js | 15 + core-js/internals/array-reduce.js | 40 + core-js/internals/array-species-create.js | 20 + core-js/internals/bind-context.js | 24 + .../call-with-safe-iteration-closing.js | 13 + .../check-correctness-of-iteration.js | 38 + core-js/internals/classof-raw.js | 5 + core-js/internals/classof.js | 25 + core-js/internals/collection-add-all.js | 13 + core-js/internals/collection-delete-all.js | 16 + core-js/internals/collection-from.js | 26 + core-js/internals/collection-of.js | 8 + core-js/internals/collection-strong.js | 186 +++ core-js/internals/collection-weak.js | 121 ++ core-js/internals/collection.js | 97 ++ core-js/internals/composite-key.js | 43 + .../internals/copy-constructor-properties.js | 14 + core-js/internals/correct-is-regexp-logic.js | 15 + core-js/internals/correct-prototype-getter.js | 7 + core-js/internals/create-html.js | 12 + .../internals/create-iterator-constructor.js | 16 + .../internals/create-property-descriptor.js | 8 + core-js/internals/create-property.js | 10 + core-js/internals/date-to-iso-string.js | 31 + core-js/internals/date-to-primitive.js | 9 + core-js/internals/define-iterator.js | 90 ++ core-js/internals/define-well-known-symbol.js | 11 + core-js/internals/descriptors.js | 6 + core-js/internals/document-create-element.js | 10 + core-js/internals/dom-iterables.js | 35 + core-js/internals/entry-unbind.js | 8 + core-js/internals/entry-virtual.js | 5 + core-js/internals/enum-bug-keys.js | 10 + core-js/internals/export.js | 54 + core-js/internals/fails.js | 7 + .../fix-regexp-well-known-symbol-logic.js | 93 ++ core-js/internals/flatten-into-array.js | 32 + ...rced-object-prototype-accessors-methods.js | 13 + .../internals/forced-string-html-method.js | 10 + .../internals/forced-string-trim-method.js | 12 + core-js/internals/freezing.js | 5 + core-js/internals/function-bind.js | 27 + core-js/internals/function-to-string.js | 3 + core-js/internals/get-built-in.js | 11 + core-js/internals/get-iterator-method.js | 11 + core-js/internals/get-iterator.js | 9 + core-js/internals/get-map-iterator.js | 7 + core-js/internals/get-set-iterator.js | 7 + core-js/internals/global.js | 14 + core-js/internals/has.js | 5 + core-js/internals/hidden-keys.js | 1 + core-js/internals/hide.js | 10 + core-js/internals/host-report-errors.js | 8 + core-js/internals/html.js | 3 + core-js/internals/ie8-dom-define.js | 10 + core-js/internals/indexed-object.js | 13 + core-js/internals/inherit-if-required.js | 17 + core-js/internals/internal-metadata.js | 61 + core-js/internals/internal-state.js | 61 + core-js/internals/is-array-iterator-method.js | 10 + core-js/internals/is-array.js | 7 + core-js/internals/is-forced.js | 21 + core-js/internals/is-integer.js | 9 + core-js/internals/is-iterable.js | 13 + core-js/internals/is-object.js | 3 + core-js/internals/is-pure.js | 1 + core-js/internals/is-regexp.js | 12 + core-js/internals/iterate.js | 42 + core-js/internals/iterators-core.js | 35 + core-js/internals/iterators.js | 1 + core-js/internals/math-expm1.js | 13 + core-js/internals/math-fround.js | 26 + core-js/internals/math-log1p.js | 7 + core-js/internals/math-scale.js | 16 + core-js/internals/math-sign.js | 6 + core-js/internals/microtask.js | 78 ++ .../internals/native-promise-constructor.js | 3 + core-js/internals/native-symbol.js | 7 + core-js/internals/native-url.js | 24 + core-js/internals/native-weak-map.js | 6 + core-js/internals/new-promise-capability.js | 18 + core-js/internals/not-a-regexp.js | 7 + core-js/internals/number-is-finite.js | 9 + core-js/internals/object-assign.js | 41 + core-js/internals/object-create.js | 49 + core-js/internals/object-define-properties.js | 16 + core-js/internals/object-define-property.js | 20 + .../object-get-own-property-descriptor.js | 20 + .../object-get-own-property-names-external.js | 22 + .../object-get-own-property-names.js | 10 + .../object-get-own-property-symbols.js | 1 + core-js/internals/object-get-prototype-of.js | 17 + core-js/internals/object-keys-internal.js | 17 + core-js/internals/object-keys.js | 8 + .../object-property-is-enumerable.js | 13 + core-js/internals/object-set-prototype-of.js | 24 + core-js/internals/object-to-array.js | 32 + core-js/internals/object-to-string.js | 14 + core-js/internals/own-keys.js | 11 + core-js/internals/parse-float.js | 14 + core-js/internals/parse-int.js | 14 + core-js/internals/path.js | 1 + core-js/internals/perform.js | 7 + core-js/internals/promise-resolve.js | 12 + core-js/internals/punycode-to-ascii.js | 168 +++ core-js/internals/redefine-all.js | 6 + core-js/internals/redefine.js | 39 + core-js/internals/reflect-metadata.js | 55 + core-js/internals/regexp-exec-abstract.js | 22 + core-js/internals/regexp-exec.js | 54 + core-js/internals/regexp-flags.js | 16 + core-js/internals/require-object-coercible.js | 6 + core-js/internals/same-value-zero.js | 6 + core-js/internals/same-value.js | 6 + core-js/internals/set-global.js | 10 + core-js/internals/set-species.js | 19 + core-js/internals/set-to-string-tag.js | 11 + core-js/internals/shared-key.js | 8 + core-js/internals/shared.js | 14 + core-js/internals/sloppy-array-method.js | 10 + core-js/internals/species-constructor.js | 13 + core-js/internals/string-multibyte.js | 27 + core-js/internals/string-pad.js | 31 + core-js/internals/string-repeat.js | 14 + core-js/internals/string-trim.js | 28 + core-js/internals/task.js | 99 ++ core-js/internals/this-number-value.js | 10 + core-js/internals/to-absolute-index.js | 12 + core-js/internals/to-index.js | 12 + core-js/internals/to-indexed-object.js | 7 + core-js/internals/to-integer.js | 8 + core-js/internals/to-length.js | 9 + core-js/internals/to-object.js | 7 + core-js/internals/to-offset.js | 7 + core-js/internals/to-primitive.js | 14 + core-js/internals/typed-array-constructor.js | 223 ++++ core-js/internals/typed-array-from.js | 31 + ...d-arrays-constructors-requires-wrappers.js | 22 + core-js/internals/uid.js | 6 + core-js/internals/user-agent.js | 3 + core-js/internals/webkit-string-pad-bug.js | 5 + core-js/internals/well-known-symbol.js | 12 + core-js/internals/whitespaces.js | 3 + .../internals/wrapped-well-known-symbol.js | 1 + core-js/modules/README.md | 1 + .../modules/es.array-buffer.constructor.js | 17 + core-js/modules/es.array-buffer.is-view.js | 10 + core-js/modules/es.array-buffer.slice.js | 36 + core-js/modules/es.array.concat.js | 56 + core-js/modules/es.array.copy-within.js | 12 + core-js/modules/es.array.every.js | 12 + core-js/modules/es.array.fill.js | 12 + core-js/modules/es.array.filter.js | 13 + core-js/modules/es.array.find-index.js | 21 + core-js/modules/es.array.find.js | 21 + core-js/modules/es.array.flat-map.js | 21 + core-js/modules/es.array.flat.js | 20 + core-js/modules/es.array.for-each.js | 9 + core-js/modules/es.array.from.js | 13 + core-js/modules/es.array.includes.js | 15 + core-js/modules/es.array.index-of.js | 20 + core-js/modules/es.array.is-array.js | 8 + core-js/modules/es.array.iterator.js | 53 + core-js/modules/es.array.join.js | 18 + core-js/modules/es.array.last-index-of.js | 8 + core-js/modules/es.array.map.js | 13 + core-js/modules/es.array.of.js | 23 + core-js/modules/es.array.reduce-right.js | 12 + core-js/modules/es.array.reduce.js | 12 + core-js/modules/es.array.reverse.js | 17 + core-js/modules/es.array.slice.js | 45 + core-js/modules/es.array.some.js | 12 + core-js/modules/es.array.sort.js | 32 + core-js/modules/es.array.species.js | 5 + core-js/modules/es.array.splice.js | 66 ++ .../modules/es.array.unscopables.flat-map.js | 5 + core-js/modules/es.array.unscopables.flat.js | 5 + core-js/modules/es.data-view.js | 9 + core-js/modules/es.date.now.js | 9 + core-js/modules/es.date.to-iso-string.js | 9 + core-js/modules/es.date.to-json.js | 21 + core-js/modules/es.date.to-primitive.js | 10 + core-js/modules/es.date.to-string.js | 17 + core-js/modules/es.function.bind.js | 8 + core-js/modules/es.function.has-instance.js | 20 + core-js/modules/es.function.name.js | 22 + core-js/modules/es.json.to-string-tag.js | 6 + core-js/modules/es.map.js | 9 + core-js/modules/es.math.acosh.js | 23 + core-js/modules/es.math.asinh.js | 16 + core-js/modules/es.math.atanh.js | 13 + core-js/modules/es.math.cbrt.js | 13 + core-js/modules/es.math.clz32.js | 13 + core-js/modules/es.math.cosh.js | 15 + core-js/modules/es.math.expm1.js | 6 + core-js/modules/es.math.fround.js | 6 + core-js/modules/es.math.hypot.js | 33 + core-js/modules/es.math.imul.js | 22 + core-js/modules/es.math.log10.js | 12 + core-js/modules/es.math.log1p.js | 6 + core-js/modules/es.math.log2.js | 12 + core-js/modules/es.math.sign.js | 8 + core-js/modules/es.math.sinh.js | 20 + core-js/modules/es.math.tanh.js | 14 + core-js/modules/es.math.to-string-tag.js | 5 + core-js/modules/es.math.trunc.js | 12 + core-js/modules/es.number.constructor.js | 78 ++ core-js/modules/es.number.epsilon.js | 7 + core-js/modules/es.number.is-finite.js | 6 + core-js/modules/es.number.is-integer.js | 8 + core-js/modules/es.number.is-nan.js | 10 + core-js/modules/es.number.is-safe-integer.js | 12 + core-js/modules/es.number.max-safe-integer.js | 7 + core-js/modules/es.number.min-safe-integer.js | 7 + core-js/modules/es.number.parse-float.js | 8 + core-js/modules/es.number.parse-int.js | 8 + core-js/modules/es.number.to-fixed.js | 126 +++ core-js/modules/es.number.to-precision.js | 24 + core-js/modules/es.object.assign.js | 8 + core-js/modules/es.object.create.js | 9 + core-js/modules/es.object.define-getter.js | 17 + .../modules/es.object.define-properties.js | 9 + core-js/modules/es.object.define-property.js | 9 + core-js/modules/es.object.define-setter.js | 17 + core-js/modules/es.object.entries.js | 10 + core-js/modules/es.object.freeze.js | 16 + core-js/modules/es.object.from-entries.js | 15 + .../es.object.get-own-property-descriptor.js | 16 + .../es.object.get-own-property-descriptors.js | 24 + .../es.object.get-own-property-names.js | 11 + core-js/modules/es.object.get-prototype-of.js | 16 + core-js/modules/es.object.is-extensible.js | 14 + core-js/modules/es.object.is-frozen.js | 14 + core-js/modules/es.object.is-sealed.js | 14 + core-js/modules/es.object.is.js | 8 + core-js/modules/es.object.keys.js | 14 + core-js/modules/es.object.lookup-getter.js | 23 + core-js/modules/es.object.lookup-setter.js | 23 + .../modules/es.object.prevent-extensions.js | 16 + core-js/modules/es.object.seal.js | 16 + core-js/modules/es.object.set-prototype-of.js | 8 + core-js/modules/es.object.to-string.js | 10 + core-js/modules/es.object.values.js | 10 + core-js/modules/es.parse-float.js | 8 + core-js/modules/es.parse-int.js | 8 + core-js/modules/es.promise.all-settled.js | 43 + core-js/modules/es.promise.finally.js | 30 + core-js/modules/es.promise.js | 371 ++++++ core-js/modules/es.reflect.apply.js | 25 + core-js/modules/es.reflect.construct.js | 51 + core-js/modules/es.reflect.define-property.js | 28 + core-js/modules/es.reflect.delete-property.js | 12 + .../es.reflect.get-own-property-descriptor.js | 12 + .../modules/es.reflect.get-prototype-of.js | 12 + core-js/modules/es.reflect.get.js | 24 + core-js/modules/es.reflect.has.js | 9 + core-js/modules/es.reflect.is-extensible.js | 13 + core-js/modules/es.reflect.own-keys.js | 8 + .../modules/es.reflect.prevent-extensions.js | 19 + .../modules/es.reflect.set-prototype-of.js | 19 + core-js/modules/es.reflect.set.js | 36 + core-js/modules/es.regexp.constructor.js | 60 + core-js/modules/es.regexp.exec.js | 7 + core-js/modules/es.regexp.flags.js | 12 + core-js/modules/es.regexp.to-string.js | 25 + core-js/modules/es.set.js | 9 + core-js/modules/es.string.anchor.js | 12 + core-js/modules/es.string.big.js | 12 + core-js/modules/es.string.blink.js | 12 + core-js/modules/es.string.bold.js | 12 + core-js/modules/es.string.code-point-at.js | 11 + core-js/modules/es.string.ends-with.js | 25 + core-js/modules/es.string.fixed.js | 12 + core-js/modules/es.string.fontcolor.js | 12 + core-js/modules/es.string.fontsize.js | 12 + core-js/modules/es.string.from-code-point.js | 27 + core-js/modules/es.string.includes.js | 14 + core-js/modules/es.string.italics.js | 12 + core-js/modules/es.string.iterator.js | 29 + core-js/modules/es.string.link.js | 12 + core-js/modules/es.string.match-all.js | 94 ++ core-js/modules/es.string.match.js | 44 + core-js/modules/es.string.pad-end.js | 12 + core-js/modules/es.string.pad-start.js | 12 + core-js/modules/es.string.raw.js | 19 + core-js/modules/es.string.repeat.js | 8 + core-js/modules/es.string.replace.js | 126 +++ core-js/modules/es.string.search.js | 34 + core-js/modules/es.string.small.js | 12 + core-js/modules/es.string.split.js | 134 +++ core-js/modules/es.string.starts-with.js | 23 + core-js/modules/es.string.strike.js | 12 + core-js/modules/es.string.sub.js | 12 + core-js/modules/es.string.sup.js | 12 + core-js/modules/es.string.trim-end.js | 17 + core-js/modules/es.string.trim-start.js | 17 + core-js/modules/es.string.trim.js | 12 + core-js/modules/es.symbol.async-iterator.js | 5 + core-js/modules/es.symbol.description.js | 50 + core-js/modules/es.symbol.has-instance.js | 5 + .../modules/es.symbol.is-concat-spreadable.js | 5 + core-js/modules/es.symbol.iterator.js | 5 + core-js/modules/es.symbol.js | 299 +++++ core-js/modules/es.symbol.match-all.js | 4 + core-js/modules/es.symbol.match.js | 5 + core-js/modules/es.symbol.replace.js | 5 + core-js/modules/es.symbol.search.js | 5 + core-js/modules/es.symbol.species.js | 5 + core-js/modules/es.symbol.split.js | 5 + core-js/modules/es.symbol.to-primitive.js | 5 + core-js/modules/es.symbol.to-string-tag.js | 5 + core-js/modules/es.symbol.unscopables.js | 5 + core-js/modules/es.typed-array.copy-within.js | 11 + core-js/modules/es.typed-array.every.js | 11 + core-js/modules/es.typed-array.fill.js | 12 + core-js/modules/es.typed-array.filter.js | 19 + core-js/modules/es.typed-array.find-index.js | 11 + core-js/modules/es.typed-array.find.js | 11 + .../modules/es.typed-array.float32-array.js | 9 + .../modules/es.typed-array.float64-array.js | 9 + core-js/modules/es.typed-array.for-each.js | 11 + core-js/modules/es.typed-array.from.js | 8 + core-js/modules/es.typed-array.includes.js | 11 + core-js/modules/es.typed-array.index-of.js | 11 + core-js/modules/es.typed-array.int16-array.js | 9 + core-js/modules/es.typed-array.int32-array.js | 9 + core-js/modules/es.typed-array.int8-array.js | 9 + core-js/modules/es.typed-array.iterator.js | 38 + core-js/modules/es.typed-array.join.js | 12 + .../modules/es.typed-array.last-index-of.js | 12 + core-js/modules/es.typed-array.map.js | 15 + core-js/modules/es.typed-array.of.js | 15 + .../modules/es.typed-array.reduce-right.js | 11 + core-js/modules/es.typed-array.reduce.js | 11 + core-js/modules/es.typed-array.reverse.js | 20 + core-js/modules/es.typed-array.set.js | 26 + core-js/modules/es.typed-array.slice.js | 25 + core-js/modules/es.typed-array.some.js | 11 + core-js/modules/es.typed-array.sort.js | 11 + core-js/modules/es.typed-array.subarray.js | 20 + .../es.typed-array.to-locale-string.js | 26 + core-js/modules/es.typed-array.to-string.js | 19 + .../modules/es.typed-array.uint16-array.js | 9 + .../modules/es.typed-array.uint32-array.js | 9 + core-js/modules/es.typed-array.uint8-array.js | 9 + .../es.typed-array.uint8-clamped-array.js | 9 + core-js/modules/es.weak-map.js | 67 ++ core-js/modules/es.weak-set.js | 9 + core-js/modules/esnext.aggregate-error.js | 29 + .../esnext.array.is-template-object.js | 28 + core-js/modules/esnext.array.last-index.js | 21 + core-js/modules/esnext.array.last-item.js | 26 + core-js/modules/esnext.composite-key.js | 16 + core-js/modules/esnext.composite-symbol.js | 11 + core-js/modules/esnext.global-this.js | 8 + core-js/modules/esnext.map.delete-all.js | 12 + core-js/modules/esnext.map.every.js | 20 + core-js/modules/esnext.map.filter.js | 26 + core-js/modules/esnext.map.find-key.js | 20 + core-js/modules/esnext.map.find.js | 20 + core-js/modules/esnext.map.from.js | 8 + core-js/modules/esnext.map.group-by.js | 22 + core-js/modules/esnext.map.includes.js | 17 + core-js/modules/esnext.map.key-by.js | 18 + core-js/modules/esnext.map.key-of.js | 16 + core-js/modules/esnext.map.map-keys.js | 26 + core-js/modules/esnext.map.map-values.js | 26 + core-js/modules/esnext.map.merge.js | 21 + core-js/modules/esnext.map.of.js | 8 + core-js/modules/esnext.map.reduce.js | 28 + core-js/modules/esnext.map.some.js | 20 + .../modules/esnext.map.update-or-insert.js | 18 + core-js/modules/esnext.map.update.js | 22 + core-js/modules/esnext.math.clamp.js | 12 + core-js/modules/esnext.math.deg-per-rad.js | 7 + core-js/modules/esnext.math.degrees.js | 11 + core-js/modules/esnext.math.fscale.js | 12 + core-js/modules/esnext.math.iaddh.js | 12 + core-js/modules/esnext.math.imulh.js | 17 + core-js/modules/esnext.math.isubh.js | 12 + core-js/modules/esnext.math.rad-per-deg.js | 7 + core-js/modules/esnext.math.radians.js | 11 + core-js/modules/esnext.math.scale.js | 8 + core-js/modules/esnext.math.seeded-prng.js | 33 + core-js/modules/esnext.math.signbit.js | 10 + core-js/modules/esnext.math.umulh.js | 17 + core-js/modules/esnext.number.from-string.js | 30 + core-js/modules/esnext.observable.js | 207 ++++ core-js/modules/esnext.promise.all-settled.js | 2 + core-js/modules/esnext.promise.any.js | 46 + core-js/modules/esnext.promise.try.js | 15 + .../modules/esnext.reflect.define-metadata.js | 15 + .../modules/esnext.reflect.delete-metadata.js | 21 + .../esnext.reflect.get-metadata-keys.js | 33 + .../modules/esnext.reflect.get-metadata.js | 24 + .../esnext.reflect.get-own-metadata-keys.js | 15 + .../esnext.reflect.get-own-metadata.js | 15 + .../modules/esnext.reflect.has-metadata.js | 23 + .../esnext.reflect.has-own-metadata.js | 15 + core-js/modules/esnext.reflect.metadata.js | 16 + core-js/modules/esnext.set.add-all.js | 12 + core-js/modules/esnext.set.delete-all.js | 12 + core-js/modules/esnext.set.difference.js | 22 + core-js/modules/esnext.set.every.js | 20 + core-js/modules/esnext.set.filter.js | 26 + core-js/modules/esnext.set.find.js | 20 + core-js/modules/esnext.set.from.js | 8 + core-js/modules/esnext.set.intersection.js | 23 + .../modules/esnext.set.is-disjoint-from.js | 18 + core-js/modules/esnext.set.is-subset-of.js | 25 + core-js/modules/esnext.set.is-superset-of.js | 18 + core-js/modules/esnext.set.join.js | 19 + core-js/modules/esnext.set.map.js | 26 + core-js/modules/esnext.set.of.js | 8 + core-js/modules/esnext.set.reduce.js | 28 + core-js/modules/esnext.set.some.js | 20 + .../esnext.set.symmetric-difference.js | 23 + core-js/modules/esnext.set.union.js | 19 + core-js/modules/esnext.string.at.js | 11 + core-js/modules/esnext.string.code-points.js | 38 + core-js/modules/esnext.string.match-all.js | 3 + core-js/modules/esnext.string.replace-all.js | 53 + .../modules/esnext.symbol.async-dispose.js | 5 + core-js/modules/esnext.symbol.dispose.js | 5 + core-js/modules/esnext.symbol.observable.js | 5 + .../modules/esnext.symbol.pattern-match.js | 5 + core-js/modules/esnext.symbol.replace-all.js | 5 + core-js/modules/esnext.weak-map.delete-all.js | 12 + core-js/modules/esnext.weak-map.from.js | 8 + core-js/modules/esnext.weak-map.of.js | 8 + core-js/modules/esnext.weak-set.add-all.js | 12 + core-js/modules/esnext.weak-set.delete-all.js | 12 + core-js/modules/esnext.weak-set.from.js | 8 + core-js/modules/esnext.weak-set.of.js | 8 + .../modules/web.dom-collections.for-each.js | 15 + .../modules/web.dom-collections.iterator.js | 31 + core-js/modules/web.immediate.js | 14 + core-js/modules/web.queue-microtask.js | 16 + core-js/modules/web.timers.js | 28 + core-js/modules/web.url-search-params.js | 311 +++++ core-js/modules/web.url.js | 1008 +++++++++++++++++ core-js/modules/web.url.to-json.js | 10 + core-js/package.json | 51 + core-js/proposals/array-is-template-object.js | 1 + core-js/proposals/array-last.js | 2 + core-js/proposals/collection-methods.js | 27 + core-js/proposals/collection-of-from.js | 8 + .../proposals/efficient-64-bit-arithmetic.js | 4 + core-js/proposals/global-this.js | 3 + core-js/proposals/index.js | 1 + core-js/proposals/keys-composition.js | 2 + core-js/proposals/map-update-or-insert.js | 1 + core-js/proposals/math-extensions.js | 7 + core-js/proposals/math-signbit.js | 1 + core-js/proposals/number-from-string.js | 1 + core-js/proposals/observable.js | 2 + core-js/proposals/pattern-matching.js | 1 + core-js/proposals/promise-all-settled.js | 2 + core-js/proposals/promise-any.js | 2 + core-js/proposals/promise-try.js | 1 + core-js/proposals/reflect-metadata.js | 9 + core-js/proposals/seeded-random.js | 1 + core-js/proposals/set-methods.js | 7 + core-js/proposals/string-at.js | 1 + core-js/proposals/string-code-points.js | 1 + core-js/proposals/string-match-all.js | 2 + core-js/proposals/string-replace-all.js | 2 + core-js/proposals/url.js | 3 + core-js/proposals/using-statement.js | 3 + core-js/scripts/postinstall.js | 24 + core-js/stable/README.md | 1 + core-js/stable/array-buffer/constructor.js | 1 + core-js/stable/array-buffer/index.js | 1 + core-js/stable/array-buffer/is-view.js | 1 + core-js/stable/array-buffer/slice.js | 1 + core-js/stable/array/concat.js | 1 + core-js/stable/array/copy-within.js | 1 + core-js/stable/array/entries.js | 1 + core-js/stable/array/every.js | 1 + core-js/stable/array/fill.js | 1 + core-js/stable/array/filter.js | 1 + core-js/stable/array/find-index.js | 1 + core-js/stable/array/find.js | 1 + core-js/stable/array/flat-map.js | 1 + core-js/stable/array/flat.js | 1 + core-js/stable/array/for-each.js | 1 + core-js/stable/array/from.js | 1 + core-js/stable/array/includes.js | 1 + core-js/stable/array/index-of.js | 1 + core-js/stable/array/index.js | 1 + core-js/stable/array/is-array.js | 1 + core-js/stable/array/iterator.js | 1 + core-js/stable/array/join.js | 1 + core-js/stable/array/keys.js | 1 + core-js/stable/array/last-index-of.js | 1 + core-js/stable/array/map.js | 1 + core-js/stable/array/of.js | 1 + core-js/stable/array/reduce-right.js | 1 + core-js/stable/array/reduce.js | 1 + core-js/stable/array/reverse.js | 1 + core-js/stable/array/slice.js | 1 + core-js/stable/array/some.js | 1 + core-js/stable/array/sort.js | 1 + core-js/stable/array/splice.js | 1 + core-js/stable/array/values.js | 1 + core-js/stable/array/virtual/concat.js | 1 + core-js/stable/array/virtual/copy-within.js | 1 + core-js/stable/array/virtual/entries.js | 1 + core-js/stable/array/virtual/every.js | 1 + core-js/stable/array/virtual/fill.js | 1 + core-js/stable/array/virtual/filter.js | 1 + core-js/stable/array/virtual/find-index.js | 1 + core-js/stable/array/virtual/find.js | 1 + core-js/stable/array/virtual/flat-map.js | 1 + core-js/stable/array/virtual/flat.js | 1 + core-js/stable/array/virtual/for-each.js | 1 + core-js/stable/array/virtual/includes.js | 1 + core-js/stable/array/virtual/index-of.js | 1 + core-js/stable/array/virtual/index.js | 1 + core-js/stable/array/virtual/iterator.js | 1 + core-js/stable/array/virtual/join.js | 1 + core-js/stable/array/virtual/keys.js | 1 + core-js/stable/array/virtual/last-index-of.js | 1 + core-js/stable/array/virtual/map.js | 1 + core-js/stable/array/virtual/reduce-right.js | 1 + core-js/stable/array/virtual/reduce.js | 1 + core-js/stable/array/virtual/reverse.js | 1 + core-js/stable/array/virtual/slice.js | 1 + core-js/stable/array/virtual/some.js | 1 + core-js/stable/array/virtual/sort.js | 1 + core-js/stable/array/virtual/splice.js | 1 + core-js/stable/array/virtual/values.js | 1 + core-js/stable/clear-immediate.js | 3 + core-js/stable/data-view/index.js | 1 + core-js/stable/date/index.js | 1 + core-js/stable/date/now.js | 1 + core-js/stable/date/to-iso-string.js | 1 + core-js/stable/date/to-json.js | 1 + core-js/stable/date/to-primitive.js | 1 + core-js/stable/date/to-string.js | 1 + core-js/stable/dom-collections/for-each.js | 3 + core-js/stable/dom-collections/index.js | 12 + core-js/stable/dom-collections/iterator.js | 4 + core-js/stable/function/bind.js | 1 + core-js/stable/function/has-instance.js | 1 + core-js/stable/function/index.js | 1 + core-js/stable/function/name.js | 1 + core-js/stable/function/virtual/bind.js | 1 + core-js/stable/function/virtual/index.js | 1 + core-js/stable/global-this.js | 3 + core-js/stable/index.js | 4 + core-js/stable/instance/bind.js | 1 + core-js/stable/instance/code-point-at.js | 1 + core-js/stable/instance/concat.js | 1 + core-js/stable/instance/copy-within.js | 1 + core-js/stable/instance/ends-with.js | 1 + core-js/stable/instance/entries.js | 16 + core-js/stable/instance/every.js | 1 + core-js/stable/instance/fill.js | 1 + core-js/stable/instance/filter.js | 1 + core-js/stable/instance/find-index.js | 1 + core-js/stable/instance/find.js | 1 + core-js/stable/instance/flags.js | 1 + core-js/stable/instance/flat-map.js | 1 + core-js/stable/instance/flat.js | 1 + core-js/stable/instance/for-each.js | 16 + core-js/stable/instance/includes.js | 1 + core-js/stable/instance/index-of.js | 1 + core-js/stable/instance/keys.js | 16 + core-js/stable/instance/last-index-of.js | 1 + core-js/stable/instance/map.js | 1 + core-js/stable/instance/match-all.js | 1 + core-js/stable/instance/pad-end.js | 1 + core-js/stable/instance/pad-start.js | 1 + core-js/stable/instance/reduce-right.js | 1 + core-js/stable/instance/reduce.js | 1 + core-js/stable/instance/repeat.js | 1 + core-js/stable/instance/reverse.js | 1 + core-js/stable/instance/slice.js | 1 + core-js/stable/instance/some.js | 1 + core-js/stable/instance/sort.js | 1 + core-js/stable/instance/splice.js | 1 + core-js/stable/instance/starts-with.js | 1 + core-js/stable/instance/trim-end.js | 1 + core-js/stable/instance/trim-left.js | 1 + core-js/stable/instance/trim-right.js | 1 + core-js/stable/instance/trim-start.js | 1 + core-js/stable/instance/trim.js | 1 + core-js/stable/instance/values.js | 16 + core-js/stable/json/index.js | 1 + core-js/stable/json/stringify.js | 1 + core-js/stable/json/to-string-tag.js | 1 + core-js/stable/map/index.js | 1 + core-js/stable/math/acosh.js | 1 + core-js/stable/math/asinh.js | 1 + core-js/stable/math/atanh.js | 1 + core-js/stable/math/cbrt.js | 1 + core-js/stable/math/clz32.js | 1 + core-js/stable/math/cosh.js | 1 + core-js/stable/math/expm1.js | 1 + core-js/stable/math/fround.js | 1 + core-js/stable/math/hypot.js | 1 + core-js/stable/math/imul.js | 1 + core-js/stable/math/index.js | 1 + core-js/stable/math/log10.js | 1 + core-js/stable/math/log1p.js | 1 + core-js/stable/math/log2.js | 1 + core-js/stable/math/sign.js | 1 + core-js/stable/math/sinh.js | 1 + core-js/stable/math/tanh.js | 1 + core-js/stable/math/to-string-tag.js | 1 + core-js/stable/math/trunc.js | 1 + core-js/stable/number/constructor.js | 1 + core-js/stable/number/epsilon.js | 1 + core-js/stable/number/index.js | 1 + core-js/stable/number/is-finite.js | 1 + core-js/stable/number/is-integer.js | 1 + core-js/stable/number/is-nan.js | 1 + core-js/stable/number/is-safe-integer.js | 1 + core-js/stable/number/max-safe-integer.js | 1 + core-js/stable/number/min-safe-integer.js | 1 + core-js/stable/number/parse-float.js | 1 + core-js/stable/number/parse-int.js | 1 + core-js/stable/number/to-fixed.js | 1 + core-js/stable/number/to-precision.js | 1 + core-js/stable/number/virtual/index.js | 1 + core-js/stable/number/virtual/to-fixed.js | 1 + core-js/stable/number/virtual/to-precision.js | 1 + core-js/stable/object/assign.js | 1 + core-js/stable/object/create.js | 1 + core-js/stable/object/define-getter.js | 1 + core-js/stable/object/define-properties.js | 1 + core-js/stable/object/define-property.js | 1 + core-js/stable/object/define-setter.js | 1 + core-js/stable/object/entries.js | 1 + core-js/stable/object/freeze.js | 1 + core-js/stable/object/from-entries.js | 1 + .../object/get-own-property-descriptor.js | 1 + .../object/get-own-property-descriptors.js | 1 + .../stable/object/get-own-property-names.js | 1 + .../stable/object/get-own-property-symbols.js | 1 + core-js/stable/object/get-prototype-of.js | 1 + core-js/stable/object/index.js | 1 + core-js/stable/object/is-extensible.js | 1 + core-js/stable/object/is-frozen.js | 1 + core-js/stable/object/is-sealed.js | 1 + core-js/stable/object/is.js | 1 + core-js/stable/object/keys.js | 1 + core-js/stable/object/lookup-getter.js | 1 + core-js/stable/object/lookup-setter.js | 1 + core-js/stable/object/prevent-extensions.js | 1 + core-js/stable/object/seal.js | 1 + core-js/stable/object/set-prototype-of.js | 1 + core-js/stable/object/to-string.js | 1 + core-js/stable/object/values.js | 1 + core-js/stable/parse-float.js | 1 + core-js/stable/parse-int.js | 1 + core-js/stable/promise/all-settled.js | 1 + core-js/stable/promise/finally.js | 1 + core-js/stable/promise/index.js | 1 + core-js/stable/queue-microtask.js | 1 + core-js/stable/reflect/apply.js | 1 + core-js/stable/reflect/construct.js | 1 + core-js/stable/reflect/define-property.js | 1 + core-js/stable/reflect/delete-property.js | 1 + .../reflect/get-own-property-descriptor.js | 1 + core-js/stable/reflect/get-prototype-of.js | 1 + core-js/stable/reflect/get.js | 1 + core-js/stable/reflect/has.js | 1 + core-js/stable/reflect/index.js | 1 + core-js/stable/reflect/is-extensible.js | 1 + core-js/stable/reflect/own-keys.js | 1 + core-js/stable/reflect/prevent-extensions.js | 1 + core-js/stable/reflect/set-prototype-of.js | 1 + core-js/stable/reflect/set.js | 1 + core-js/stable/regexp/constructor.js | 1 + core-js/stable/regexp/flags.js | 1 + core-js/stable/regexp/index.js | 1 + core-js/stable/regexp/match.js | 1 + core-js/stable/regexp/replace.js | 1 + core-js/stable/regexp/search.js | 1 + core-js/stable/regexp/split.js | 1 + core-js/stable/regexp/to-string.js | 1 + core-js/stable/set-immediate.js | 3 + core-js/stable/set-interval.js | 3 + core-js/stable/set-timeout.js | 3 + core-js/stable/set/index.js | 1 + core-js/stable/string/anchor.js | 1 + core-js/stable/string/big.js | 1 + core-js/stable/string/blink.js | 1 + core-js/stable/string/bold.js | 1 + core-js/stable/string/code-point-at.js | 1 + core-js/stable/string/ends-with.js | 1 + core-js/stable/string/fixed.js | 1 + core-js/stable/string/fontcolor.js | 1 + core-js/stable/string/fontsize.js | 1 + core-js/stable/string/from-code-point.js | 1 + core-js/stable/string/includes.js | 1 + core-js/stable/string/index.js | 1 + core-js/stable/string/italics.js | 1 + core-js/stable/string/iterator.js | 1 + core-js/stable/string/link.js | 1 + core-js/stable/string/match-all.js | 1 + core-js/stable/string/match.js | 1 + core-js/stable/string/pad-end.js | 1 + core-js/stable/string/pad-start.js | 1 + core-js/stable/string/raw.js | 1 + core-js/stable/string/repeat.js | 1 + core-js/stable/string/replace.js | 1 + core-js/stable/string/search.js | 1 + core-js/stable/string/small.js | 1 + core-js/stable/string/split.js | 1 + core-js/stable/string/starts-with.js | 1 + core-js/stable/string/strike.js | 1 + core-js/stable/string/sub.js | 1 + core-js/stable/string/sup.js | 1 + core-js/stable/string/trim-end.js | 1 + core-js/stable/string/trim-left.js | 1 + core-js/stable/string/trim-right.js | 1 + core-js/stable/string/trim-start.js | 1 + core-js/stable/string/trim.js | 1 + core-js/stable/string/virtual/anchor.js | 1 + core-js/stable/string/virtual/big.js | 1 + core-js/stable/string/virtual/blink.js | 1 + core-js/stable/string/virtual/bold.js | 1 + .../stable/string/virtual/code-point-at.js | 1 + core-js/stable/string/virtual/ends-with.js | 1 + core-js/stable/string/virtual/fixed.js | 1 + core-js/stable/string/virtual/fontcolor.js | 1 + core-js/stable/string/virtual/fontsize.js | 1 + core-js/stable/string/virtual/includes.js | 1 + core-js/stable/string/virtual/index.js | 1 + core-js/stable/string/virtual/italics.js | 1 + core-js/stable/string/virtual/iterator.js | 1 + core-js/stable/string/virtual/link.js | 1 + core-js/stable/string/virtual/match-all.js | 1 + core-js/stable/string/virtual/pad-end.js | 1 + core-js/stable/string/virtual/pad-start.js | 1 + core-js/stable/string/virtual/repeat.js | 1 + core-js/stable/string/virtual/small.js | 1 + core-js/stable/string/virtual/starts-with.js | 1 + core-js/stable/string/virtual/strike.js | 1 + core-js/stable/string/virtual/sub.js | 1 + core-js/stable/string/virtual/sup.js | 1 + core-js/stable/string/virtual/trim-end.js | 1 + core-js/stable/string/virtual/trim-left.js | 1 + core-js/stable/string/virtual/trim-right.js | 1 + core-js/stable/string/virtual/trim-start.js | 1 + core-js/stable/string/virtual/trim.js | 1 + core-js/stable/symbol/async-iterator.js | 1 + core-js/stable/symbol/description.js | 1 + core-js/stable/symbol/for.js | 1 + core-js/stable/symbol/has-instance.js | 1 + core-js/stable/symbol/index.js | 1 + core-js/stable/symbol/is-concat-spreadable.js | 1 + core-js/stable/symbol/iterator.js | 1 + core-js/stable/symbol/key-for.js | 1 + core-js/stable/symbol/match-all.js | 1 + core-js/stable/symbol/match.js | 1 + core-js/stable/symbol/replace.js | 1 + core-js/stable/symbol/search.js | 1 + core-js/stable/symbol/species.js | 1 + core-js/stable/symbol/split.js | 1 + core-js/stable/symbol/to-primitive.js | 1 + core-js/stable/symbol/to-string-tag.js | 1 + core-js/stable/symbol/unscopables.js | 1 + core-js/stable/typed-array/copy-within.js | 1 + core-js/stable/typed-array/entries.js | 1 + core-js/stable/typed-array/every.js | 1 + core-js/stable/typed-array/fill.js | 1 + core-js/stable/typed-array/filter.js | 1 + core-js/stable/typed-array/find-index.js | 1 + core-js/stable/typed-array/find.js | 1 + core-js/stable/typed-array/float32-array.js | 1 + core-js/stable/typed-array/float64-array.js | 1 + core-js/stable/typed-array/for-each.js | 1 + core-js/stable/typed-array/from.js | 1 + core-js/stable/typed-array/includes.js | 1 + core-js/stable/typed-array/index-of.js | 1 + core-js/stable/typed-array/index.js | 1 + core-js/stable/typed-array/int16-array.js | 1 + core-js/stable/typed-array/int32-array.js | 1 + core-js/stable/typed-array/int8-array.js | 1 + core-js/stable/typed-array/iterator.js | 1 + core-js/stable/typed-array/join.js | 1 + core-js/stable/typed-array/keys.js | 1 + core-js/stable/typed-array/last-index-of.js | 1 + core-js/stable/typed-array/map.js | 1 + core-js/stable/typed-array/of.js | 1 + core-js/stable/typed-array/reduce-right.js | 1 + core-js/stable/typed-array/reduce.js | 1 + core-js/stable/typed-array/reverse.js | 1 + core-js/stable/typed-array/set.js | 1 + core-js/stable/typed-array/slice.js | 1 + core-js/stable/typed-array/some.js | 1 + core-js/stable/typed-array/sort.js | 1 + core-js/stable/typed-array/subarray.js | 1 + .../stable/typed-array/to-locale-string.js | 1 + core-js/stable/typed-array/to-string.js | 1 + core-js/stable/typed-array/uint16-array.js | 1 + core-js/stable/typed-array/uint32-array.js | 1 + core-js/stable/typed-array/uint8-array.js | 1 + .../stable/typed-array/uint8-clamped-array.js | 1 + core-js/stable/typed-array/values.js | 1 + core-js/stable/url-search-params/index.js | 1 + core-js/stable/url/index.js | 1 + core-js/stable/url/to-json.js | 1 + core-js/stable/weak-map/index.js | 1 + core-js/stable/weak-set/index.js | 1 + core-js/stage/0.js | 5 + core-js/stage/1.js | 15 + core-js/stage/2.js | 7 + core-js/stage/3.js | 3 + core-js/stage/4.js | 4 + core-js/stage/README.md | 1 + core-js/stage/index.js | 1 + core-js/stage/pre.js | 3 + core-js/web/README.md | 1 + core-js/web/dom-collections.js | 4 + core-js/web/immediate.js | 3 + core-js/web/index.js | 10 + core-js/web/queue-microtask.js | 4 + core-js/web/timers.js | 3 + core-js/web/url-search-params.js | 4 + core-js/web/url.js | 6 + 1604 files changed, 15082 insertions(+) create mode 100644 core-js/LICENSE create mode 100644 core-js/README.md create mode 100644 core-js/configurator.js create mode 100644 core-js/es/README.md create mode 100644 core-js/es/array-buffer/constructor.js create mode 100644 core-js/es/array-buffer/index.js create mode 100644 core-js/es/array-buffer/is-view.js create mode 100644 core-js/es/array-buffer/slice.js create mode 100644 core-js/es/array/concat.js create mode 100644 core-js/es/array/copy-within.js create mode 100644 core-js/es/array/entries.js create mode 100644 core-js/es/array/every.js create mode 100644 core-js/es/array/fill.js create mode 100644 core-js/es/array/filter.js create mode 100644 core-js/es/array/find-index.js create mode 100644 core-js/es/array/find.js create mode 100644 core-js/es/array/flat-map.js create mode 100644 core-js/es/array/flat.js create mode 100644 core-js/es/array/for-each.js create mode 100644 core-js/es/array/from.js create mode 100644 core-js/es/array/includes.js create mode 100644 core-js/es/array/index-of.js create mode 100644 core-js/es/array/index.js create mode 100644 core-js/es/array/is-array.js create mode 100644 core-js/es/array/iterator.js create mode 100644 core-js/es/array/join.js create mode 100644 core-js/es/array/keys.js create mode 100644 core-js/es/array/last-index-of.js create mode 100644 core-js/es/array/map.js create mode 100644 core-js/es/array/of.js create mode 100644 core-js/es/array/reduce-right.js create mode 100644 core-js/es/array/reduce.js create mode 100644 core-js/es/array/reverse.js create mode 100644 core-js/es/array/slice.js create mode 100644 core-js/es/array/some.js create mode 100644 core-js/es/array/sort.js create mode 100644 core-js/es/array/splice.js create mode 100644 core-js/es/array/values.js create mode 100644 core-js/es/array/virtual/concat.js create mode 100644 core-js/es/array/virtual/copy-within.js create mode 100644 core-js/es/array/virtual/entries.js create mode 100644 core-js/es/array/virtual/every.js create mode 100644 core-js/es/array/virtual/fill.js create mode 100644 core-js/es/array/virtual/filter.js create mode 100644 core-js/es/array/virtual/find-index.js create mode 100644 core-js/es/array/virtual/find.js create mode 100644 core-js/es/array/virtual/flat-map.js create mode 100644 core-js/es/array/virtual/flat.js create mode 100644 core-js/es/array/virtual/for-each.js create mode 100644 core-js/es/array/virtual/includes.js create mode 100644 core-js/es/array/virtual/index-of.js create mode 100644 core-js/es/array/virtual/index.js create mode 100644 core-js/es/array/virtual/iterator.js create mode 100644 core-js/es/array/virtual/join.js create mode 100644 core-js/es/array/virtual/keys.js create mode 100644 core-js/es/array/virtual/last-index-of.js create mode 100644 core-js/es/array/virtual/map.js create mode 100644 core-js/es/array/virtual/reduce-right.js create mode 100644 core-js/es/array/virtual/reduce.js create mode 100644 core-js/es/array/virtual/reverse.js create mode 100644 core-js/es/array/virtual/slice.js create mode 100644 core-js/es/array/virtual/some.js create mode 100644 core-js/es/array/virtual/sort.js create mode 100644 core-js/es/array/virtual/splice.js create mode 100644 core-js/es/array/virtual/values.js create mode 100644 core-js/es/data-view/index.js create mode 100644 core-js/es/date/index.js create mode 100644 core-js/es/date/now.js create mode 100644 core-js/es/date/to-iso-string.js create mode 100644 core-js/es/date/to-json.js create mode 100644 core-js/es/date/to-primitive.js create mode 100644 core-js/es/date/to-string.js create mode 100644 core-js/es/function/bind.js create mode 100644 core-js/es/function/has-instance.js create mode 100644 core-js/es/function/index.js create mode 100644 core-js/es/function/name.js create mode 100644 core-js/es/function/virtual/bind.js create mode 100644 core-js/es/function/virtual/index.js create mode 100644 core-js/es/index.js create mode 100644 core-js/es/instance/bind.js create mode 100644 core-js/es/instance/code-point-at.js create mode 100644 core-js/es/instance/concat.js create mode 100644 core-js/es/instance/copy-within.js create mode 100644 core-js/es/instance/ends-with.js create mode 100644 core-js/es/instance/entries.js create mode 100644 core-js/es/instance/every.js create mode 100644 core-js/es/instance/fill.js create mode 100644 core-js/es/instance/filter.js create mode 100644 core-js/es/instance/find-index.js create mode 100644 core-js/es/instance/find.js create mode 100644 core-js/es/instance/flags.js create mode 100644 core-js/es/instance/flat-map.js create mode 100644 core-js/es/instance/flat.js create mode 100644 core-js/es/instance/for-each.js create mode 100644 core-js/es/instance/includes.js create mode 100644 core-js/es/instance/index-of.js create mode 100644 core-js/es/instance/keys.js create mode 100644 core-js/es/instance/last-index-of.js create mode 100644 core-js/es/instance/map.js create mode 100644 core-js/es/instance/match-all.js create mode 100644 core-js/es/instance/pad-end.js create mode 100644 core-js/es/instance/pad-start.js create mode 100644 core-js/es/instance/reduce-right.js create mode 100644 core-js/es/instance/reduce.js create mode 100644 core-js/es/instance/repeat.js create mode 100644 core-js/es/instance/reverse.js create mode 100644 core-js/es/instance/slice.js create mode 100644 core-js/es/instance/some.js create mode 100644 core-js/es/instance/sort.js create mode 100644 core-js/es/instance/splice.js create mode 100644 core-js/es/instance/starts-with.js create mode 100644 core-js/es/instance/trim-end.js create mode 100644 core-js/es/instance/trim-left.js create mode 100644 core-js/es/instance/trim-right.js create mode 100644 core-js/es/instance/trim-start.js create mode 100644 core-js/es/instance/trim.js create mode 100644 core-js/es/instance/values.js create mode 100644 core-js/es/json/index.js create mode 100644 core-js/es/json/stringify.js create mode 100644 core-js/es/json/to-string-tag.js create mode 100644 core-js/es/map/index.js create mode 100644 core-js/es/math/acosh.js create mode 100644 core-js/es/math/asinh.js create mode 100644 core-js/es/math/atanh.js create mode 100644 core-js/es/math/cbrt.js create mode 100644 core-js/es/math/clz32.js create mode 100644 core-js/es/math/cosh.js create mode 100644 core-js/es/math/expm1.js create mode 100644 core-js/es/math/fround.js create mode 100644 core-js/es/math/hypot.js create mode 100644 core-js/es/math/imul.js create mode 100644 core-js/es/math/index.js create mode 100644 core-js/es/math/log10.js create mode 100644 core-js/es/math/log1p.js create mode 100644 core-js/es/math/log2.js create mode 100644 core-js/es/math/sign.js create mode 100644 core-js/es/math/sinh.js create mode 100644 core-js/es/math/tanh.js create mode 100644 core-js/es/math/to-string-tag.js create mode 100644 core-js/es/math/trunc.js create mode 100644 core-js/es/number/constructor.js create mode 100644 core-js/es/number/epsilon.js create mode 100644 core-js/es/number/index.js create mode 100644 core-js/es/number/is-finite.js create mode 100644 core-js/es/number/is-integer.js create mode 100644 core-js/es/number/is-nan.js create mode 100644 core-js/es/number/is-safe-integer.js create mode 100644 core-js/es/number/max-safe-integer.js create mode 100644 core-js/es/number/min-safe-integer.js create mode 100644 core-js/es/number/parse-float.js create mode 100644 core-js/es/number/parse-int.js create mode 100644 core-js/es/number/to-fixed.js create mode 100644 core-js/es/number/to-precision.js create mode 100644 core-js/es/number/virtual/index.js create mode 100644 core-js/es/number/virtual/to-fixed.js create mode 100644 core-js/es/number/virtual/to-precision.js create mode 100644 core-js/es/object/assign.js create mode 100644 core-js/es/object/create.js create mode 100644 core-js/es/object/define-getter.js create mode 100644 core-js/es/object/define-properties.js create mode 100644 core-js/es/object/define-property.js create mode 100644 core-js/es/object/define-setter.js create mode 100644 core-js/es/object/entries.js create mode 100644 core-js/es/object/freeze.js create mode 100644 core-js/es/object/from-entries.js create mode 100644 core-js/es/object/get-own-property-descriptor.js create mode 100644 core-js/es/object/get-own-property-descriptors.js create mode 100644 core-js/es/object/get-own-property-names.js create mode 100644 core-js/es/object/get-own-property-symbols.js create mode 100644 core-js/es/object/get-prototype-of.js create mode 100644 core-js/es/object/index.js create mode 100644 core-js/es/object/is-extensible.js create mode 100644 core-js/es/object/is-frozen.js create mode 100644 core-js/es/object/is-sealed.js create mode 100644 core-js/es/object/is.js create mode 100644 core-js/es/object/keys.js create mode 100644 core-js/es/object/lookup-getter.js create mode 100644 core-js/es/object/lookup-setter.js create mode 100644 core-js/es/object/prevent-extensions.js create mode 100644 core-js/es/object/seal.js create mode 100644 core-js/es/object/set-prototype-of.js create mode 100644 core-js/es/object/to-string.js create mode 100644 core-js/es/object/values.js create mode 100644 core-js/es/parse-float.js create mode 100644 core-js/es/parse-int.js create mode 100644 core-js/es/promise/all-settled.js create mode 100644 core-js/es/promise/finally.js create mode 100644 core-js/es/promise/index.js create mode 100644 core-js/es/reflect/apply.js create mode 100644 core-js/es/reflect/construct.js create mode 100644 core-js/es/reflect/define-property.js create mode 100644 core-js/es/reflect/delete-property.js create mode 100644 core-js/es/reflect/get-own-property-descriptor.js create mode 100644 core-js/es/reflect/get-prototype-of.js create mode 100644 core-js/es/reflect/get.js create mode 100644 core-js/es/reflect/has.js create mode 100644 core-js/es/reflect/index.js create mode 100644 core-js/es/reflect/is-extensible.js create mode 100644 core-js/es/reflect/own-keys.js create mode 100644 core-js/es/reflect/prevent-extensions.js create mode 100644 core-js/es/reflect/set-prototype-of.js create mode 100644 core-js/es/reflect/set.js create mode 100644 core-js/es/regexp/constructor.js create mode 100644 core-js/es/regexp/flags.js create mode 100644 core-js/es/regexp/index.js create mode 100644 core-js/es/regexp/match.js create mode 100644 core-js/es/regexp/replace.js create mode 100644 core-js/es/regexp/search.js create mode 100644 core-js/es/regexp/split.js create mode 100644 core-js/es/regexp/to-string.js create mode 100644 core-js/es/set/index.js create mode 100644 core-js/es/string/anchor.js create mode 100644 core-js/es/string/big.js create mode 100644 core-js/es/string/blink.js create mode 100644 core-js/es/string/bold.js create mode 100644 core-js/es/string/code-point-at.js create mode 100644 core-js/es/string/ends-with.js create mode 100644 core-js/es/string/fixed.js create mode 100644 core-js/es/string/fontcolor.js create mode 100644 core-js/es/string/fontsize.js create mode 100644 core-js/es/string/from-code-point.js create mode 100644 core-js/es/string/includes.js create mode 100644 core-js/es/string/index.js create mode 100644 core-js/es/string/italics.js create mode 100644 core-js/es/string/iterator.js create mode 100644 core-js/es/string/link.js create mode 100644 core-js/es/string/match-all.js create mode 100644 core-js/es/string/match.js create mode 100644 core-js/es/string/pad-end.js create mode 100644 core-js/es/string/pad-start.js create mode 100644 core-js/es/string/raw.js create mode 100644 core-js/es/string/repeat.js create mode 100644 core-js/es/string/replace.js create mode 100644 core-js/es/string/search.js create mode 100644 core-js/es/string/small.js create mode 100644 core-js/es/string/split.js create mode 100644 core-js/es/string/starts-with.js create mode 100644 core-js/es/string/strike.js create mode 100644 core-js/es/string/sub.js create mode 100644 core-js/es/string/sup.js create mode 100644 core-js/es/string/trim-end.js create mode 100644 core-js/es/string/trim-left.js create mode 100644 core-js/es/string/trim-right.js create mode 100644 core-js/es/string/trim-start.js create mode 100644 core-js/es/string/trim.js create mode 100644 core-js/es/string/virtual/anchor.js create mode 100644 core-js/es/string/virtual/big.js create mode 100644 core-js/es/string/virtual/blink.js create mode 100644 core-js/es/string/virtual/bold.js create mode 100644 core-js/es/string/virtual/code-point-at.js create mode 100644 core-js/es/string/virtual/ends-with.js create mode 100644 core-js/es/string/virtual/fixed.js create mode 100644 core-js/es/string/virtual/fontcolor.js create mode 100644 core-js/es/string/virtual/fontsize.js create mode 100644 core-js/es/string/virtual/includes.js create mode 100644 core-js/es/string/virtual/index.js create mode 100644 core-js/es/string/virtual/italics.js create mode 100644 core-js/es/string/virtual/iterator.js create mode 100644 core-js/es/string/virtual/link.js create mode 100644 core-js/es/string/virtual/match-all.js create mode 100644 core-js/es/string/virtual/pad-end.js create mode 100644 core-js/es/string/virtual/pad-start.js create mode 100644 core-js/es/string/virtual/repeat.js create mode 100644 core-js/es/string/virtual/small.js create mode 100644 core-js/es/string/virtual/starts-with.js create mode 100644 core-js/es/string/virtual/strike.js create mode 100644 core-js/es/string/virtual/sub.js create mode 100644 core-js/es/string/virtual/sup.js create mode 100644 core-js/es/string/virtual/trim-end.js create mode 100644 core-js/es/string/virtual/trim-left.js create mode 100644 core-js/es/string/virtual/trim-right.js create mode 100644 core-js/es/string/virtual/trim-start.js create mode 100644 core-js/es/string/virtual/trim.js create mode 100644 core-js/es/symbol/async-iterator.js create mode 100644 core-js/es/symbol/description.js create mode 100644 core-js/es/symbol/for.js create mode 100644 core-js/es/symbol/has-instance.js create mode 100644 core-js/es/symbol/index.js create mode 100644 core-js/es/symbol/is-concat-spreadable.js create mode 100644 core-js/es/symbol/iterator.js create mode 100644 core-js/es/symbol/key-for.js create mode 100644 core-js/es/symbol/match-all.js create mode 100644 core-js/es/symbol/match.js create mode 100644 core-js/es/symbol/replace.js create mode 100644 core-js/es/symbol/search.js create mode 100644 core-js/es/symbol/species.js create mode 100644 core-js/es/symbol/split.js create mode 100644 core-js/es/symbol/to-primitive.js create mode 100644 core-js/es/symbol/to-string-tag.js create mode 100644 core-js/es/symbol/unscopables.js create mode 100644 core-js/es/typed-array/copy-within.js create mode 100644 core-js/es/typed-array/entries.js create mode 100644 core-js/es/typed-array/every.js create mode 100644 core-js/es/typed-array/fill.js create mode 100644 core-js/es/typed-array/filter.js create mode 100644 core-js/es/typed-array/find-index.js create mode 100644 core-js/es/typed-array/find.js create mode 100644 core-js/es/typed-array/float32-array.js create mode 100644 core-js/es/typed-array/float64-array.js create mode 100644 core-js/es/typed-array/for-each.js create mode 100644 core-js/es/typed-array/from.js create mode 100644 core-js/es/typed-array/includes.js create mode 100644 core-js/es/typed-array/index-of.js create mode 100644 core-js/es/typed-array/index.js create mode 100644 core-js/es/typed-array/int16-array.js create mode 100644 core-js/es/typed-array/int32-array.js create mode 100644 core-js/es/typed-array/int8-array.js create mode 100644 core-js/es/typed-array/iterator.js create mode 100644 core-js/es/typed-array/join.js create mode 100644 core-js/es/typed-array/keys.js create mode 100644 core-js/es/typed-array/last-index-of.js create mode 100644 core-js/es/typed-array/map.js create mode 100644 core-js/es/typed-array/methods.js create mode 100644 core-js/es/typed-array/of.js create mode 100644 core-js/es/typed-array/reduce-right.js create mode 100644 core-js/es/typed-array/reduce.js create mode 100644 core-js/es/typed-array/reverse.js create mode 100644 core-js/es/typed-array/set.js create mode 100644 core-js/es/typed-array/slice.js create mode 100644 core-js/es/typed-array/some.js create mode 100644 core-js/es/typed-array/sort.js create mode 100644 core-js/es/typed-array/subarray.js create mode 100644 core-js/es/typed-array/to-locale-string.js create mode 100644 core-js/es/typed-array/to-string.js create mode 100644 core-js/es/typed-array/uint16-array.js create mode 100644 core-js/es/typed-array/uint32-array.js create mode 100644 core-js/es/typed-array/uint8-array.js create mode 100644 core-js/es/typed-array/uint8-clamped-array.js create mode 100644 core-js/es/typed-array/values.js create mode 100644 core-js/es/weak-map/index.js create mode 100644 core-js/es/weak-set/index.js create mode 100644 core-js/features/README.md create mode 100644 core-js/features/aggregate-error.js create mode 100644 core-js/features/array-buffer/constructor.js create mode 100644 core-js/features/array-buffer/index.js create mode 100644 core-js/features/array-buffer/is-view.js create mode 100644 core-js/features/array-buffer/slice.js create mode 100644 core-js/features/array/concat.js create mode 100644 core-js/features/array/copy-within.js create mode 100644 core-js/features/array/entries.js create mode 100644 core-js/features/array/every.js create mode 100644 core-js/features/array/fill.js create mode 100644 core-js/features/array/filter.js create mode 100644 core-js/features/array/find-index.js create mode 100644 core-js/features/array/find.js create mode 100644 core-js/features/array/flat-map.js create mode 100644 core-js/features/array/flat.js create mode 100644 core-js/features/array/for-each.js create mode 100644 core-js/features/array/from.js create mode 100644 core-js/features/array/includes.js create mode 100644 core-js/features/array/index-of.js create mode 100644 core-js/features/array/index.js create mode 100644 core-js/features/array/is-array.js create mode 100644 core-js/features/array/is-template-object.js create mode 100644 core-js/features/array/iterator.js create mode 100644 core-js/features/array/join.js create mode 100644 core-js/features/array/keys.js create mode 100644 core-js/features/array/last-index-of.js create mode 100644 core-js/features/array/last-index.js create mode 100644 core-js/features/array/last-item.js create mode 100644 core-js/features/array/map.js create mode 100644 core-js/features/array/of.js create mode 100644 core-js/features/array/reduce-right.js create mode 100644 core-js/features/array/reduce.js create mode 100644 core-js/features/array/reverse.js create mode 100644 core-js/features/array/slice.js create mode 100644 core-js/features/array/some.js create mode 100644 core-js/features/array/sort.js create mode 100644 core-js/features/array/splice.js create mode 100644 core-js/features/array/values.js create mode 100644 core-js/features/array/virtual/concat.js create mode 100644 core-js/features/array/virtual/copy-within.js create mode 100644 core-js/features/array/virtual/entries.js create mode 100644 core-js/features/array/virtual/every.js create mode 100644 core-js/features/array/virtual/fill.js create mode 100644 core-js/features/array/virtual/filter.js create mode 100644 core-js/features/array/virtual/find-index.js create mode 100644 core-js/features/array/virtual/find.js create mode 100644 core-js/features/array/virtual/flat-map.js create mode 100644 core-js/features/array/virtual/flat.js create mode 100644 core-js/features/array/virtual/for-each.js create mode 100644 core-js/features/array/virtual/includes.js create mode 100644 core-js/features/array/virtual/index-of.js create mode 100644 core-js/features/array/virtual/index.js create mode 100644 core-js/features/array/virtual/iterator.js create mode 100644 core-js/features/array/virtual/join.js create mode 100644 core-js/features/array/virtual/keys.js create mode 100644 core-js/features/array/virtual/last-index-of.js create mode 100644 core-js/features/array/virtual/map.js create mode 100644 core-js/features/array/virtual/reduce-right.js create mode 100644 core-js/features/array/virtual/reduce.js create mode 100644 core-js/features/array/virtual/reverse.js create mode 100644 core-js/features/array/virtual/slice.js create mode 100644 core-js/features/array/virtual/some.js create mode 100644 core-js/features/array/virtual/sort.js create mode 100644 core-js/features/array/virtual/splice.js create mode 100644 core-js/features/array/virtual/values.js create mode 100644 core-js/features/clear-immediate.js create mode 100644 core-js/features/composite-key.js create mode 100644 core-js/features/composite-symbol.js create mode 100644 core-js/features/data-view/index.js create mode 100644 core-js/features/date/index.js create mode 100644 core-js/features/date/now.js create mode 100644 core-js/features/date/to-iso-string.js create mode 100644 core-js/features/date/to-json.js create mode 100644 core-js/features/date/to-primitive.js create mode 100644 core-js/features/date/to-string.js create mode 100644 core-js/features/dom-collections/for-each.js create mode 100644 core-js/features/dom-collections/index.js create mode 100644 core-js/features/dom-collections/iterator.js create mode 100644 core-js/features/function/bind.js create mode 100644 core-js/features/function/has-instance.js create mode 100644 core-js/features/function/index.js create mode 100644 core-js/features/function/name.js create mode 100644 core-js/features/function/virtual/bind.js create mode 100644 core-js/features/function/virtual/index.js create mode 100644 core-js/features/get-iterator-method.js create mode 100644 core-js/features/get-iterator.js create mode 100644 core-js/features/global-this.js create mode 100644 core-js/features/index.js create mode 100644 core-js/features/instance/at.js create mode 100644 core-js/features/instance/bind.js create mode 100644 core-js/features/instance/code-point-at.js create mode 100644 core-js/features/instance/code-points.js create mode 100644 core-js/features/instance/concat.js create mode 100644 core-js/features/instance/copy-within.js create mode 100644 core-js/features/instance/ends-with.js create mode 100644 core-js/features/instance/entries.js create mode 100644 core-js/features/instance/every.js create mode 100644 core-js/features/instance/fill.js create mode 100644 core-js/features/instance/filter.js create mode 100644 core-js/features/instance/find-index.js create mode 100644 core-js/features/instance/find.js create mode 100644 core-js/features/instance/flags.js create mode 100644 core-js/features/instance/flat-map.js create mode 100644 core-js/features/instance/flat.js create mode 100644 core-js/features/instance/for-each.js create mode 100644 core-js/features/instance/includes.js create mode 100644 core-js/features/instance/index-of.js create mode 100644 core-js/features/instance/keys.js create mode 100644 core-js/features/instance/last-index-of.js create mode 100644 core-js/features/instance/map.js create mode 100644 core-js/features/instance/match-all.js create mode 100644 core-js/features/instance/pad-end.js create mode 100644 core-js/features/instance/pad-start.js create mode 100644 core-js/features/instance/reduce-right.js create mode 100644 core-js/features/instance/reduce.js create mode 100644 core-js/features/instance/repeat.js create mode 100644 core-js/features/instance/replace-all.js create mode 100644 core-js/features/instance/reverse.js create mode 100644 core-js/features/instance/slice.js create mode 100644 core-js/features/instance/some.js create mode 100644 core-js/features/instance/sort.js create mode 100644 core-js/features/instance/splice.js create mode 100644 core-js/features/instance/starts-with.js create mode 100644 core-js/features/instance/trim-end.js create mode 100644 core-js/features/instance/trim-left.js create mode 100644 core-js/features/instance/trim-right.js create mode 100644 core-js/features/instance/trim-start.js create mode 100644 core-js/features/instance/trim.js create mode 100644 core-js/features/instance/values.js create mode 100644 core-js/features/is-iterable.js create mode 100644 core-js/features/json/index.js create mode 100644 core-js/features/json/stringify.js create mode 100644 core-js/features/json/to-string-tag.js create mode 100644 core-js/features/map/delete-all.js create mode 100644 core-js/features/map/every.js create mode 100644 core-js/features/map/filter.js create mode 100644 core-js/features/map/find-key.js create mode 100644 core-js/features/map/find.js create mode 100644 core-js/features/map/from.js create mode 100644 core-js/features/map/group-by.js create mode 100644 core-js/features/map/includes.js create mode 100644 core-js/features/map/index.js create mode 100644 core-js/features/map/key-by.js create mode 100644 core-js/features/map/key-of.js create mode 100644 core-js/features/map/map-keys.js create mode 100644 core-js/features/map/map-values.js create mode 100644 core-js/features/map/merge.js create mode 100644 core-js/features/map/of.js create mode 100644 core-js/features/map/reduce.js create mode 100644 core-js/features/map/some.js create mode 100644 core-js/features/map/update-or-insert.js create mode 100644 core-js/features/map/update.js create mode 100644 core-js/features/math/acosh.js create mode 100644 core-js/features/math/asinh.js create mode 100644 core-js/features/math/atanh.js create mode 100644 core-js/features/math/cbrt.js create mode 100644 core-js/features/math/clamp.js create mode 100644 core-js/features/math/clz32.js create mode 100644 core-js/features/math/cosh.js create mode 100644 core-js/features/math/deg-per-rad.js create mode 100644 core-js/features/math/degrees.js create mode 100644 core-js/features/math/expm1.js create mode 100644 core-js/features/math/fround.js create mode 100644 core-js/features/math/fscale.js create mode 100644 core-js/features/math/hypot.js create mode 100644 core-js/features/math/iaddh.js create mode 100644 core-js/features/math/imul.js create mode 100644 core-js/features/math/imulh.js create mode 100644 core-js/features/math/index.js create mode 100644 core-js/features/math/isubh.js create mode 100644 core-js/features/math/log10.js create mode 100644 core-js/features/math/log1p.js create mode 100644 core-js/features/math/log2.js create mode 100644 core-js/features/math/rad-per-deg.js create mode 100644 core-js/features/math/radians.js create mode 100644 core-js/features/math/scale.js create mode 100644 core-js/features/math/seeded-prng.js create mode 100644 core-js/features/math/sign.js create mode 100644 core-js/features/math/signbit.js create mode 100644 core-js/features/math/sinh.js create mode 100644 core-js/features/math/tanh.js create mode 100644 core-js/features/math/to-string-tag.js create mode 100644 core-js/features/math/trunc.js create mode 100644 core-js/features/math/umulh.js create mode 100644 core-js/features/number/constructor.js create mode 100644 core-js/features/number/epsilon.js create mode 100644 core-js/features/number/from-string.js create mode 100644 core-js/features/number/index.js create mode 100644 core-js/features/number/is-finite.js create mode 100644 core-js/features/number/is-integer.js create mode 100644 core-js/features/number/is-nan.js create mode 100644 core-js/features/number/is-safe-integer.js create mode 100644 core-js/features/number/max-safe-integer.js create mode 100644 core-js/features/number/min-safe-integer.js create mode 100644 core-js/features/number/parse-float.js create mode 100644 core-js/features/number/parse-int.js create mode 100644 core-js/features/number/to-fixed.js create mode 100644 core-js/features/number/to-precision.js create mode 100644 core-js/features/number/virtual/index.js create mode 100644 core-js/features/number/virtual/to-fixed.js create mode 100644 core-js/features/number/virtual/to-precision.js create mode 100644 core-js/features/object/assign.js create mode 100644 core-js/features/object/create.js create mode 100644 core-js/features/object/define-getter.js create mode 100644 core-js/features/object/define-properties.js create mode 100644 core-js/features/object/define-property.js create mode 100644 core-js/features/object/define-setter.js create mode 100644 core-js/features/object/entries.js create mode 100644 core-js/features/object/freeze.js create mode 100644 core-js/features/object/from-entries.js create mode 100644 core-js/features/object/get-own-property-descriptor.js create mode 100644 core-js/features/object/get-own-property-descriptors.js create mode 100644 core-js/features/object/get-own-property-names.js create mode 100644 core-js/features/object/get-own-property-symbols.js create mode 100644 core-js/features/object/get-prototype-of.js create mode 100644 core-js/features/object/index.js create mode 100644 core-js/features/object/is-extensible.js create mode 100644 core-js/features/object/is-frozen.js create mode 100644 core-js/features/object/is-sealed.js create mode 100644 core-js/features/object/is.js create mode 100644 core-js/features/object/keys.js create mode 100644 core-js/features/object/lookup-getter.js create mode 100644 core-js/features/object/lookup-setter.js create mode 100644 core-js/features/object/prevent-extensions.js create mode 100644 core-js/features/object/seal.js create mode 100644 core-js/features/object/set-prototype-of.js create mode 100644 core-js/features/object/to-string.js create mode 100644 core-js/features/object/values.js create mode 100644 core-js/features/observable/index.js create mode 100644 core-js/features/parse-float.js create mode 100644 core-js/features/parse-int.js create mode 100644 core-js/features/promise/all-settled.js create mode 100644 core-js/features/promise/any.js create mode 100644 core-js/features/promise/finally.js create mode 100644 core-js/features/promise/index.js create mode 100644 core-js/features/promise/try.js create mode 100644 core-js/features/queue-microtask.js create mode 100644 core-js/features/reflect/apply.js create mode 100644 core-js/features/reflect/construct.js create mode 100644 core-js/features/reflect/define-metadata.js create mode 100644 core-js/features/reflect/define-property.js create mode 100644 core-js/features/reflect/delete-metadata.js create mode 100644 core-js/features/reflect/delete-property.js create mode 100644 core-js/features/reflect/get-metadata-keys.js create mode 100644 core-js/features/reflect/get-metadata.js create mode 100644 core-js/features/reflect/get-own-metadata-keys.js create mode 100644 core-js/features/reflect/get-own-metadata.js create mode 100644 core-js/features/reflect/get-own-property-descriptor.js create mode 100644 core-js/features/reflect/get-prototype-of.js create mode 100644 core-js/features/reflect/get.js create mode 100644 core-js/features/reflect/has-metadata.js create mode 100644 core-js/features/reflect/has-own-metadata.js create mode 100644 core-js/features/reflect/has.js create mode 100644 core-js/features/reflect/index.js create mode 100644 core-js/features/reflect/is-extensible.js create mode 100644 core-js/features/reflect/metadata.js create mode 100644 core-js/features/reflect/own-keys.js create mode 100644 core-js/features/reflect/prevent-extensions.js create mode 100644 core-js/features/reflect/set-prototype-of.js create mode 100644 core-js/features/reflect/set.js create mode 100644 core-js/features/regexp/constructor.js create mode 100644 core-js/features/regexp/flags.js create mode 100644 core-js/features/regexp/index.js create mode 100644 core-js/features/regexp/match.js create mode 100644 core-js/features/regexp/replace.js create mode 100644 core-js/features/regexp/search.js create mode 100644 core-js/features/regexp/split.js create mode 100644 core-js/features/regexp/to-string.js create mode 100644 core-js/features/set-immediate.js create mode 100644 core-js/features/set-interval.js create mode 100644 core-js/features/set-timeout.js create mode 100644 core-js/features/set/add-all.js create mode 100644 core-js/features/set/delete-all.js create mode 100644 core-js/features/set/difference.js create mode 100644 core-js/features/set/every.js create mode 100644 core-js/features/set/filter.js create mode 100644 core-js/features/set/find.js create mode 100644 core-js/features/set/from.js create mode 100644 core-js/features/set/index.js create mode 100644 core-js/features/set/intersection.js create mode 100644 core-js/features/set/is-disjoint-from.js create mode 100644 core-js/features/set/is-subset-of.js create mode 100644 core-js/features/set/is-superset-of.js create mode 100644 core-js/features/set/join.js create mode 100644 core-js/features/set/map.js create mode 100644 core-js/features/set/of.js create mode 100644 core-js/features/set/reduce.js create mode 100644 core-js/features/set/some.js create mode 100644 core-js/features/set/symmetric-difference.js create mode 100644 core-js/features/set/union.js create mode 100644 core-js/features/string/anchor.js create mode 100644 core-js/features/string/at.js create mode 100644 core-js/features/string/big.js create mode 100644 core-js/features/string/blink.js create mode 100644 core-js/features/string/bold.js create mode 100644 core-js/features/string/code-point-at.js create mode 100644 core-js/features/string/code-points.js create mode 100644 core-js/features/string/ends-with.js create mode 100644 core-js/features/string/fixed.js create mode 100644 core-js/features/string/fontcolor.js create mode 100644 core-js/features/string/fontsize.js create mode 100644 core-js/features/string/from-code-point.js create mode 100644 core-js/features/string/includes.js create mode 100644 core-js/features/string/index.js create mode 100644 core-js/features/string/italics.js create mode 100644 core-js/features/string/iterator.js create mode 100644 core-js/features/string/link.js create mode 100644 core-js/features/string/match-all.js create mode 100644 core-js/features/string/match.js create mode 100644 core-js/features/string/pad-end.js create mode 100644 core-js/features/string/pad-start.js create mode 100644 core-js/features/string/raw.js create mode 100644 core-js/features/string/repeat.js create mode 100644 core-js/features/string/replace-all.js create mode 100644 core-js/features/string/replace.js create mode 100644 core-js/features/string/search.js create mode 100644 core-js/features/string/small.js create mode 100644 core-js/features/string/split.js create mode 100644 core-js/features/string/starts-with.js create mode 100644 core-js/features/string/strike.js create mode 100644 core-js/features/string/sub.js create mode 100644 core-js/features/string/sup.js create mode 100644 core-js/features/string/trim-end.js create mode 100644 core-js/features/string/trim-left.js create mode 100644 core-js/features/string/trim-right.js create mode 100644 core-js/features/string/trim-start.js create mode 100644 core-js/features/string/trim.js create mode 100644 core-js/features/string/virtual/anchor.js create mode 100644 core-js/features/string/virtual/at.js create mode 100644 core-js/features/string/virtual/big.js create mode 100644 core-js/features/string/virtual/blink.js create mode 100644 core-js/features/string/virtual/bold.js create mode 100644 core-js/features/string/virtual/code-point-at.js create mode 100644 core-js/features/string/virtual/code-points.js create mode 100644 core-js/features/string/virtual/ends-with.js create mode 100644 core-js/features/string/virtual/fixed.js create mode 100644 core-js/features/string/virtual/fontcolor.js create mode 100644 core-js/features/string/virtual/fontsize.js create mode 100644 core-js/features/string/virtual/includes.js create mode 100644 core-js/features/string/virtual/index.js create mode 100644 core-js/features/string/virtual/italics.js create mode 100644 core-js/features/string/virtual/iterator.js create mode 100644 core-js/features/string/virtual/link.js create mode 100644 core-js/features/string/virtual/match-all.js create mode 100644 core-js/features/string/virtual/pad-end.js create mode 100644 core-js/features/string/virtual/pad-start.js create mode 100644 core-js/features/string/virtual/repeat.js create mode 100644 core-js/features/string/virtual/replace-all.js create mode 100644 core-js/features/string/virtual/small.js create mode 100644 core-js/features/string/virtual/starts-with.js create mode 100644 core-js/features/string/virtual/strike.js create mode 100644 core-js/features/string/virtual/sub.js create mode 100644 core-js/features/string/virtual/sup.js create mode 100644 core-js/features/string/virtual/trim-end.js create mode 100644 core-js/features/string/virtual/trim-left.js create mode 100644 core-js/features/string/virtual/trim-right.js create mode 100644 core-js/features/string/virtual/trim-start.js create mode 100644 core-js/features/string/virtual/trim.js create mode 100644 core-js/features/symbol/async-dispose.js create mode 100644 core-js/features/symbol/async-iterator.js create mode 100644 core-js/features/symbol/description.js create mode 100644 core-js/features/symbol/dispose.js create mode 100644 core-js/features/symbol/for.js create mode 100644 core-js/features/symbol/has-instance.js create mode 100644 core-js/features/symbol/index.js create mode 100644 core-js/features/symbol/is-concat-spreadable.js create mode 100644 core-js/features/symbol/iterator.js create mode 100644 core-js/features/symbol/key-for.js create mode 100644 core-js/features/symbol/match-all.js create mode 100644 core-js/features/symbol/match.js create mode 100644 core-js/features/symbol/observable.js create mode 100644 core-js/features/symbol/pattern-match.js create mode 100644 core-js/features/symbol/replace-all.js create mode 100644 core-js/features/symbol/replace.js create mode 100644 core-js/features/symbol/search.js create mode 100644 core-js/features/symbol/species.js create mode 100644 core-js/features/symbol/split.js create mode 100644 core-js/features/symbol/to-primitive.js create mode 100644 core-js/features/symbol/to-string-tag.js create mode 100644 core-js/features/symbol/unscopables.js create mode 100644 core-js/features/typed-array/copy-within.js create mode 100644 core-js/features/typed-array/entries.js create mode 100644 core-js/features/typed-array/every.js create mode 100644 core-js/features/typed-array/fill.js create mode 100644 core-js/features/typed-array/filter.js create mode 100644 core-js/features/typed-array/find-index.js create mode 100644 core-js/features/typed-array/find.js create mode 100644 core-js/features/typed-array/float32-array.js create mode 100644 core-js/features/typed-array/float64-array.js create mode 100644 core-js/features/typed-array/for-each.js create mode 100644 core-js/features/typed-array/from.js create mode 100644 core-js/features/typed-array/includes.js create mode 100644 core-js/features/typed-array/index-of.js create mode 100644 core-js/features/typed-array/index.js create mode 100644 core-js/features/typed-array/int16-array.js create mode 100644 core-js/features/typed-array/int32-array.js create mode 100644 core-js/features/typed-array/int8-array.js create mode 100644 core-js/features/typed-array/iterator.js create mode 100644 core-js/features/typed-array/join.js create mode 100644 core-js/features/typed-array/keys.js create mode 100644 core-js/features/typed-array/last-index-of.js create mode 100644 core-js/features/typed-array/map.js create mode 100644 core-js/features/typed-array/of.js create mode 100644 core-js/features/typed-array/reduce-right.js create mode 100644 core-js/features/typed-array/reduce.js create mode 100644 core-js/features/typed-array/reverse.js create mode 100644 core-js/features/typed-array/set.js create mode 100644 core-js/features/typed-array/slice.js create mode 100644 core-js/features/typed-array/some.js create mode 100644 core-js/features/typed-array/sort.js create mode 100644 core-js/features/typed-array/subarray.js create mode 100644 core-js/features/typed-array/to-locale-string.js create mode 100644 core-js/features/typed-array/to-string.js create mode 100644 core-js/features/typed-array/uint16-array.js create mode 100644 core-js/features/typed-array/uint32-array.js create mode 100644 core-js/features/typed-array/uint8-array.js create mode 100644 core-js/features/typed-array/uint8-clamped-array.js create mode 100644 core-js/features/typed-array/values.js create mode 100644 core-js/features/url-search-params/index.js create mode 100644 core-js/features/url/index.js create mode 100644 core-js/features/url/to-json.js create mode 100644 core-js/features/weak-map/delete-all.js create mode 100644 core-js/features/weak-map/from.js create mode 100644 core-js/features/weak-map/index.js create mode 100644 core-js/features/weak-map/of.js create mode 100644 core-js/features/weak-set/add-all.js create mode 100644 core-js/features/weak-set/delete-all.js create mode 100644 core-js/features/weak-set/from.js create mode 100644 core-js/features/weak-set/index.js create mode 100644 core-js/features/weak-set/of.js create mode 100644 core-js/index.js create mode 100644 core-js/internals/README.md create mode 100644 core-js/internals/a-function.js create mode 100644 core-js/internals/a-possible-prototype.js create mode 100644 core-js/internals/add-to-unscopables.js create mode 100644 core-js/internals/advance-string-index.js create mode 100644 core-js/internals/an-instance.js create mode 100644 core-js/internals/an-object.js create mode 100644 core-js/internals/array-buffer-view-core.js create mode 100644 core-js/internals/array-buffer.js create mode 100644 core-js/internals/array-copy-within.js create mode 100644 core-js/internals/array-fill.js create mode 100644 core-js/internals/array-for-each.js create mode 100644 core-js/internals/array-from.js create mode 100644 core-js/internals/array-includes.js create mode 100644 core-js/internals/array-iteration.js create mode 100644 core-js/internals/array-last-index-of.js create mode 100644 core-js/internals/array-method-has-species-support.js create mode 100644 core-js/internals/array-reduce.js create mode 100644 core-js/internals/array-species-create.js create mode 100644 core-js/internals/bind-context.js create mode 100644 core-js/internals/call-with-safe-iteration-closing.js create mode 100644 core-js/internals/check-correctness-of-iteration.js create mode 100644 core-js/internals/classof-raw.js create mode 100644 core-js/internals/classof.js create mode 100644 core-js/internals/collection-add-all.js create mode 100644 core-js/internals/collection-delete-all.js create mode 100644 core-js/internals/collection-from.js create mode 100644 core-js/internals/collection-of.js create mode 100644 core-js/internals/collection-strong.js create mode 100644 core-js/internals/collection-weak.js create mode 100644 core-js/internals/collection.js create mode 100644 core-js/internals/composite-key.js create mode 100644 core-js/internals/copy-constructor-properties.js create mode 100644 core-js/internals/correct-is-regexp-logic.js create mode 100644 core-js/internals/correct-prototype-getter.js create mode 100644 core-js/internals/create-html.js create mode 100644 core-js/internals/create-iterator-constructor.js create mode 100644 core-js/internals/create-property-descriptor.js create mode 100644 core-js/internals/create-property.js create mode 100644 core-js/internals/date-to-iso-string.js create mode 100644 core-js/internals/date-to-primitive.js create mode 100644 core-js/internals/define-iterator.js create mode 100644 core-js/internals/define-well-known-symbol.js create mode 100644 core-js/internals/descriptors.js create mode 100644 core-js/internals/document-create-element.js create mode 100644 core-js/internals/dom-iterables.js create mode 100644 core-js/internals/entry-unbind.js create mode 100644 core-js/internals/entry-virtual.js create mode 100644 core-js/internals/enum-bug-keys.js create mode 100644 core-js/internals/export.js create mode 100644 core-js/internals/fails.js create mode 100644 core-js/internals/fix-regexp-well-known-symbol-logic.js create mode 100644 core-js/internals/flatten-into-array.js create mode 100644 core-js/internals/forced-object-prototype-accessors-methods.js create mode 100644 core-js/internals/forced-string-html-method.js create mode 100644 core-js/internals/forced-string-trim-method.js create mode 100644 core-js/internals/freezing.js create mode 100644 core-js/internals/function-bind.js create mode 100644 core-js/internals/function-to-string.js create mode 100644 core-js/internals/get-built-in.js create mode 100644 core-js/internals/get-iterator-method.js create mode 100644 core-js/internals/get-iterator.js create mode 100644 core-js/internals/get-map-iterator.js create mode 100644 core-js/internals/get-set-iterator.js create mode 100644 core-js/internals/global.js create mode 100644 core-js/internals/has.js create mode 100644 core-js/internals/hidden-keys.js create mode 100644 core-js/internals/hide.js create mode 100644 core-js/internals/host-report-errors.js create mode 100644 core-js/internals/html.js create mode 100644 core-js/internals/ie8-dom-define.js create mode 100644 core-js/internals/indexed-object.js create mode 100644 core-js/internals/inherit-if-required.js create mode 100644 core-js/internals/internal-metadata.js create mode 100644 core-js/internals/internal-state.js create mode 100644 core-js/internals/is-array-iterator-method.js create mode 100644 core-js/internals/is-array.js create mode 100644 core-js/internals/is-forced.js create mode 100644 core-js/internals/is-integer.js create mode 100644 core-js/internals/is-iterable.js create mode 100644 core-js/internals/is-object.js create mode 100644 core-js/internals/is-pure.js create mode 100644 core-js/internals/is-regexp.js create mode 100644 core-js/internals/iterate.js create mode 100644 core-js/internals/iterators-core.js create mode 100644 core-js/internals/iterators.js create mode 100644 core-js/internals/math-expm1.js create mode 100644 core-js/internals/math-fround.js create mode 100644 core-js/internals/math-log1p.js create mode 100644 core-js/internals/math-scale.js create mode 100644 core-js/internals/math-sign.js create mode 100644 core-js/internals/microtask.js create mode 100644 core-js/internals/native-promise-constructor.js create mode 100644 core-js/internals/native-symbol.js create mode 100644 core-js/internals/native-url.js create mode 100644 core-js/internals/native-weak-map.js create mode 100644 core-js/internals/new-promise-capability.js create mode 100644 core-js/internals/not-a-regexp.js create mode 100644 core-js/internals/number-is-finite.js create mode 100644 core-js/internals/object-assign.js create mode 100644 core-js/internals/object-create.js create mode 100644 core-js/internals/object-define-properties.js create mode 100644 core-js/internals/object-define-property.js create mode 100644 core-js/internals/object-get-own-property-descriptor.js create mode 100644 core-js/internals/object-get-own-property-names-external.js create mode 100644 core-js/internals/object-get-own-property-names.js create mode 100644 core-js/internals/object-get-own-property-symbols.js create mode 100644 core-js/internals/object-get-prototype-of.js create mode 100644 core-js/internals/object-keys-internal.js create mode 100644 core-js/internals/object-keys.js create mode 100644 core-js/internals/object-property-is-enumerable.js create mode 100644 core-js/internals/object-set-prototype-of.js create mode 100644 core-js/internals/object-to-array.js create mode 100644 core-js/internals/object-to-string.js create mode 100644 core-js/internals/own-keys.js create mode 100644 core-js/internals/parse-float.js create mode 100644 core-js/internals/parse-int.js create mode 100644 core-js/internals/path.js create mode 100644 core-js/internals/perform.js create mode 100644 core-js/internals/promise-resolve.js create mode 100644 core-js/internals/punycode-to-ascii.js create mode 100644 core-js/internals/redefine-all.js create mode 100644 core-js/internals/redefine.js create mode 100644 core-js/internals/reflect-metadata.js create mode 100644 core-js/internals/regexp-exec-abstract.js create mode 100644 core-js/internals/regexp-exec.js create mode 100644 core-js/internals/regexp-flags.js create mode 100644 core-js/internals/require-object-coercible.js create mode 100644 core-js/internals/same-value-zero.js create mode 100644 core-js/internals/same-value.js create mode 100644 core-js/internals/set-global.js create mode 100644 core-js/internals/set-species.js create mode 100644 core-js/internals/set-to-string-tag.js create mode 100644 core-js/internals/shared-key.js create mode 100644 core-js/internals/shared.js create mode 100644 core-js/internals/sloppy-array-method.js create mode 100644 core-js/internals/species-constructor.js create mode 100644 core-js/internals/string-multibyte.js create mode 100644 core-js/internals/string-pad.js create mode 100644 core-js/internals/string-repeat.js create mode 100644 core-js/internals/string-trim.js create mode 100644 core-js/internals/task.js create mode 100644 core-js/internals/this-number-value.js create mode 100644 core-js/internals/to-absolute-index.js create mode 100644 core-js/internals/to-index.js create mode 100644 core-js/internals/to-indexed-object.js create mode 100644 core-js/internals/to-integer.js create mode 100644 core-js/internals/to-length.js create mode 100644 core-js/internals/to-object.js create mode 100644 core-js/internals/to-offset.js create mode 100644 core-js/internals/to-primitive.js create mode 100644 core-js/internals/typed-array-constructor.js create mode 100644 core-js/internals/typed-array-from.js create mode 100644 core-js/internals/typed-arrays-constructors-requires-wrappers.js create mode 100644 core-js/internals/uid.js create mode 100644 core-js/internals/user-agent.js create mode 100644 core-js/internals/webkit-string-pad-bug.js create mode 100644 core-js/internals/well-known-symbol.js create mode 100644 core-js/internals/whitespaces.js create mode 100644 core-js/internals/wrapped-well-known-symbol.js create mode 100644 core-js/modules/README.md create mode 100644 core-js/modules/es.array-buffer.constructor.js create mode 100644 core-js/modules/es.array-buffer.is-view.js create mode 100644 core-js/modules/es.array-buffer.slice.js create mode 100644 core-js/modules/es.array.concat.js create mode 100644 core-js/modules/es.array.copy-within.js create mode 100644 core-js/modules/es.array.every.js create mode 100644 core-js/modules/es.array.fill.js create mode 100644 core-js/modules/es.array.filter.js create mode 100644 core-js/modules/es.array.find-index.js create mode 100644 core-js/modules/es.array.find.js create mode 100644 core-js/modules/es.array.flat-map.js create mode 100644 core-js/modules/es.array.flat.js create mode 100644 core-js/modules/es.array.for-each.js create mode 100644 core-js/modules/es.array.from.js create mode 100644 core-js/modules/es.array.includes.js create mode 100644 core-js/modules/es.array.index-of.js create mode 100644 core-js/modules/es.array.is-array.js create mode 100644 core-js/modules/es.array.iterator.js create mode 100644 core-js/modules/es.array.join.js create mode 100644 core-js/modules/es.array.last-index-of.js create mode 100644 core-js/modules/es.array.map.js create mode 100644 core-js/modules/es.array.of.js create mode 100644 core-js/modules/es.array.reduce-right.js create mode 100644 core-js/modules/es.array.reduce.js create mode 100644 core-js/modules/es.array.reverse.js create mode 100644 core-js/modules/es.array.slice.js create mode 100644 core-js/modules/es.array.some.js create mode 100644 core-js/modules/es.array.sort.js create mode 100644 core-js/modules/es.array.species.js create mode 100644 core-js/modules/es.array.splice.js create mode 100644 core-js/modules/es.array.unscopables.flat-map.js create mode 100644 core-js/modules/es.array.unscopables.flat.js create mode 100644 core-js/modules/es.data-view.js create mode 100644 core-js/modules/es.date.now.js create mode 100644 core-js/modules/es.date.to-iso-string.js create mode 100644 core-js/modules/es.date.to-json.js create mode 100644 core-js/modules/es.date.to-primitive.js create mode 100644 core-js/modules/es.date.to-string.js create mode 100644 core-js/modules/es.function.bind.js create mode 100644 core-js/modules/es.function.has-instance.js create mode 100644 core-js/modules/es.function.name.js create mode 100644 core-js/modules/es.json.to-string-tag.js create mode 100644 core-js/modules/es.map.js create mode 100644 core-js/modules/es.math.acosh.js create mode 100644 core-js/modules/es.math.asinh.js create mode 100644 core-js/modules/es.math.atanh.js create mode 100644 core-js/modules/es.math.cbrt.js create mode 100644 core-js/modules/es.math.clz32.js create mode 100644 core-js/modules/es.math.cosh.js create mode 100644 core-js/modules/es.math.expm1.js create mode 100644 core-js/modules/es.math.fround.js create mode 100644 core-js/modules/es.math.hypot.js create mode 100644 core-js/modules/es.math.imul.js create mode 100644 core-js/modules/es.math.log10.js create mode 100644 core-js/modules/es.math.log1p.js create mode 100644 core-js/modules/es.math.log2.js create mode 100644 core-js/modules/es.math.sign.js create mode 100644 core-js/modules/es.math.sinh.js create mode 100644 core-js/modules/es.math.tanh.js create mode 100644 core-js/modules/es.math.to-string-tag.js create mode 100644 core-js/modules/es.math.trunc.js create mode 100644 core-js/modules/es.number.constructor.js create mode 100644 core-js/modules/es.number.epsilon.js create mode 100644 core-js/modules/es.number.is-finite.js create mode 100644 core-js/modules/es.number.is-integer.js create mode 100644 core-js/modules/es.number.is-nan.js create mode 100644 core-js/modules/es.number.is-safe-integer.js create mode 100644 core-js/modules/es.number.max-safe-integer.js create mode 100644 core-js/modules/es.number.min-safe-integer.js create mode 100644 core-js/modules/es.number.parse-float.js create mode 100644 core-js/modules/es.number.parse-int.js create mode 100644 core-js/modules/es.number.to-fixed.js create mode 100644 core-js/modules/es.number.to-precision.js create mode 100644 core-js/modules/es.object.assign.js create mode 100644 core-js/modules/es.object.create.js create mode 100644 core-js/modules/es.object.define-getter.js create mode 100644 core-js/modules/es.object.define-properties.js create mode 100644 core-js/modules/es.object.define-property.js create mode 100644 core-js/modules/es.object.define-setter.js create mode 100644 core-js/modules/es.object.entries.js create mode 100644 core-js/modules/es.object.freeze.js create mode 100644 core-js/modules/es.object.from-entries.js create mode 100644 core-js/modules/es.object.get-own-property-descriptor.js create mode 100644 core-js/modules/es.object.get-own-property-descriptors.js create mode 100644 core-js/modules/es.object.get-own-property-names.js create mode 100644 core-js/modules/es.object.get-prototype-of.js create mode 100644 core-js/modules/es.object.is-extensible.js create mode 100644 core-js/modules/es.object.is-frozen.js create mode 100644 core-js/modules/es.object.is-sealed.js create mode 100644 core-js/modules/es.object.is.js create mode 100644 core-js/modules/es.object.keys.js create mode 100644 core-js/modules/es.object.lookup-getter.js create mode 100644 core-js/modules/es.object.lookup-setter.js create mode 100644 core-js/modules/es.object.prevent-extensions.js create mode 100644 core-js/modules/es.object.seal.js create mode 100644 core-js/modules/es.object.set-prototype-of.js create mode 100644 core-js/modules/es.object.to-string.js create mode 100644 core-js/modules/es.object.values.js create mode 100644 core-js/modules/es.parse-float.js create mode 100644 core-js/modules/es.parse-int.js create mode 100644 core-js/modules/es.promise.all-settled.js create mode 100644 core-js/modules/es.promise.finally.js create mode 100644 core-js/modules/es.promise.js create mode 100644 core-js/modules/es.reflect.apply.js create mode 100644 core-js/modules/es.reflect.construct.js create mode 100644 core-js/modules/es.reflect.define-property.js create mode 100644 core-js/modules/es.reflect.delete-property.js create mode 100644 core-js/modules/es.reflect.get-own-property-descriptor.js create mode 100644 core-js/modules/es.reflect.get-prototype-of.js create mode 100644 core-js/modules/es.reflect.get.js create mode 100644 core-js/modules/es.reflect.has.js create mode 100644 core-js/modules/es.reflect.is-extensible.js create mode 100644 core-js/modules/es.reflect.own-keys.js create mode 100644 core-js/modules/es.reflect.prevent-extensions.js create mode 100644 core-js/modules/es.reflect.set-prototype-of.js create mode 100644 core-js/modules/es.reflect.set.js create mode 100644 core-js/modules/es.regexp.constructor.js create mode 100644 core-js/modules/es.regexp.exec.js create mode 100644 core-js/modules/es.regexp.flags.js create mode 100644 core-js/modules/es.regexp.to-string.js create mode 100644 core-js/modules/es.set.js create mode 100644 core-js/modules/es.string.anchor.js create mode 100644 core-js/modules/es.string.big.js create mode 100644 core-js/modules/es.string.blink.js create mode 100644 core-js/modules/es.string.bold.js create mode 100644 core-js/modules/es.string.code-point-at.js create mode 100644 core-js/modules/es.string.ends-with.js create mode 100644 core-js/modules/es.string.fixed.js create mode 100644 core-js/modules/es.string.fontcolor.js create mode 100644 core-js/modules/es.string.fontsize.js create mode 100644 core-js/modules/es.string.from-code-point.js create mode 100644 core-js/modules/es.string.includes.js create mode 100644 core-js/modules/es.string.italics.js create mode 100644 core-js/modules/es.string.iterator.js create mode 100644 core-js/modules/es.string.link.js create mode 100644 core-js/modules/es.string.match-all.js create mode 100644 core-js/modules/es.string.match.js create mode 100644 core-js/modules/es.string.pad-end.js create mode 100644 core-js/modules/es.string.pad-start.js create mode 100644 core-js/modules/es.string.raw.js create mode 100644 core-js/modules/es.string.repeat.js create mode 100644 core-js/modules/es.string.replace.js create mode 100644 core-js/modules/es.string.search.js create mode 100644 core-js/modules/es.string.small.js create mode 100644 core-js/modules/es.string.split.js create mode 100644 core-js/modules/es.string.starts-with.js create mode 100644 core-js/modules/es.string.strike.js create mode 100644 core-js/modules/es.string.sub.js create mode 100644 core-js/modules/es.string.sup.js create mode 100644 core-js/modules/es.string.trim-end.js create mode 100644 core-js/modules/es.string.trim-start.js create mode 100644 core-js/modules/es.string.trim.js create mode 100644 core-js/modules/es.symbol.async-iterator.js create mode 100644 core-js/modules/es.symbol.description.js create mode 100644 core-js/modules/es.symbol.has-instance.js create mode 100644 core-js/modules/es.symbol.is-concat-spreadable.js create mode 100644 core-js/modules/es.symbol.iterator.js create mode 100644 core-js/modules/es.symbol.js create mode 100644 core-js/modules/es.symbol.match-all.js create mode 100644 core-js/modules/es.symbol.match.js create mode 100644 core-js/modules/es.symbol.replace.js create mode 100644 core-js/modules/es.symbol.search.js create mode 100644 core-js/modules/es.symbol.species.js create mode 100644 core-js/modules/es.symbol.split.js create mode 100644 core-js/modules/es.symbol.to-primitive.js create mode 100644 core-js/modules/es.symbol.to-string-tag.js create mode 100644 core-js/modules/es.symbol.unscopables.js create mode 100644 core-js/modules/es.typed-array.copy-within.js create mode 100644 core-js/modules/es.typed-array.every.js create mode 100644 core-js/modules/es.typed-array.fill.js create mode 100644 core-js/modules/es.typed-array.filter.js create mode 100644 core-js/modules/es.typed-array.find-index.js create mode 100644 core-js/modules/es.typed-array.find.js create mode 100644 core-js/modules/es.typed-array.float32-array.js create mode 100644 core-js/modules/es.typed-array.float64-array.js create mode 100644 core-js/modules/es.typed-array.for-each.js create mode 100644 core-js/modules/es.typed-array.from.js create mode 100644 core-js/modules/es.typed-array.includes.js create mode 100644 core-js/modules/es.typed-array.index-of.js create mode 100644 core-js/modules/es.typed-array.int16-array.js create mode 100644 core-js/modules/es.typed-array.int32-array.js create mode 100644 core-js/modules/es.typed-array.int8-array.js create mode 100644 core-js/modules/es.typed-array.iterator.js create mode 100644 core-js/modules/es.typed-array.join.js create mode 100644 core-js/modules/es.typed-array.last-index-of.js create mode 100644 core-js/modules/es.typed-array.map.js create mode 100644 core-js/modules/es.typed-array.of.js create mode 100644 core-js/modules/es.typed-array.reduce-right.js create mode 100644 core-js/modules/es.typed-array.reduce.js create mode 100644 core-js/modules/es.typed-array.reverse.js create mode 100644 core-js/modules/es.typed-array.set.js create mode 100644 core-js/modules/es.typed-array.slice.js create mode 100644 core-js/modules/es.typed-array.some.js create mode 100644 core-js/modules/es.typed-array.sort.js create mode 100644 core-js/modules/es.typed-array.subarray.js create mode 100644 core-js/modules/es.typed-array.to-locale-string.js create mode 100644 core-js/modules/es.typed-array.to-string.js create mode 100644 core-js/modules/es.typed-array.uint16-array.js create mode 100644 core-js/modules/es.typed-array.uint32-array.js create mode 100644 core-js/modules/es.typed-array.uint8-array.js create mode 100644 core-js/modules/es.typed-array.uint8-clamped-array.js create mode 100644 core-js/modules/es.weak-map.js create mode 100644 core-js/modules/es.weak-set.js create mode 100644 core-js/modules/esnext.aggregate-error.js create mode 100644 core-js/modules/esnext.array.is-template-object.js create mode 100644 core-js/modules/esnext.array.last-index.js create mode 100644 core-js/modules/esnext.array.last-item.js create mode 100644 core-js/modules/esnext.composite-key.js create mode 100644 core-js/modules/esnext.composite-symbol.js create mode 100644 core-js/modules/esnext.global-this.js create mode 100644 core-js/modules/esnext.map.delete-all.js create mode 100644 core-js/modules/esnext.map.every.js create mode 100644 core-js/modules/esnext.map.filter.js create mode 100644 core-js/modules/esnext.map.find-key.js create mode 100644 core-js/modules/esnext.map.find.js create mode 100644 core-js/modules/esnext.map.from.js create mode 100644 core-js/modules/esnext.map.group-by.js create mode 100644 core-js/modules/esnext.map.includes.js create mode 100644 core-js/modules/esnext.map.key-by.js create mode 100644 core-js/modules/esnext.map.key-of.js create mode 100644 core-js/modules/esnext.map.map-keys.js create mode 100644 core-js/modules/esnext.map.map-values.js create mode 100644 core-js/modules/esnext.map.merge.js create mode 100644 core-js/modules/esnext.map.of.js create mode 100644 core-js/modules/esnext.map.reduce.js create mode 100644 core-js/modules/esnext.map.some.js create mode 100644 core-js/modules/esnext.map.update-or-insert.js create mode 100644 core-js/modules/esnext.map.update.js create mode 100644 core-js/modules/esnext.math.clamp.js create mode 100644 core-js/modules/esnext.math.deg-per-rad.js create mode 100644 core-js/modules/esnext.math.degrees.js create mode 100644 core-js/modules/esnext.math.fscale.js create mode 100644 core-js/modules/esnext.math.iaddh.js create mode 100644 core-js/modules/esnext.math.imulh.js create mode 100644 core-js/modules/esnext.math.isubh.js create mode 100644 core-js/modules/esnext.math.rad-per-deg.js create mode 100644 core-js/modules/esnext.math.radians.js create mode 100644 core-js/modules/esnext.math.scale.js create mode 100644 core-js/modules/esnext.math.seeded-prng.js create mode 100644 core-js/modules/esnext.math.signbit.js create mode 100644 core-js/modules/esnext.math.umulh.js create mode 100644 core-js/modules/esnext.number.from-string.js create mode 100644 core-js/modules/esnext.observable.js create mode 100644 core-js/modules/esnext.promise.all-settled.js create mode 100644 core-js/modules/esnext.promise.any.js create mode 100644 core-js/modules/esnext.promise.try.js create mode 100644 core-js/modules/esnext.reflect.define-metadata.js create mode 100644 core-js/modules/esnext.reflect.delete-metadata.js create mode 100644 core-js/modules/esnext.reflect.get-metadata-keys.js create mode 100644 core-js/modules/esnext.reflect.get-metadata.js create mode 100644 core-js/modules/esnext.reflect.get-own-metadata-keys.js create mode 100644 core-js/modules/esnext.reflect.get-own-metadata.js create mode 100644 core-js/modules/esnext.reflect.has-metadata.js create mode 100644 core-js/modules/esnext.reflect.has-own-metadata.js create mode 100644 core-js/modules/esnext.reflect.metadata.js create mode 100644 core-js/modules/esnext.set.add-all.js create mode 100644 core-js/modules/esnext.set.delete-all.js create mode 100644 core-js/modules/esnext.set.difference.js create mode 100644 core-js/modules/esnext.set.every.js create mode 100644 core-js/modules/esnext.set.filter.js create mode 100644 core-js/modules/esnext.set.find.js create mode 100644 core-js/modules/esnext.set.from.js create mode 100644 core-js/modules/esnext.set.intersection.js create mode 100644 core-js/modules/esnext.set.is-disjoint-from.js create mode 100644 core-js/modules/esnext.set.is-subset-of.js create mode 100644 core-js/modules/esnext.set.is-superset-of.js create mode 100644 core-js/modules/esnext.set.join.js create mode 100644 core-js/modules/esnext.set.map.js create mode 100644 core-js/modules/esnext.set.of.js create mode 100644 core-js/modules/esnext.set.reduce.js create mode 100644 core-js/modules/esnext.set.some.js create mode 100644 core-js/modules/esnext.set.symmetric-difference.js create mode 100644 core-js/modules/esnext.set.union.js create mode 100644 core-js/modules/esnext.string.at.js create mode 100644 core-js/modules/esnext.string.code-points.js create mode 100644 core-js/modules/esnext.string.match-all.js create mode 100644 core-js/modules/esnext.string.replace-all.js create mode 100644 core-js/modules/esnext.symbol.async-dispose.js create mode 100644 core-js/modules/esnext.symbol.dispose.js create mode 100644 core-js/modules/esnext.symbol.observable.js create mode 100644 core-js/modules/esnext.symbol.pattern-match.js create mode 100644 core-js/modules/esnext.symbol.replace-all.js create mode 100644 core-js/modules/esnext.weak-map.delete-all.js create mode 100644 core-js/modules/esnext.weak-map.from.js create mode 100644 core-js/modules/esnext.weak-map.of.js create mode 100644 core-js/modules/esnext.weak-set.add-all.js create mode 100644 core-js/modules/esnext.weak-set.delete-all.js create mode 100644 core-js/modules/esnext.weak-set.from.js create mode 100644 core-js/modules/esnext.weak-set.of.js create mode 100644 core-js/modules/web.dom-collections.for-each.js create mode 100644 core-js/modules/web.dom-collections.iterator.js create mode 100644 core-js/modules/web.immediate.js create mode 100644 core-js/modules/web.queue-microtask.js create mode 100644 core-js/modules/web.timers.js create mode 100644 core-js/modules/web.url-search-params.js create mode 100644 core-js/modules/web.url.js create mode 100644 core-js/modules/web.url.to-json.js create mode 100644 core-js/package.json create mode 100644 core-js/proposals/array-is-template-object.js create mode 100644 core-js/proposals/array-last.js create mode 100644 core-js/proposals/collection-methods.js create mode 100644 core-js/proposals/collection-of-from.js create mode 100644 core-js/proposals/efficient-64-bit-arithmetic.js create mode 100644 core-js/proposals/global-this.js create mode 100644 core-js/proposals/index.js create mode 100644 core-js/proposals/keys-composition.js create mode 100644 core-js/proposals/map-update-or-insert.js create mode 100644 core-js/proposals/math-extensions.js create mode 100644 core-js/proposals/math-signbit.js create mode 100644 core-js/proposals/number-from-string.js create mode 100644 core-js/proposals/observable.js create mode 100644 core-js/proposals/pattern-matching.js create mode 100644 core-js/proposals/promise-all-settled.js create mode 100644 core-js/proposals/promise-any.js create mode 100644 core-js/proposals/promise-try.js create mode 100644 core-js/proposals/reflect-metadata.js create mode 100644 core-js/proposals/seeded-random.js create mode 100644 core-js/proposals/set-methods.js create mode 100644 core-js/proposals/string-at.js create mode 100644 core-js/proposals/string-code-points.js create mode 100644 core-js/proposals/string-match-all.js create mode 100644 core-js/proposals/string-replace-all.js create mode 100644 core-js/proposals/url.js create mode 100644 core-js/proposals/using-statement.js create mode 100644 core-js/scripts/postinstall.js create mode 100644 core-js/stable/README.md create mode 100644 core-js/stable/array-buffer/constructor.js create mode 100644 core-js/stable/array-buffer/index.js create mode 100644 core-js/stable/array-buffer/is-view.js create mode 100644 core-js/stable/array-buffer/slice.js create mode 100644 core-js/stable/array/concat.js create mode 100644 core-js/stable/array/copy-within.js create mode 100644 core-js/stable/array/entries.js create mode 100644 core-js/stable/array/every.js create mode 100644 core-js/stable/array/fill.js create mode 100644 core-js/stable/array/filter.js create mode 100644 core-js/stable/array/find-index.js create mode 100644 core-js/stable/array/find.js create mode 100644 core-js/stable/array/flat-map.js create mode 100644 core-js/stable/array/flat.js create mode 100644 core-js/stable/array/for-each.js create mode 100644 core-js/stable/array/from.js create mode 100644 core-js/stable/array/includes.js create mode 100644 core-js/stable/array/index-of.js create mode 100644 core-js/stable/array/index.js create mode 100644 core-js/stable/array/is-array.js create mode 100644 core-js/stable/array/iterator.js create mode 100644 core-js/stable/array/join.js create mode 100644 core-js/stable/array/keys.js create mode 100644 core-js/stable/array/last-index-of.js create mode 100644 core-js/stable/array/map.js create mode 100644 core-js/stable/array/of.js create mode 100644 core-js/stable/array/reduce-right.js create mode 100644 core-js/stable/array/reduce.js create mode 100644 core-js/stable/array/reverse.js create mode 100644 core-js/stable/array/slice.js create mode 100644 core-js/stable/array/some.js create mode 100644 core-js/stable/array/sort.js create mode 100644 core-js/stable/array/splice.js create mode 100644 core-js/stable/array/values.js create mode 100644 core-js/stable/array/virtual/concat.js create mode 100644 core-js/stable/array/virtual/copy-within.js create mode 100644 core-js/stable/array/virtual/entries.js create mode 100644 core-js/stable/array/virtual/every.js create mode 100644 core-js/stable/array/virtual/fill.js create mode 100644 core-js/stable/array/virtual/filter.js create mode 100644 core-js/stable/array/virtual/find-index.js create mode 100644 core-js/stable/array/virtual/find.js create mode 100644 core-js/stable/array/virtual/flat-map.js create mode 100644 core-js/stable/array/virtual/flat.js create mode 100644 core-js/stable/array/virtual/for-each.js create mode 100644 core-js/stable/array/virtual/includes.js create mode 100644 core-js/stable/array/virtual/index-of.js create mode 100644 core-js/stable/array/virtual/index.js create mode 100644 core-js/stable/array/virtual/iterator.js create mode 100644 core-js/stable/array/virtual/join.js create mode 100644 core-js/stable/array/virtual/keys.js create mode 100644 core-js/stable/array/virtual/last-index-of.js create mode 100644 core-js/stable/array/virtual/map.js create mode 100644 core-js/stable/array/virtual/reduce-right.js create mode 100644 core-js/stable/array/virtual/reduce.js create mode 100644 core-js/stable/array/virtual/reverse.js create mode 100644 core-js/stable/array/virtual/slice.js create mode 100644 core-js/stable/array/virtual/some.js create mode 100644 core-js/stable/array/virtual/sort.js create mode 100644 core-js/stable/array/virtual/splice.js create mode 100644 core-js/stable/array/virtual/values.js create mode 100644 core-js/stable/clear-immediate.js create mode 100644 core-js/stable/data-view/index.js create mode 100644 core-js/stable/date/index.js create mode 100644 core-js/stable/date/now.js create mode 100644 core-js/stable/date/to-iso-string.js create mode 100644 core-js/stable/date/to-json.js create mode 100644 core-js/stable/date/to-primitive.js create mode 100644 core-js/stable/date/to-string.js create mode 100644 core-js/stable/dom-collections/for-each.js create mode 100644 core-js/stable/dom-collections/index.js create mode 100644 core-js/stable/dom-collections/iterator.js create mode 100644 core-js/stable/function/bind.js create mode 100644 core-js/stable/function/has-instance.js create mode 100644 core-js/stable/function/index.js create mode 100644 core-js/stable/function/name.js create mode 100644 core-js/stable/function/virtual/bind.js create mode 100644 core-js/stable/function/virtual/index.js create mode 100644 core-js/stable/global-this.js create mode 100644 core-js/stable/index.js create mode 100644 core-js/stable/instance/bind.js create mode 100644 core-js/stable/instance/code-point-at.js create mode 100644 core-js/stable/instance/concat.js create mode 100644 core-js/stable/instance/copy-within.js create mode 100644 core-js/stable/instance/ends-with.js create mode 100644 core-js/stable/instance/entries.js create mode 100644 core-js/stable/instance/every.js create mode 100644 core-js/stable/instance/fill.js create mode 100644 core-js/stable/instance/filter.js create mode 100644 core-js/stable/instance/find-index.js create mode 100644 core-js/stable/instance/find.js create mode 100644 core-js/stable/instance/flags.js create mode 100644 core-js/stable/instance/flat-map.js create mode 100644 core-js/stable/instance/flat.js create mode 100644 core-js/stable/instance/for-each.js create mode 100644 core-js/stable/instance/includes.js create mode 100644 core-js/stable/instance/index-of.js create mode 100644 core-js/stable/instance/keys.js create mode 100644 core-js/stable/instance/last-index-of.js create mode 100644 core-js/stable/instance/map.js create mode 100644 core-js/stable/instance/match-all.js create mode 100644 core-js/stable/instance/pad-end.js create mode 100644 core-js/stable/instance/pad-start.js create mode 100644 core-js/stable/instance/reduce-right.js create mode 100644 core-js/stable/instance/reduce.js create mode 100644 core-js/stable/instance/repeat.js create mode 100644 core-js/stable/instance/reverse.js create mode 100644 core-js/stable/instance/slice.js create mode 100644 core-js/stable/instance/some.js create mode 100644 core-js/stable/instance/sort.js create mode 100644 core-js/stable/instance/splice.js create mode 100644 core-js/stable/instance/starts-with.js create mode 100644 core-js/stable/instance/trim-end.js create mode 100644 core-js/stable/instance/trim-left.js create mode 100644 core-js/stable/instance/trim-right.js create mode 100644 core-js/stable/instance/trim-start.js create mode 100644 core-js/stable/instance/trim.js create mode 100644 core-js/stable/instance/values.js create mode 100644 core-js/stable/json/index.js create mode 100644 core-js/stable/json/stringify.js create mode 100644 core-js/stable/json/to-string-tag.js create mode 100644 core-js/stable/map/index.js create mode 100644 core-js/stable/math/acosh.js create mode 100644 core-js/stable/math/asinh.js create mode 100644 core-js/stable/math/atanh.js create mode 100644 core-js/stable/math/cbrt.js create mode 100644 core-js/stable/math/clz32.js create mode 100644 core-js/stable/math/cosh.js create mode 100644 core-js/stable/math/expm1.js create mode 100644 core-js/stable/math/fround.js create mode 100644 core-js/stable/math/hypot.js create mode 100644 core-js/stable/math/imul.js create mode 100644 core-js/stable/math/index.js create mode 100644 core-js/stable/math/log10.js create mode 100644 core-js/stable/math/log1p.js create mode 100644 core-js/stable/math/log2.js create mode 100644 core-js/stable/math/sign.js create mode 100644 core-js/stable/math/sinh.js create mode 100644 core-js/stable/math/tanh.js create mode 100644 core-js/stable/math/to-string-tag.js create mode 100644 core-js/stable/math/trunc.js create mode 100644 core-js/stable/number/constructor.js create mode 100644 core-js/stable/number/epsilon.js create mode 100644 core-js/stable/number/index.js create mode 100644 core-js/stable/number/is-finite.js create mode 100644 core-js/stable/number/is-integer.js create mode 100644 core-js/stable/number/is-nan.js create mode 100644 core-js/stable/number/is-safe-integer.js create mode 100644 core-js/stable/number/max-safe-integer.js create mode 100644 core-js/stable/number/min-safe-integer.js create mode 100644 core-js/stable/number/parse-float.js create mode 100644 core-js/stable/number/parse-int.js create mode 100644 core-js/stable/number/to-fixed.js create mode 100644 core-js/stable/number/to-precision.js create mode 100644 core-js/stable/number/virtual/index.js create mode 100644 core-js/stable/number/virtual/to-fixed.js create mode 100644 core-js/stable/number/virtual/to-precision.js create mode 100644 core-js/stable/object/assign.js create mode 100644 core-js/stable/object/create.js create mode 100644 core-js/stable/object/define-getter.js create mode 100644 core-js/stable/object/define-properties.js create mode 100644 core-js/stable/object/define-property.js create mode 100644 core-js/stable/object/define-setter.js create mode 100644 core-js/stable/object/entries.js create mode 100644 core-js/stable/object/freeze.js create mode 100644 core-js/stable/object/from-entries.js create mode 100644 core-js/stable/object/get-own-property-descriptor.js create mode 100644 core-js/stable/object/get-own-property-descriptors.js create mode 100644 core-js/stable/object/get-own-property-names.js create mode 100644 core-js/stable/object/get-own-property-symbols.js create mode 100644 core-js/stable/object/get-prototype-of.js create mode 100644 core-js/stable/object/index.js create mode 100644 core-js/stable/object/is-extensible.js create mode 100644 core-js/stable/object/is-frozen.js create mode 100644 core-js/stable/object/is-sealed.js create mode 100644 core-js/stable/object/is.js create mode 100644 core-js/stable/object/keys.js create mode 100644 core-js/stable/object/lookup-getter.js create mode 100644 core-js/stable/object/lookup-setter.js create mode 100644 core-js/stable/object/prevent-extensions.js create mode 100644 core-js/stable/object/seal.js create mode 100644 core-js/stable/object/set-prototype-of.js create mode 100644 core-js/stable/object/to-string.js create mode 100644 core-js/stable/object/values.js create mode 100644 core-js/stable/parse-float.js create mode 100644 core-js/stable/parse-int.js create mode 100644 core-js/stable/promise/all-settled.js create mode 100644 core-js/stable/promise/finally.js create mode 100644 core-js/stable/promise/index.js create mode 100644 core-js/stable/queue-microtask.js create mode 100644 core-js/stable/reflect/apply.js create mode 100644 core-js/stable/reflect/construct.js create mode 100644 core-js/stable/reflect/define-property.js create mode 100644 core-js/stable/reflect/delete-property.js create mode 100644 core-js/stable/reflect/get-own-property-descriptor.js create mode 100644 core-js/stable/reflect/get-prototype-of.js create mode 100644 core-js/stable/reflect/get.js create mode 100644 core-js/stable/reflect/has.js create mode 100644 core-js/stable/reflect/index.js create mode 100644 core-js/stable/reflect/is-extensible.js create mode 100644 core-js/stable/reflect/own-keys.js create mode 100644 core-js/stable/reflect/prevent-extensions.js create mode 100644 core-js/stable/reflect/set-prototype-of.js create mode 100644 core-js/stable/reflect/set.js create mode 100644 core-js/stable/regexp/constructor.js create mode 100644 core-js/stable/regexp/flags.js create mode 100644 core-js/stable/regexp/index.js create mode 100644 core-js/stable/regexp/match.js create mode 100644 core-js/stable/regexp/replace.js create mode 100644 core-js/stable/regexp/search.js create mode 100644 core-js/stable/regexp/split.js create mode 100644 core-js/stable/regexp/to-string.js create mode 100644 core-js/stable/set-immediate.js create mode 100644 core-js/stable/set-interval.js create mode 100644 core-js/stable/set-timeout.js create mode 100644 core-js/stable/set/index.js create mode 100644 core-js/stable/string/anchor.js create mode 100644 core-js/stable/string/big.js create mode 100644 core-js/stable/string/blink.js create mode 100644 core-js/stable/string/bold.js create mode 100644 core-js/stable/string/code-point-at.js create mode 100644 core-js/stable/string/ends-with.js create mode 100644 core-js/stable/string/fixed.js create mode 100644 core-js/stable/string/fontcolor.js create mode 100644 core-js/stable/string/fontsize.js create mode 100644 core-js/stable/string/from-code-point.js create mode 100644 core-js/stable/string/includes.js create mode 100644 core-js/stable/string/index.js create mode 100644 core-js/stable/string/italics.js create mode 100644 core-js/stable/string/iterator.js create mode 100644 core-js/stable/string/link.js create mode 100644 core-js/stable/string/match-all.js create mode 100644 core-js/stable/string/match.js create mode 100644 core-js/stable/string/pad-end.js create mode 100644 core-js/stable/string/pad-start.js create mode 100644 core-js/stable/string/raw.js create mode 100644 core-js/stable/string/repeat.js create mode 100644 core-js/stable/string/replace.js create mode 100644 core-js/stable/string/search.js create mode 100644 core-js/stable/string/small.js create mode 100644 core-js/stable/string/split.js create mode 100644 core-js/stable/string/starts-with.js create mode 100644 core-js/stable/string/strike.js create mode 100644 core-js/stable/string/sub.js create mode 100644 core-js/stable/string/sup.js create mode 100644 core-js/stable/string/trim-end.js create mode 100644 core-js/stable/string/trim-left.js create mode 100644 core-js/stable/string/trim-right.js create mode 100644 core-js/stable/string/trim-start.js create mode 100644 core-js/stable/string/trim.js create mode 100644 core-js/stable/string/virtual/anchor.js create mode 100644 core-js/stable/string/virtual/big.js create mode 100644 core-js/stable/string/virtual/blink.js create mode 100644 core-js/stable/string/virtual/bold.js create mode 100644 core-js/stable/string/virtual/code-point-at.js create mode 100644 core-js/stable/string/virtual/ends-with.js create mode 100644 core-js/stable/string/virtual/fixed.js create mode 100644 core-js/stable/string/virtual/fontcolor.js create mode 100644 core-js/stable/string/virtual/fontsize.js create mode 100644 core-js/stable/string/virtual/includes.js create mode 100644 core-js/stable/string/virtual/index.js create mode 100644 core-js/stable/string/virtual/italics.js create mode 100644 core-js/stable/string/virtual/iterator.js create mode 100644 core-js/stable/string/virtual/link.js create mode 100644 core-js/stable/string/virtual/match-all.js create mode 100644 core-js/stable/string/virtual/pad-end.js create mode 100644 core-js/stable/string/virtual/pad-start.js create mode 100644 core-js/stable/string/virtual/repeat.js create mode 100644 core-js/stable/string/virtual/small.js create mode 100644 core-js/stable/string/virtual/starts-with.js create mode 100644 core-js/stable/string/virtual/strike.js create mode 100644 core-js/stable/string/virtual/sub.js create mode 100644 core-js/stable/string/virtual/sup.js create mode 100644 core-js/stable/string/virtual/trim-end.js create mode 100644 core-js/stable/string/virtual/trim-left.js create mode 100644 core-js/stable/string/virtual/trim-right.js create mode 100644 core-js/stable/string/virtual/trim-start.js create mode 100644 core-js/stable/string/virtual/trim.js create mode 100644 core-js/stable/symbol/async-iterator.js create mode 100644 core-js/stable/symbol/description.js create mode 100644 core-js/stable/symbol/for.js create mode 100644 core-js/stable/symbol/has-instance.js create mode 100644 core-js/stable/symbol/index.js create mode 100644 core-js/stable/symbol/is-concat-spreadable.js create mode 100644 core-js/stable/symbol/iterator.js create mode 100644 core-js/stable/symbol/key-for.js create mode 100644 core-js/stable/symbol/match-all.js create mode 100644 core-js/stable/symbol/match.js create mode 100644 core-js/stable/symbol/replace.js create mode 100644 core-js/stable/symbol/search.js create mode 100644 core-js/stable/symbol/species.js create mode 100644 core-js/stable/symbol/split.js create mode 100644 core-js/stable/symbol/to-primitive.js create mode 100644 core-js/stable/symbol/to-string-tag.js create mode 100644 core-js/stable/symbol/unscopables.js create mode 100644 core-js/stable/typed-array/copy-within.js create mode 100644 core-js/stable/typed-array/entries.js create mode 100644 core-js/stable/typed-array/every.js create mode 100644 core-js/stable/typed-array/fill.js create mode 100644 core-js/stable/typed-array/filter.js create mode 100644 core-js/stable/typed-array/find-index.js create mode 100644 core-js/stable/typed-array/find.js create mode 100644 core-js/stable/typed-array/float32-array.js create mode 100644 core-js/stable/typed-array/float64-array.js create mode 100644 core-js/stable/typed-array/for-each.js create mode 100644 core-js/stable/typed-array/from.js create mode 100644 core-js/stable/typed-array/includes.js create mode 100644 core-js/stable/typed-array/index-of.js create mode 100644 core-js/stable/typed-array/index.js create mode 100644 core-js/stable/typed-array/int16-array.js create mode 100644 core-js/stable/typed-array/int32-array.js create mode 100644 core-js/stable/typed-array/int8-array.js create mode 100644 core-js/stable/typed-array/iterator.js create mode 100644 core-js/stable/typed-array/join.js create mode 100644 core-js/stable/typed-array/keys.js create mode 100644 core-js/stable/typed-array/last-index-of.js create mode 100644 core-js/stable/typed-array/map.js create mode 100644 core-js/stable/typed-array/of.js create mode 100644 core-js/stable/typed-array/reduce-right.js create mode 100644 core-js/stable/typed-array/reduce.js create mode 100644 core-js/stable/typed-array/reverse.js create mode 100644 core-js/stable/typed-array/set.js create mode 100644 core-js/stable/typed-array/slice.js create mode 100644 core-js/stable/typed-array/some.js create mode 100644 core-js/stable/typed-array/sort.js create mode 100644 core-js/stable/typed-array/subarray.js create mode 100644 core-js/stable/typed-array/to-locale-string.js create mode 100644 core-js/stable/typed-array/to-string.js create mode 100644 core-js/stable/typed-array/uint16-array.js create mode 100644 core-js/stable/typed-array/uint32-array.js create mode 100644 core-js/stable/typed-array/uint8-array.js create mode 100644 core-js/stable/typed-array/uint8-clamped-array.js create mode 100644 core-js/stable/typed-array/values.js create mode 100644 core-js/stable/url-search-params/index.js create mode 100644 core-js/stable/url/index.js create mode 100644 core-js/stable/url/to-json.js create mode 100644 core-js/stable/weak-map/index.js create mode 100644 core-js/stable/weak-set/index.js create mode 100644 core-js/stage/0.js create mode 100644 core-js/stage/1.js create mode 100644 core-js/stage/2.js create mode 100644 core-js/stage/3.js create mode 100644 core-js/stage/4.js create mode 100644 core-js/stage/README.md create mode 100644 core-js/stage/index.js create mode 100644 core-js/stage/pre.js create mode 100644 core-js/web/README.md create mode 100644 core-js/web/dom-collections.js create mode 100644 core-js/web/immediate.js create mode 100644 core-js/web/index.js create mode 100644 core-js/web/queue-microtask.js create mode 100644 core-js/web/timers.js create mode 100644 core-js/web/url-search-params.js create mode 100644 core-js/web/url.js diff --git a/core-js/LICENSE b/core-js/LICENSE new file mode 100644 index 0000000000..834b267db7 --- /dev/null +++ b/core-js/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-2019 Denis Pushkarev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/core-js/README.md b/core-js/README.md new file mode 100644 index 0000000000..77e98690bc --- /dev/null +++ b/core-js/README.md @@ -0,0 +1,58 @@ +# core-js + +[![Sponsors on Open Collective](https://opencollective.com/core-js/sponsors/badge.svg)](#sponsors) [![Backers on Open Collective](https://opencollective.com/core-js/backers/badge.svg)](#backers) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![npm downloads](https://img.shields.io/npm/dm/core-js.svg)](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [![Build Status](https://travis-ci.org/zloirock/core-js.svg)](https://travis-ci.org/zloirock/core-js) [![devDependency status](https://david-dm.org/zloirock/core-js/dev-status.svg)](https://david-dm.org/zloirock/core-js?type=dev) + +> Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2019](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution. + +## As advertising: the author is looking for a good job -) + +## [core-js@3, babel and a look into the future](https://github.com/zloirock/core-js/tree/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md) + +## Raising funds + +`core-js` isn't backed by a company, so the future of this project depends on you. Become a sponsor or a backer [**on Open Collective**](https://opencollective.com/core-js) or [**on Patreon**](https://www.patreon.com/zloirock) if you are interested in `core-js`. + +--- + + + +--- + + + +--- + +[*Example*](http://goo.gl/a2xexl): +```js +import 'core-js'; // <- at the top of your entry point + +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +[1, [2, 3], [4, [5]]].flat(2); // => [1, 2, 3, 4, 5] +Promise.resolve(32).then(x => console.log(x)); // => 32 +``` + +*You can load only required features*: +```js +import 'core-js/features/array/from'; // <- at the top of your entry point +import 'core-js/features/array/flat'; // <- at the top of your entry point +import 'core-js/features/set'; // <- at the top of your entry point +import 'core-js/features/promise'; // <- at the top of your entry point + +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +[1, [2, 3], [4, [5]]].flat(2); // => [1, 2, 3, 4, 5] +Promise.resolve(32).then(x => console.log(x)); // => 32 +``` + +*Or use it without global namespace pollution*: +```js +import from from 'core-js-pure/features/array/from'; +import flat from 'core-js-pure/features/array/flat'; +import Set from 'core-js-pure/features/set'; +import Promise from 'core-js-pure/features/promise'; + +from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +flat([1, [2, 3], [4, [5]]], 2); // => [1, 2, 3, 4, 5] +Promise.resolve(32).then(x => console.log(x)); // => 32 +``` + +**It's a global version (first 2 examples), for more info see [`core-js` documentation](https://github.com/zloirock/core-js/blob/master/README.md).** diff --git a/core-js/configurator.js b/core-js/configurator.js new file mode 100644 index 0000000000..caafac15bb --- /dev/null +++ b/core-js/configurator.js @@ -0,0 +1,16 @@ +var isArray = require('./internals/is-array'); +var isForced = require('./internals/is-forced'); +var data = isForced.data; +var normalize = isForced.normalize; + +var setAggressivenessLevel = function (object, constant) { + if (isArray(object)) for (var i = 0; i < object.length; i++) data[normalize(object[i])] = constant; +}; + +module.exports = function (options) { + if (typeof options == 'object') { + setAggressivenessLevel(options.useNative, isForced.NATIVE); + setAggressivenessLevel(options.usePolyfill, isForced.POLYFILL); + setAggressivenessLevel(options.useFeatureDetection, null); + } +}; diff --git a/core-js/es/README.md b/core-js/es/README.md new file mode 100644 index 0000000000..872a356ed9 --- /dev/null +++ b/core-js/es/README.md @@ -0,0 +1 @@ +This folder contains entry points for [stable ECMAScript features](https://github.com/zloirock/core-js/tree/v3#ecmascript) with dependencies. diff --git a/core-js/es/array-buffer/constructor.js b/core-js/es/array-buffer/constructor.js new file mode 100644 index 0000000000..b7a76ed5ce --- /dev/null +++ b/core-js/es/array-buffer/constructor.js @@ -0,0 +1,5 @@ +require('../../modules/es.array-buffer.constructor'); +require('../../modules/es.object.to-string'); +var path = require('../../internals/path'); + +module.exports = path.ArrayBuffer; diff --git a/core-js/es/array-buffer/index.js b/core-js/es/array-buffer/index.js new file mode 100644 index 0000000000..8697373d9e --- /dev/null +++ b/core-js/es/array-buffer/index.js @@ -0,0 +1,7 @@ +require('../../modules/es.array-buffer.constructor'); +require('../../modules/es.array-buffer.is-view'); +require('../../modules/es.array-buffer.slice'); +require('../../modules/es.object.to-string'); +var path = require('../../internals/path'); + +module.exports = path.ArrayBuffer; diff --git a/core-js/es/array-buffer/is-view.js b/core-js/es/array-buffer/is-view.js new file mode 100644 index 0000000000..c86c3b7688 --- /dev/null +++ b/core-js/es/array-buffer/is-view.js @@ -0,0 +1,4 @@ +require('../../modules/es.array-buffer.is-view'); +var path = require('../../internals/path'); + +module.exports = path.ArrayBuffer.isView; diff --git a/core-js/es/array-buffer/slice.js b/core-js/es/array-buffer/slice.js new file mode 100644 index 0000000000..931f8bc976 --- /dev/null +++ b/core-js/es/array-buffer/slice.js @@ -0,0 +1 @@ +require('../../modules/es.array-buffer.slice'); diff --git a/core-js/es/array/concat.js b/core-js/es/array/concat.js new file mode 100644 index 0000000000..9a13ce625b --- /dev/null +++ b/core-js/es/array/concat.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.concat'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'concat'); diff --git a/core-js/es/array/copy-within.js b/core-js/es/array/copy-within.js new file mode 100644 index 0000000000..de8032f659 --- /dev/null +++ b/core-js/es/array/copy-within.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.copy-within'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'copyWithin'); diff --git a/core-js/es/array/entries.js b/core-js/es/array/entries.js new file mode 100644 index 0000000000..efd91b0fed --- /dev/null +++ b/core-js/es/array/entries.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'entries'); diff --git a/core-js/es/array/every.js b/core-js/es/array/every.js new file mode 100644 index 0000000000..b95c87f323 --- /dev/null +++ b/core-js/es/array/every.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.every'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'every'); diff --git a/core-js/es/array/fill.js b/core-js/es/array/fill.js new file mode 100644 index 0000000000..c52d60a132 --- /dev/null +++ b/core-js/es/array/fill.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.fill'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'fill'); diff --git a/core-js/es/array/filter.js b/core-js/es/array/filter.js new file mode 100644 index 0000000000..f1d0e16d5f --- /dev/null +++ b/core-js/es/array/filter.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.filter'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'filter'); diff --git a/core-js/es/array/find-index.js b/core-js/es/array/find-index.js new file mode 100644 index 0000000000..9ccbdda8fe --- /dev/null +++ b/core-js/es/array/find-index.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.find-index'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'findIndex'); diff --git a/core-js/es/array/find.js b/core-js/es/array/find.js new file mode 100644 index 0000000000..7b3cc38b7f --- /dev/null +++ b/core-js/es/array/find.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.find'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'find'); diff --git a/core-js/es/array/flat-map.js b/core-js/es/array/flat-map.js new file mode 100644 index 0000000000..f201cbbc4f --- /dev/null +++ b/core-js/es/array/flat-map.js @@ -0,0 +1,5 @@ +require('../../modules/es.array.flat-map'); +require('../../modules/es.array.unscopables.flat-map'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'flatMap'); diff --git a/core-js/es/array/flat.js b/core-js/es/array/flat.js new file mode 100644 index 0000000000..c6717609a3 --- /dev/null +++ b/core-js/es/array/flat.js @@ -0,0 +1,5 @@ +require('../../modules/es.array.flat'); +require('../../modules/es.array.unscopables.flat'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'flat'); diff --git a/core-js/es/array/for-each.js b/core-js/es/array/for-each.js new file mode 100644 index 0000000000..2851813934 --- /dev/null +++ b/core-js/es/array/for-each.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.for-each'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'forEach'); diff --git a/core-js/es/array/from.js b/core-js/es/array/from.js new file mode 100644 index 0000000000..f54806d287 --- /dev/null +++ b/core-js/es/array/from.js @@ -0,0 +1,5 @@ +require('../../modules/es.string.iterator'); +require('../../modules/es.array.from'); +var path = require('../../internals/path'); + +module.exports = path.Array.from; diff --git a/core-js/es/array/includes.js b/core-js/es/array/includes.js new file mode 100644 index 0000000000..06f837ce07 --- /dev/null +++ b/core-js/es/array/includes.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.includes'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'includes'); diff --git a/core-js/es/array/index-of.js b/core-js/es/array/index-of.js new file mode 100644 index 0000000000..83e91e72f6 --- /dev/null +++ b/core-js/es/array/index-of.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.index-of'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'indexOf'); diff --git a/core-js/es/array/index.js b/core-js/es/array/index.js new file mode 100644 index 0000000000..8c18680fa1 --- /dev/null +++ b/core-js/es/array/index.js @@ -0,0 +1,33 @@ +require('../../modules/es.string.iterator'); +require('../../modules/es.array.from'); +require('../../modules/es.array.is-array'); +require('../../modules/es.array.of'); +require('../../modules/es.array.concat'); +require('../../modules/es.array.copy-within'); +require('../../modules/es.array.every'); +require('../../modules/es.array.fill'); +require('../../modules/es.array.filter'); +require('../../modules/es.array.find'); +require('../../modules/es.array.find-index'); +require('../../modules/es.array.flat'); +require('../../modules/es.array.flat-map'); +require('../../modules/es.array.for-each'); +require('../../modules/es.array.includes'); +require('../../modules/es.array.index-of'); +require('../../modules/es.array.iterator'); +require('../../modules/es.array.join'); +require('../../modules/es.array.last-index-of'); +require('../../modules/es.array.map'); +require('../../modules/es.array.reduce'); +require('../../modules/es.array.reduce-right'); +require('../../modules/es.array.reverse'); +require('../../modules/es.array.slice'); +require('../../modules/es.array.some'); +require('../../modules/es.array.sort'); +require('../../modules/es.array.species'); +require('../../modules/es.array.splice'); +require('../../modules/es.array.unscopables.flat'); +require('../../modules/es.array.unscopables.flat-map'); +var path = require('../../internals/path'); + +module.exports = path.Array; diff --git a/core-js/es/array/is-array.js b/core-js/es/array/is-array.js new file mode 100644 index 0000000000..d000180bc2 --- /dev/null +++ b/core-js/es/array/is-array.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.is-array'); +var path = require('../../internals/path'); + +module.exports = path.Array.isArray; diff --git a/core-js/es/array/iterator.js b/core-js/es/array/iterator.js new file mode 100644 index 0000000000..726484e036 --- /dev/null +++ b/core-js/es/array/iterator.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'values'); diff --git a/core-js/es/array/join.js b/core-js/es/array/join.js new file mode 100644 index 0000000000..523edbf09c --- /dev/null +++ b/core-js/es/array/join.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.join'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'join'); diff --git a/core-js/es/array/keys.js b/core-js/es/array/keys.js new file mode 100644 index 0000000000..679d525505 --- /dev/null +++ b/core-js/es/array/keys.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'keys'); diff --git a/core-js/es/array/last-index-of.js b/core-js/es/array/last-index-of.js new file mode 100644 index 0000000000..616897f9da --- /dev/null +++ b/core-js/es/array/last-index-of.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.last-index-of'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'lastIndexOf'); diff --git a/core-js/es/array/map.js b/core-js/es/array/map.js new file mode 100644 index 0000000000..6b641fe242 --- /dev/null +++ b/core-js/es/array/map.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.map'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'map'); diff --git a/core-js/es/array/of.js b/core-js/es/array/of.js new file mode 100644 index 0000000000..5153029f34 --- /dev/null +++ b/core-js/es/array/of.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.of'); +var path = require('../../internals/path'); + +module.exports = path.Array.of; diff --git a/core-js/es/array/reduce-right.js b/core-js/es/array/reduce-right.js new file mode 100644 index 0000000000..43cb972f20 --- /dev/null +++ b/core-js/es/array/reduce-right.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.reduce-right'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'reduceRight'); diff --git a/core-js/es/array/reduce.js b/core-js/es/array/reduce.js new file mode 100644 index 0000000000..db06a3ffc6 --- /dev/null +++ b/core-js/es/array/reduce.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.reduce'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'reduce'); diff --git a/core-js/es/array/reverse.js b/core-js/es/array/reverse.js new file mode 100644 index 0000000000..d5cc94ee2f --- /dev/null +++ b/core-js/es/array/reverse.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.reverse'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'reverse'); diff --git a/core-js/es/array/slice.js b/core-js/es/array/slice.js new file mode 100644 index 0000000000..0c9eb94236 --- /dev/null +++ b/core-js/es/array/slice.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.slice'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'slice'); diff --git a/core-js/es/array/some.js b/core-js/es/array/some.js new file mode 100644 index 0000000000..407d556303 --- /dev/null +++ b/core-js/es/array/some.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.some'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'some'); diff --git a/core-js/es/array/sort.js b/core-js/es/array/sort.js new file mode 100644 index 0000000000..0336090667 --- /dev/null +++ b/core-js/es/array/sort.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.sort'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'sort'); diff --git a/core-js/es/array/splice.js b/core-js/es/array/splice.js new file mode 100644 index 0000000000..95b51f052c --- /dev/null +++ b/core-js/es/array/splice.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.splice'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'splice'); diff --git a/core-js/es/array/values.js b/core-js/es/array/values.js new file mode 100644 index 0000000000..726484e036 --- /dev/null +++ b/core-js/es/array/values.js @@ -0,0 +1,4 @@ +require('../../modules/es.array.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'values'); diff --git a/core-js/es/array/virtual/concat.js b/core-js/es/array/virtual/concat.js new file mode 100644 index 0000000000..fc9eb035b3 --- /dev/null +++ b/core-js/es/array/virtual/concat.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.concat'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').concat; diff --git a/core-js/es/array/virtual/copy-within.js b/core-js/es/array/virtual/copy-within.js new file mode 100644 index 0000000000..71cc9bdff8 --- /dev/null +++ b/core-js/es/array/virtual/copy-within.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.copy-within'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').copyWithin; diff --git a/core-js/es/array/virtual/entries.js b/core-js/es/array/virtual/entries.js new file mode 100644 index 0000000000..1ce2e786b2 --- /dev/null +++ b/core-js/es/array/virtual/entries.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.iterator'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').entries; diff --git a/core-js/es/array/virtual/every.js b/core-js/es/array/virtual/every.js new file mode 100644 index 0000000000..cc45acc524 --- /dev/null +++ b/core-js/es/array/virtual/every.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.every'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').every; diff --git a/core-js/es/array/virtual/fill.js b/core-js/es/array/virtual/fill.js new file mode 100644 index 0000000000..75b5c8b328 --- /dev/null +++ b/core-js/es/array/virtual/fill.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.fill'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').fill; diff --git a/core-js/es/array/virtual/filter.js b/core-js/es/array/virtual/filter.js new file mode 100644 index 0000000000..90cb323d3b --- /dev/null +++ b/core-js/es/array/virtual/filter.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.filter'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').filter; diff --git a/core-js/es/array/virtual/find-index.js b/core-js/es/array/virtual/find-index.js new file mode 100644 index 0000000000..ff1a621833 --- /dev/null +++ b/core-js/es/array/virtual/find-index.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.find-index'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').findIndex; diff --git a/core-js/es/array/virtual/find.js b/core-js/es/array/virtual/find.js new file mode 100644 index 0000000000..a4372bdc48 --- /dev/null +++ b/core-js/es/array/virtual/find.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.find'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').find; diff --git a/core-js/es/array/virtual/flat-map.js b/core-js/es/array/virtual/flat-map.js new file mode 100644 index 0000000000..9e379f4d83 --- /dev/null +++ b/core-js/es/array/virtual/flat-map.js @@ -0,0 +1,5 @@ +require('../../../modules/es.array.flat-map'); +require('../../../modules/es.array.unscopables.flat-map'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').flatMap; diff --git a/core-js/es/array/virtual/flat.js b/core-js/es/array/virtual/flat.js new file mode 100644 index 0000000000..60b772ee9e --- /dev/null +++ b/core-js/es/array/virtual/flat.js @@ -0,0 +1,5 @@ +require('../../../modules/es.array.flat'); +require('../../../modules/es.array.unscopables.flat'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').flat; diff --git a/core-js/es/array/virtual/for-each.js b/core-js/es/array/virtual/for-each.js new file mode 100644 index 0000000000..c65b26cf31 --- /dev/null +++ b/core-js/es/array/virtual/for-each.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.for-each'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').forEach; diff --git a/core-js/es/array/virtual/includes.js b/core-js/es/array/virtual/includes.js new file mode 100644 index 0000000000..732d58be95 --- /dev/null +++ b/core-js/es/array/virtual/includes.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.includes'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').includes; diff --git a/core-js/es/array/virtual/index-of.js b/core-js/es/array/virtual/index-of.js new file mode 100644 index 0000000000..074e191e62 --- /dev/null +++ b/core-js/es/array/virtual/index-of.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.index-of'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').indexOf; diff --git a/core-js/es/array/virtual/index.js b/core-js/es/array/virtual/index.js new file mode 100644 index 0000000000..f1455e12cb --- /dev/null +++ b/core-js/es/array/virtual/index.js @@ -0,0 +1,29 @@ +require('../../../modules/es.array.concat'); +require('../../../modules/es.array.copy-within'); +require('../../../modules/es.array.every'); +require('../../../modules/es.array.fill'); +require('../../../modules/es.array.filter'); +require('../../../modules/es.array.find'); +require('../../../modules/es.array.find-index'); +require('../../../modules/es.array.flat'); +require('../../../modules/es.array.flat-map'); +require('../../../modules/es.array.for-each'); +require('../../../modules/es.array.includes'); +require('../../../modules/es.array.index-of'); +require('../../../modules/es.array.iterator'); +require('../../../modules/es.array.join'); +require('../../../modules/es.array.last-index-of'); +require('../../../modules/es.array.map'); +require('../../../modules/es.array.reduce'); +require('../../../modules/es.array.reduce-right'); +require('../../../modules/es.array.reverse'); +require('../../../modules/es.array.slice'); +require('../../../modules/es.array.some'); +require('../../../modules/es.array.sort'); +require('../../../modules/es.array.species'); +require('../../../modules/es.array.splice'); +require('../../../modules/es.array.unscopables.flat'); +require('../../../modules/es.array.unscopables.flat-map'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array'); diff --git a/core-js/es/array/virtual/iterator.js b/core-js/es/array/virtual/iterator.js new file mode 100644 index 0000000000..cd9f502f06 --- /dev/null +++ b/core-js/es/array/virtual/iterator.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.iterator'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').values; diff --git a/core-js/es/array/virtual/join.js b/core-js/es/array/virtual/join.js new file mode 100644 index 0000000000..8cb329e92c --- /dev/null +++ b/core-js/es/array/virtual/join.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.join'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').join; diff --git a/core-js/es/array/virtual/keys.js b/core-js/es/array/virtual/keys.js new file mode 100644 index 0000000000..28829901c8 --- /dev/null +++ b/core-js/es/array/virtual/keys.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.iterator'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').keys; diff --git a/core-js/es/array/virtual/last-index-of.js b/core-js/es/array/virtual/last-index-of.js new file mode 100644 index 0000000000..ca1ae9b796 --- /dev/null +++ b/core-js/es/array/virtual/last-index-of.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.last-index-of'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').lastIndexOf; diff --git a/core-js/es/array/virtual/map.js b/core-js/es/array/virtual/map.js new file mode 100644 index 0000000000..7205f966fc --- /dev/null +++ b/core-js/es/array/virtual/map.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.map'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').map; diff --git a/core-js/es/array/virtual/reduce-right.js b/core-js/es/array/virtual/reduce-right.js new file mode 100644 index 0000000000..0ad5926436 --- /dev/null +++ b/core-js/es/array/virtual/reduce-right.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.reduce-right'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').reduceRight; diff --git a/core-js/es/array/virtual/reduce.js b/core-js/es/array/virtual/reduce.js new file mode 100644 index 0000000000..d9b01c4c01 --- /dev/null +++ b/core-js/es/array/virtual/reduce.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.reduce'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').reduce; diff --git a/core-js/es/array/virtual/reverse.js b/core-js/es/array/virtual/reverse.js new file mode 100644 index 0000000000..31ca6d864a --- /dev/null +++ b/core-js/es/array/virtual/reverse.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.reverse'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').reverse; diff --git a/core-js/es/array/virtual/slice.js b/core-js/es/array/virtual/slice.js new file mode 100644 index 0000000000..f60f5d5954 --- /dev/null +++ b/core-js/es/array/virtual/slice.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.slice'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').slice; diff --git a/core-js/es/array/virtual/some.js b/core-js/es/array/virtual/some.js new file mode 100644 index 0000000000..a7ae18f82e --- /dev/null +++ b/core-js/es/array/virtual/some.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.some'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').some; diff --git a/core-js/es/array/virtual/sort.js b/core-js/es/array/virtual/sort.js new file mode 100644 index 0000000000..b7e0a46061 --- /dev/null +++ b/core-js/es/array/virtual/sort.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.sort'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').sort; diff --git a/core-js/es/array/virtual/splice.js b/core-js/es/array/virtual/splice.js new file mode 100644 index 0000000000..2533cecc4f --- /dev/null +++ b/core-js/es/array/virtual/splice.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.splice'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').splice; diff --git a/core-js/es/array/virtual/values.js b/core-js/es/array/virtual/values.js new file mode 100644 index 0000000000..cd9f502f06 --- /dev/null +++ b/core-js/es/array/virtual/values.js @@ -0,0 +1,4 @@ +require('../../../modules/es.array.iterator'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Array').values; diff --git a/core-js/es/data-view/index.js b/core-js/es/data-view/index.js new file mode 100644 index 0000000000..da3582d7ff --- /dev/null +++ b/core-js/es/data-view/index.js @@ -0,0 +1,5 @@ +require('../../modules/es.data-view'); +require('../../modules/es.object.to-string'); +var path = require('../../internals/path'); + +module.exports = path.DataView; diff --git a/core-js/es/date/index.js b/core-js/es/date/index.js new file mode 100644 index 0000000000..88e7a58367 --- /dev/null +++ b/core-js/es/date/index.js @@ -0,0 +1,8 @@ +require('../../modules/es.date.now'); +require('../../modules/es.date.to-json'); +require('../../modules/es.date.to-iso-string'); +require('../../modules/es.date.to-string'); +require('../../modules/es.date.to-primitive'); +var path = require('../../internals/path'); + +module.exports = path.Date; diff --git a/core-js/es/date/now.js b/core-js/es/date/now.js new file mode 100644 index 0000000000..ed6843e37c --- /dev/null +++ b/core-js/es/date/now.js @@ -0,0 +1,4 @@ +require('../../modules/es.date.now'); +var path = require('../../internals/path'); + +module.exports = path.Date.now; diff --git a/core-js/es/date/to-iso-string.js b/core-js/es/date/to-iso-string.js new file mode 100644 index 0000000000..ee06767cca --- /dev/null +++ b/core-js/es/date/to-iso-string.js @@ -0,0 +1,5 @@ +require('../../modules/es.date.to-iso-string'); +require('../../modules/es.date.to-json'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Date', 'toISOString'); diff --git a/core-js/es/date/to-json.js b/core-js/es/date/to-json.js new file mode 100644 index 0000000000..1fa104a272 --- /dev/null +++ b/core-js/es/date/to-json.js @@ -0,0 +1,4 @@ +require('../../modules/es.date.to-json'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Date', 'toJSON'); diff --git a/core-js/es/date/to-primitive.js b/core-js/es/date/to-primitive.js new file mode 100644 index 0000000000..07bdd33613 --- /dev/null +++ b/core-js/es/date/to-primitive.js @@ -0,0 +1,6 @@ +require('../../modules/es.date.to-primitive'); +var toPrimitive = require('../../internals/date-to-primitive'); + +module.exports = function (it, hint) { + return toPrimitive.call(it, hint); +}; diff --git a/core-js/es/date/to-string.js b/core-js/es/date/to-string.js new file mode 100644 index 0000000000..18b713590b --- /dev/null +++ b/core-js/es/date/to-string.js @@ -0,0 +1,6 @@ +require('../../modules/es.date.to-string'); +var dateToString = Date.prototype.toString; + +module.exports = function toString(it) { + return dateToString.call(it); +}; diff --git a/core-js/es/function/bind.js b/core-js/es/function/bind.js new file mode 100644 index 0000000000..a3e3575087 --- /dev/null +++ b/core-js/es/function/bind.js @@ -0,0 +1,4 @@ +require('../../modules/es.function.bind'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Function', 'bind'); diff --git a/core-js/es/function/has-instance.js b/core-js/es/function/has-instance.js new file mode 100644 index 0000000000..33722b083c --- /dev/null +++ b/core-js/es/function/has-instance.js @@ -0,0 +1,4 @@ +require('../../modules/es.function.has-instance'); +var wellKnownSymbol = require('../../internals/well-known-symbol'); + +module.exports = Function[wellKnownSymbol('hasInstance')]; diff --git a/core-js/es/function/index.js b/core-js/es/function/index.js new file mode 100644 index 0000000000..9caa29d080 --- /dev/null +++ b/core-js/es/function/index.js @@ -0,0 +1,6 @@ +require('../../modules/es.function.bind'); +require('../../modules/es.function.name'); +require('../../modules/es.function.has-instance'); +var path = require('../../internals/path'); + +module.exports = path.Function; diff --git a/core-js/es/function/name.js b/core-js/es/function/name.js new file mode 100644 index 0000000000..43344dbd29 --- /dev/null +++ b/core-js/es/function/name.js @@ -0,0 +1 @@ +require('../../modules/es.function.name'); diff --git a/core-js/es/function/virtual/bind.js b/core-js/es/function/virtual/bind.js new file mode 100644 index 0000000000..7ec110d6bb --- /dev/null +++ b/core-js/es/function/virtual/bind.js @@ -0,0 +1,4 @@ +require('../../../modules/es.function.bind'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Function').bind; diff --git a/core-js/es/function/virtual/index.js b/core-js/es/function/virtual/index.js new file mode 100644 index 0000000000..0a0113555d --- /dev/null +++ b/core-js/es/function/virtual/index.js @@ -0,0 +1,4 @@ +require('../../../modules/es.function.bind'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Function'); diff --git a/core-js/es/index.js b/core-js/es/index.js new file mode 100644 index 0000000000..dc8344e11f --- /dev/null +++ b/core-js/es/index.js @@ -0,0 +1,205 @@ +require('../modules/es.symbol'); +require('../modules/es.symbol.async-iterator'); +require('../modules/es.symbol.description'); +require('../modules/es.symbol.has-instance'); +require('../modules/es.symbol.is-concat-spreadable'); +require('../modules/es.symbol.iterator'); +require('../modules/es.symbol.match'); +require('../modules/es.symbol.match-all'); +require('../modules/es.symbol.replace'); +require('../modules/es.symbol.search'); +require('../modules/es.symbol.species'); +require('../modules/es.symbol.split'); +require('../modules/es.symbol.to-primitive'); +require('../modules/es.symbol.to-string-tag'); +require('../modules/es.symbol.unscopables'); +require('../modules/es.object.assign'); +require('../modules/es.object.create'); +require('../modules/es.object.define-property'); +require('../modules/es.object.define-properties'); +require('../modules/es.object.entries'); +require('../modules/es.object.freeze'); +require('../modules/es.object.from-entries'); +require('../modules/es.object.get-own-property-descriptor'); +require('../modules/es.object.get-own-property-descriptors'); +require('../modules/es.object.get-own-property-names'); +require('../modules/es.object.get-prototype-of'); +require('../modules/es.object.is'); +require('../modules/es.object.is-extensible'); +require('../modules/es.object.is-frozen'); +require('../modules/es.object.is-sealed'); +require('../modules/es.object.keys'); +require('../modules/es.object.prevent-extensions'); +require('../modules/es.object.seal'); +require('../modules/es.object.set-prototype-of'); +require('../modules/es.object.values'); +require('../modules/es.object.to-string'); +require('../modules/es.object.define-getter'); +require('../modules/es.object.define-setter'); +require('../modules/es.object.lookup-getter'); +require('../modules/es.object.lookup-setter'); +require('../modules/es.function.bind'); +require('../modules/es.function.name'); +require('../modules/es.function.has-instance'); +require('../modules/es.array.from'); +require('../modules/es.array.is-array'); +require('../modules/es.array.of'); +require('../modules/es.array.concat'); +require('../modules/es.array.copy-within'); +require('../modules/es.array.every'); +require('../modules/es.array.fill'); +require('../modules/es.array.filter'); +require('../modules/es.array.find'); +require('../modules/es.array.find-index'); +require('../modules/es.array.flat'); +require('../modules/es.array.flat-map'); +require('../modules/es.array.for-each'); +require('../modules/es.array.includes'); +require('../modules/es.array.index-of'); +require('../modules/es.array.join'); +require('../modules/es.array.last-index-of'); +require('../modules/es.array.map'); +require('../modules/es.array.reduce'); +require('../modules/es.array.reduce-right'); +require('../modules/es.array.reverse'); +require('../modules/es.array.slice'); +require('../modules/es.array.some'); +require('../modules/es.array.sort'); +require('../modules/es.array.splice'); +require('../modules/es.array.species'); +require('../modules/es.array.unscopables.flat'); +require('../modules/es.array.unscopables.flat-map'); +require('../modules/es.array.iterator'); +require('../modules/es.string.from-code-point'); +require('../modules/es.string.raw'); +require('../modules/es.string.code-point-at'); +require('../modules/es.string.ends-with'); +require('../modules/es.string.includes'); +require('../modules/es.string.match'); +require('../modules/es.string.match-all'); +require('../modules/es.string.pad-end'); +require('../modules/es.string.pad-start'); +require('../modules/es.string.repeat'); +require('../modules/es.string.replace'); +require('../modules/es.string.search'); +require('../modules/es.string.split'); +require('../modules/es.string.starts-with'); +require('../modules/es.string.trim'); +require('../modules/es.string.trim-start'); +require('../modules/es.string.trim-end'); +require('../modules/es.string.iterator'); +require('../modules/es.string.anchor'); +require('../modules/es.string.big'); +require('../modules/es.string.blink'); +require('../modules/es.string.bold'); +require('../modules/es.string.fixed'); +require('../modules/es.string.fontcolor'); +require('../modules/es.string.fontsize'); +require('../modules/es.string.italics'); +require('../modules/es.string.link'); +require('../modules/es.string.small'); +require('../modules/es.string.strike'); +require('../modules/es.string.sub'); +require('../modules/es.string.sup'); +require('../modules/es.regexp.constructor'); +require('../modules/es.regexp.exec'); +require('../modules/es.regexp.flags'); +require('../modules/es.regexp.to-string'); +require('../modules/es.parse-int'); +require('../modules/es.parse-float'); +require('../modules/es.number.constructor'); +require('../modules/es.number.epsilon'); +require('../modules/es.number.is-finite'); +require('../modules/es.number.is-integer'); +require('../modules/es.number.is-nan'); +require('../modules/es.number.is-safe-integer'); +require('../modules/es.number.max-safe-integer'); +require('../modules/es.number.min-safe-integer'); +require('../modules/es.number.parse-float'); +require('../modules/es.number.parse-int'); +require('../modules/es.number.to-fixed'); +require('../modules/es.number.to-precision'); +require('../modules/es.math.acosh'); +require('../modules/es.math.asinh'); +require('../modules/es.math.atanh'); +require('../modules/es.math.cbrt'); +require('../modules/es.math.clz32'); +require('../modules/es.math.cosh'); +require('../modules/es.math.expm1'); +require('../modules/es.math.fround'); +require('../modules/es.math.hypot'); +require('../modules/es.math.imul'); +require('../modules/es.math.log10'); +require('../modules/es.math.log1p'); +require('../modules/es.math.log2'); +require('../modules/es.math.sign'); +require('../modules/es.math.sinh'); +require('../modules/es.math.tanh'); +require('../modules/es.math.to-string-tag'); +require('../modules/es.math.trunc'); +require('../modules/es.date.now'); +require('../modules/es.date.to-json'); +require('../modules/es.date.to-iso-string'); +require('../modules/es.date.to-string'); +require('../modules/es.date.to-primitive'); +require('../modules/es.json.to-string-tag'); +require('../modules/es.promise'); +require('../modules/es.promise.all-settled'); +require('../modules/es.promise.finally'); +require('../modules/es.map'); +require('../modules/es.set'); +require('../modules/es.weak-map'); +require('../modules/es.weak-set'); +require('../modules/es.array-buffer.constructor'); +require('../modules/es.array-buffer.is-view'); +require('../modules/es.array-buffer.slice'); +require('../modules/es.data-view'); +require('../modules/es.typed-array.int8-array'); +require('../modules/es.typed-array.uint8-array'); +require('../modules/es.typed-array.uint8-clamped-array'); +require('../modules/es.typed-array.int16-array'); +require('../modules/es.typed-array.uint16-array'); +require('../modules/es.typed-array.int32-array'); +require('../modules/es.typed-array.uint32-array'); +require('../modules/es.typed-array.float32-array'); +require('../modules/es.typed-array.float64-array'); +require('../modules/es.typed-array.from'); +require('../modules/es.typed-array.of'); +require('../modules/es.typed-array.copy-within'); +require('../modules/es.typed-array.every'); +require('../modules/es.typed-array.fill'); +require('../modules/es.typed-array.filter'); +require('../modules/es.typed-array.find'); +require('../modules/es.typed-array.find-index'); +require('../modules/es.typed-array.for-each'); +require('../modules/es.typed-array.includes'); +require('../modules/es.typed-array.index-of'); +require('../modules/es.typed-array.iterator'); +require('../modules/es.typed-array.join'); +require('../modules/es.typed-array.last-index-of'); +require('../modules/es.typed-array.map'); +require('../modules/es.typed-array.reduce'); +require('../modules/es.typed-array.reduce-right'); +require('../modules/es.typed-array.reverse'); +require('../modules/es.typed-array.set'); +require('../modules/es.typed-array.slice'); +require('../modules/es.typed-array.some'); +require('../modules/es.typed-array.sort'); +require('../modules/es.typed-array.subarray'); +require('../modules/es.typed-array.to-locale-string'); +require('../modules/es.typed-array.to-string'); +require('../modules/es.reflect.apply'); +require('../modules/es.reflect.construct'); +require('../modules/es.reflect.define-property'); +require('../modules/es.reflect.delete-property'); +require('../modules/es.reflect.get'); +require('../modules/es.reflect.get-own-property-descriptor'); +require('../modules/es.reflect.get-prototype-of'); +require('../modules/es.reflect.has'); +require('../modules/es.reflect.is-extensible'); +require('../modules/es.reflect.own-keys'); +require('../modules/es.reflect.prevent-extensions'); +require('../modules/es.reflect.set'); +require('../modules/es.reflect.set-prototype-of'); + +module.exports = require('../internals/path'); diff --git a/core-js/es/instance/bind.js b/core-js/es/instance/bind.js new file mode 100644 index 0000000000..11f932a264 --- /dev/null +++ b/core-js/es/instance/bind.js @@ -0,0 +1,8 @@ +var bind = require('../function/virtual/bind'); + +var FunctionPrototype = Function.prototype; + +module.exports = function (it) { + var own = it.bind; + return it === FunctionPrototype || (it instanceof Function && own === FunctionPrototype.bind) ? bind : own; +}; diff --git a/core-js/es/instance/code-point-at.js b/core-js/es/instance/code-point-at.js new file mode 100644 index 0000000000..c4eaa422c9 --- /dev/null +++ b/core-js/es/instance/code-point-at.js @@ -0,0 +1,9 @@ +var codePointAt = require('../string/virtual/code-point-at'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.codePointAt; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.codePointAt) ? codePointAt : own; +}; diff --git a/core-js/es/instance/concat.js b/core-js/es/instance/concat.js new file mode 100644 index 0000000000..87b74138d7 --- /dev/null +++ b/core-js/es/instance/concat.js @@ -0,0 +1,8 @@ +var concat = require('../array/virtual/concat'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.concat; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.concat) ? concat : own; +}; diff --git a/core-js/es/instance/copy-within.js b/core-js/es/instance/copy-within.js new file mode 100644 index 0000000000..c59f52d375 --- /dev/null +++ b/core-js/es/instance/copy-within.js @@ -0,0 +1,8 @@ +var copyWithin = require('../array/virtual/copy-within'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.copyWithin; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.copyWithin) ? copyWithin : own; +}; diff --git a/core-js/es/instance/ends-with.js b/core-js/es/instance/ends-with.js new file mode 100644 index 0000000000..532d6f7ea3 --- /dev/null +++ b/core-js/es/instance/ends-with.js @@ -0,0 +1,9 @@ +var endsWith = require('../string/virtual/ends-with'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.endsWith; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.endsWith) ? endsWith : own; +}; diff --git a/core-js/es/instance/entries.js b/core-js/es/instance/entries.js new file mode 100644 index 0000000000..8aedc418cf --- /dev/null +++ b/core-js/es/instance/entries.js @@ -0,0 +1,8 @@ +var entries = require('../array/virtual/entries'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.entries; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.entries) ? entries : own; +}; diff --git a/core-js/es/instance/every.js b/core-js/es/instance/every.js new file mode 100644 index 0000000000..1faaccbbe5 --- /dev/null +++ b/core-js/es/instance/every.js @@ -0,0 +1,8 @@ +var every = require('../array/virtual/every'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.every; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.every) ? every : own; +}; diff --git a/core-js/es/instance/fill.js b/core-js/es/instance/fill.js new file mode 100644 index 0000000000..5d0f22be57 --- /dev/null +++ b/core-js/es/instance/fill.js @@ -0,0 +1,8 @@ +var fill = require('../array/virtual/fill'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.fill; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.fill) ? fill : own; +}; diff --git a/core-js/es/instance/filter.js b/core-js/es/instance/filter.js new file mode 100644 index 0000000000..8ba32b66d2 --- /dev/null +++ b/core-js/es/instance/filter.js @@ -0,0 +1,8 @@ +var filter = require('../array/virtual/filter'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.filter; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filter) ? filter : own; +}; diff --git a/core-js/es/instance/find-index.js b/core-js/es/instance/find-index.js new file mode 100644 index 0000000000..27a0583745 --- /dev/null +++ b/core-js/es/instance/find-index.js @@ -0,0 +1,8 @@ +var findIndex = require('../array/virtual/find-index'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.findIndex; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findIndex) ? findIndex : own; +}; diff --git a/core-js/es/instance/find.js b/core-js/es/instance/find.js new file mode 100644 index 0000000000..70443c76b8 --- /dev/null +++ b/core-js/es/instance/find.js @@ -0,0 +1,8 @@ +var find = require('../array/virtual/find'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.find; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.find) ? find : own; +}; diff --git a/core-js/es/instance/flags.js b/core-js/es/instance/flags.js new file mode 100644 index 0000000000..f0b91148e6 --- /dev/null +++ b/core-js/es/instance/flags.js @@ -0,0 +1,7 @@ +var flags = require('../regexp/flags'); + +var RegExpPrototype = RegExp.prototype; + +module.exports = function (it) { + return (it === RegExpPrototype || it instanceof RegExp) && !('flags' in it) ? flags(it) : it.flags; +}; diff --git a/core-js/es/instance/flat-map.js b/core-js/es/instance/flat-map.js new file mode 100644 index 0000000000..eca5a41ddf --- /dev/null +++ b/core-js/es/instance/flat-map.js @@ -0,0 +1,8 @@ +var flatMap = require('../array/virtual/flat-map'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.flatMap; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.flatMap) ? flatMap : own; +}; diff --git a/core-js/es/instance/flat.js b/core-js/es/instance/flat.js new file mode 100644 index 0000000000..186a729387 --- /dev/null +++ b/core-js/es/instance/flat.js @@ -0,0 +1,8 @@ +var flat = require('../array/virtual/flat'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.flat; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.flat) ? flat : own; +}; diff --git a/core-js/es/instance/for-each.js b/core-js/es/instance/for-each.js new file mode 100644 index 0000000000..3a2e6a91d1 --- /dev/null +++ b/core-js/es/instance/for-each.js @@ -0,0 +1,8 @@ +var forEach = require('../array/virtual/for-each'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.forEach; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach) ? forEach : own; +}; diff --git a/core-js/es/instance/includes.js b/core-js/es/instance/includes.js new file mode 100644 index 0000000000..d2823737ca --- /dev/null +++ b/core-js/es/instance/includes.js @@ -0,0 +1,13 @@ +var arrayIncludes = require('../array/virtual/includes'); +var stringIncludes = require('../string/virtual/includes'); + +var ArrayPrototype = Array.prototype; +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.includes; + if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.includes)) return arrayIncludes; + if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.includes)) { + return stringIncludes; + } return own; +}; diff --git a/core-js/es/instance/index-of.js b/core-js/es/instance/index-of.js new file mode 100644 index 0000000000..a5fa42a8cd --- /dev/null +++ b/core-js/es/instance/index-of.js @@ -0,0 +1,8 @@ +var indexOf = require('../array/virtual/index-of'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.indexOf; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.indexOf) ? indexOf : own; +}; diff --git a/core-js/es/instance/keys.js b/core-js/es/instance/keys.js new file mode 100644 index 0000000000..0e2dca2ae2 --- /dev/null +++ b/core-js/es/instance/keys.js @@ -0,0 +1,8 @@ +var keys = require('../array/virtual/keys'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.keys; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.keys) ? keys : own; +}; diff --git a/core-js/es/instance/last-index-of.js b/core-js/es/instance/last-index-of.js new file mode 100644 index 0000000000..729bc658b4 --- /dev/null +++ b/core-js/es/instance/last-index-of.js @@ -0,0 +1,8 @@ +var lastIndexOf = require('../array/virtual/last-index-of'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.lastIndexOf; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.lastIndexOf) ? lastIndexOf : own; +}; diff --git a/core-js/es/instance/map.js b/core-js/es/instance/map.js new file mode 100644 index 0000000000..4d2d17f531 --- /dev/null +++ b/core-js/es/instance/map.js @@ -0,0 +1,8 @@ +var map = require('../array/virtual/map'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.map; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.map) ? map : own; +}; diff --git a/core-js/es/instance/match-all.js b/core-js/es/instance/match-all.js new file mode 100644 index 0000000000..2ab56b11ab --- /dev/null +++ b/core-js/es/instance/match-all.js @@ -0,0 +1,9 @@ +var matchAll = require('../string/virtual/match-all'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.matchAll; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.matchAll) ? matchAll : own; +}; diff --git a/core-js/es/instance/pad-end.js b/core-js/es/instance/pad-end.js new file mode 100644 index 0000000000..40ea6030bc --- /dev/null +++ b/core-js/es/instance/pad-end.js @@ -0,0 +1,9 @@ +var padEnd = require('../string/virtual/pad-end'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.padEnd; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.padEnd) ? padEnd : own; +}; diff --git a/core-js/es/instance/pad-start.js b/core-js/es/instance/pad-start.js new file mode 100644 index 0000000000..1e3220cd27 --- /dev/null +++ b/core-js/es/instance/pad-start.js @@ -0,0 +1,9 @@ +var padStart = require('../string/virtual/pad-start'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.padStart; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.padStart) ? padStart : own; +}; diff --git a/core-js/es/instance/reduce-right.js b/core-js/es/instance/reduce-right.js new file mode 100644 index 0000000000..6a8802f2d9 --- /dev/null +++ b/core-js/es/instance/reduce-right.js @@ -0,0 +1,8 @@ +var reduceRight = require('../array/virtual/reduce-right'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.reduceRight; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.reduceRight) ? reduceRight : own; +}; diff --git a/core-js/es/instance/reduce.js b/core-js/es/instance/reduce.js new file mode 100644 index 0000000000..efa46a9335 --- /dev/null +++ b/core-js/es/instance/reduce.js @@ -0,0 +1,8 @@ +var reduce = require('../array/virtual/reduce'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.reduce; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.reduce) ? reduce : own; +}; diff --git a/core-js/es/instance/repeat.js b/core-js/es/instance/repeat.js new file mode 100644 index 0000000000..d4c05ad380 --- /dev/null +++ b/core-js/es/instance/repeat.js @@ -0,0 +1,9 @@ +var repeat = require('../string/virtual/repeat'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.repeat; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.repeat) ? repeat : own; +}; diff --git a/core-js/es/instance/reverse.js b/core-js/es/instance/reverse.js new file mode 100644 index 0000000000..ca4bfeaf04 --- /dev/null +++ b/core-js/es/instance/reverse.js @@ -0,0 +1,8 @@ +var reverse = require('../array/virtual/reverse'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.reverse; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.reverse) ? reverse : own; +}; diff --git a/core-js/es/instance/slice.js b/core-js/es/instance/slice.js new file mode 100644 index 0000000000..03ef7a7d90 --- /dev/null +++ b/core-js/es/instance/slice.js @@ -0,0 +1,8 @@ +var slice = require('../array/virtual/slice'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.slice; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.slice) ? slice : own; +}; diff --git a/core-js/es/instance/some.js b/core-js/es/instance/some.js new file mode 100644 index 0000000000..562c11ea45 --- /dev/null +++ b/core-js/es/instance/some.js @@ -0,0 +1,8 @@ +var some = require('../array/virtual/some'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.some; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.some) ? some : own; +}; diff --git a/core-js/es/instance/sort.js b/core-js/es/instance/sort.js new file mode 100644 index 0000000000..96edb8037c --- /dev/null +++ b/core-js/es/instance/sort.js @@ -0,0 +1,8 @@ +var sort = require('../array/virtual/sort'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.sort; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.sort) ? sort : own; +}; diff --git a/core-js/es/instance/splice.js b/core-js/es/instance/splice.js new file mode 100644 index 0000000000..5b907f4b3f --- /dev/null +++ b/core-js/es/instance/splice.js @@ -0,0 +1,8 @@ +var splice = require('../array/virtual/splice'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.splice; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.splice) ? splice : own; +}; diff --git a/core-js/es/instance/starts-with.js b/core-js/es/instance/starts-with.js new file mode 100644 index 0000000000..99a01a7f25 --- /dev/null +++ b/core-js/es/instance/starts-with.js @@ -0,0 +1,9 @@ +var startsWith = require('../string/virtual/starts-with'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.startsWith; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.startsWith) ? startsWith : own; +}; diff --git a/core-js/es/instance/trim-end.js b/core-js/es/instance/trim-end.js new file mode 100644 index 0000000000..c004cbafff --- /dev/null +++ b/core-js/es/instance/trim-end.js @@ -0,0 +1,9 @@ +var trimEnd = require('../string/virtual/trim-end'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.trimEnd; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.trimEnd) ? trimEnd : own; +}; diff --git a/core-js/es/instance/trim-left.js b/core-js/es/instance/trim-left.js new file mode 100644 index 0000000000..fc5c3091a5 --- /dev/null +++ b/core-js/es/instance/trim-left.js @@ -0,0 +1,9 @@ +var trimLeft = require('../string/virtual/trim-left'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.trimLeft; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.trimLeft) ? trimLeft : own; +}; diff --git a/core-js/es/instance/trim-right.js b/core-js/es/instance/trim-right.js new file mode 100644 index 0000000000..ef38effcae --- /dev/null +++ b/core-js/es/instance/trim-right.js @@ -0,0 +1,9 @@ +var trimRight = require('../string/virtual/trim-right'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.trimRight; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.trimRight) ? trimRight : own; +}; diff --git a/core-js/es/instance/trim-start.js b/core-js/es/instance/trim-start.js new file mode 100644 index 0000000000..74a89bd937 --- /dev/null +++ b/core-js/es/instance/trim-start.js @@ -0,0 +1,9 @@ +var trimStart = require('../string/virtual/trim-start'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.trimStart; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.trimStart) ? trimStart : own; +}; diff --git a/core-js/es/instance/trim.js b/core-js/es/instance/trim.js new file mode 100644 index 0000000000..cdd3ed9dea --- /dev/null +++ b/core-js/es/instance/trim.js @@ -0,0 +1,9 @@ +var trim = require('../string/virtual/trim'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.trim; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.trim) ? trim : own; +}; diff --git a/core-js/es/instance/values.js b/core-js/es/instance/values.js new file mode 100644 index 0000000000..52c76df283 --- /dev/null +++ b/core-js/es/instance/values.js @@ -0,0 +1,8 @@ +var values = require('../array/virtual/values'); + +var ArrayPrototype = Array.prototype; + +module.exports = function (it) { + var own = it.values; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.values) ? values : own; +}; diff --git a/core-js/es/json/index.js b/core-js/es/json/index.js new file mode 100644 index 0000000000..f8d9216c58 --- /dev/null +++ b/core-js/es/json/index.js @@ -0,0 +1,4 @@ +require('../../modules/es.json.to-string-tag'); +var path = require('../../internals/path'); + +module.exports = path.JSON || (path.JSON = { stringify: JSON.stringify }); diff --git a/core-js/es/json/stringify.js b/core-js/es/json/stringify.js new file mode 100644 index 0000000000..48e6385ac9 --- /dev/null +++ b/core-js/es/json/stringify.js @@ -0,0 +1,6 @@ +var core = require('../../internals/path'); +var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify }); + +module.exports = function stringify(it) { // eslint-disable-line no-unused-vars + return $JSON.stringify.apply($JSON, arguments); +}; diff --git a/core-js/es/json/to-string-tag.js b/core-js/es/json/to-string-tag.js new file mode 100644 index 0000000000..7ed4618c74 --- /dev/null +++ b/core-js/es/json/to-string-tag.js @@ -0,0 +1,3 @@ +require('../../modules/es.json.to-string-tag'); + +module.exports = 'JSON'; diff --git a/core-js/es/map/index.js b/core-js/es/map/index.js new file mode 100644 index 0000000000..ab554cfaa0 --- /dev/null +++ b/core-js/es/map/index.js @@ -0,0 +1,7 @@ +require('../../modules/es.map'); +require('../../modules/es.object.to-string'); +require('../../modules/es.string.iterator'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +module.exports = path.Map; diff --git a/core-js/es/math/acosh.js b/core-js/es/math/acosh.js new file mode 100644 index 0000000000..0ef459bd6b --- /dev/null +++ b/core-js/es/math/acosh.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.acosh'); +var path = require('../../internals/path'); + +module.exports = path.Math.acosh; diff --git a/core-js/es/math/asinh.js b/core-js/es/math/asinh.js new file mode 100644 index 0000000000..f300ec4d49 --- /dev/null +++ b/core-js/es/math/asinh.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.asinh'); +var path = require('../../internals/path'); + +module.exports = path.Math.asinh; diff --git a/core-js/es/math/atanh.js b/core-js/es/math/atanh.js new file mode 100644 index 0000000000..6ca611190f --- /dev/null +++ b/core-js/es/math/atanh.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.atanh'); +var path = require('../../internals/path'); + +module.exports = path.Math.atanh; diff --git a/core-js/es/math/cbrt.js b/core-js/es/math/cbrt.js new file mode 100644 index 0000000000..c8297a7d0e --- /dev/null +++ b/core-js/es/math/cbrt.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.cbrt'); +var path = require('../../internals/path'); + +module.exports = path.Math.cbrt; diff --git a/core-js/es/math/clz32.js b/core-js/es/math/clz32.js new file mode 100644 index 0000000000..a2ea307d6c --- /dev/null +++ b/core-js/es/math/clz32.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.clz32'); +var path = require('../../internals/path'); + +module.exports = path.Math.clz32; diff --git a/core-js/es/math/cosh.js b/core-js/es/math/cosh.js new file mode 100644 index 0000000000..09dc191cf8 --- /dev/null +++ b/core-js/es/math/cosh.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.cosh'); +var path = require('../../internals/path'); + +module.exports = path.Math.cosh; diff --git a/core-js/es/math/expm1.js b/core-js/es/math/expm1.js new file mode 100644 index 0000000000..96573768ac --- /dev/null +++ b/core-js/es/math/expm1.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.expm1'); +var path = require('../../internals/path'); + +module.exports = path.Math.expm1; diff --git a/core-js/es/math/fround.js b/core-js/es/math/fround.js new file mode 100644 index 0000000000..41c7292ae0 --- /dev/null +++ b/core-js/es/math/fround.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.fround'); +var path = require('../../internals/path'); + +module.exports = path.Math.fround; diff --git a/core-js/es/math/hypot.js b/core-js/es/math/hypot.js new file mode 100644 index 0000000000..34d5175e31 --- /dev/null +++ b/core-js/es/math/hypot.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.hypot'); +var path = require('../../internals/path'); + +module.exports = path.Math.hypot; diff --git a/core-js/es/math/imul.js b/core-js/es/math/imul.js new file mode 100644 index 0000000000..2f17f9321f --- /dev/null +++ b/core-js/es/math/imul.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.imul'); +var path = require('../../internals/path'); + +module.exports = path.Math.imul; diff --git a/core-js/es/math/index.js b/core-js/es/math/index.js new file mode 100644 index 0000000000..8986227087 --- /dev/null +++ b/core-js/es/math/index.js @@ -0,0 +1,21 @@ +require('../../modules/es.math.acosh'); +require('../../modules/es.math.asinh'); +require('../../modules/es.math.atanh'); +require('../../modules/es.math.cbrt'); +require('../../modules/es.math.clz32'); +require('../../modules/es.math.cosh'); +require('../../modules/es.math.expm1'); +require('../../modules/es.math.fround'); +require('../../modules/es.math.hypot'); +require('../../modules/es.math.imul'); +require('../../modules/es.math.log10'); +require('../../modules/es.math.log1p'); +require('../../modules/es.math.log2'); +require('../../modules/es.math.sign'); +require('../../modules/es.math.sinh'); +require('../../modules/es.math.tanh'); +require('../../modules/es.math.to-string-tag'); +require('../../modules/es.math.trunc'); +var path = require('../../internals/path'); + +module.exports = path.Math; diff --git a/core-js/es/math/log10.js b/core-js/es/math/log10.js new file mode 100644 index 0000000000..b91166f3cf --- /dev/null +++ b/core-js/es/math/log10.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.log10'); +var path = require('../../internals/path'); + +module.exports = path.Math.log10; diff --git a/core-js/es/math/log1p.js b/core-js/es/math/log1p.js new file mode 100644 index 0000000000..a1d4db1ede --- /dev/null +++ b/core-js/es/math/log1p.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.log1p'); +var path = require('../../internals/path'); + +module.exports = path.Math.log1p; diff --git a/core-js/es/math/log2.js b/core-js/es/math/log2.js new file mode 100644 index 0000000000..99c0594910 --- /dev/null +++ b/core-js/es/math/log2.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.log2'); +var path = require('../../internals/path'); + +module.exports = path.Math.log2; diff --git a/core-js/es/math/sign.js b/core-js/es/math/sign.js new file mode 100644 index 0000000000..9f6eb951e2 --- /dev/null +++ b/core-js/es/math/sign.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.sign'); +var path = require('../../internals/path'); + +module.exports = path.Math.sign; diff --git a/core-js/es/math/sinh.js b/core-js/es/math/sinh.js new file mode 100644 index 0000000000..cf8d51a047 --- /dev/null +++ b/core-js/es/math/sinh.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.sinh'); +var path = require('../../internals/path'); + +module.exports = path.Math.sinh; diff --git a/core-js/es/math/tanh.js b/core-js/es/math/tanh.js new file mode 100644 index 0000000000..030c175ddb --- /dev/null +++ b/core-js/es/math/tanh.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.tanh'); +var path = require('../../internals/path'); + +module.exports = path.Math.tanh; diff --git a/core-js/es/math/to-string-tag.js b/core-js/es/math/to-string-tag.js new file mode 100644 index 0000000000..c8714c24fe --- /dev/null +++ b/core-js/es/math/to-string-tag.js @@ -0,0 +1,3 @@ +require('../../modules/es.math.to-string-tag'); + +module.exports = 'Math'; diff --git a/core-js/es/math/trunc.js b/core-js/es/math/trunc.js new file mode 100644 index 0000000000..510337ba5e --- /dev/null +++ b/core-js/es/math/trunc.js @@ -0,0 +1,4 @@ +require('../../modules/es.math.trunc'); +var path = require('../../internals/path'); + +module.exports = path.Math.trunc; diff --git a/core-js/es/number/constructor.js b/core-js/es/number/constructor.js new file mode 100644 index 0000000000..a77a1aa8d6 --- /dev/null +++ b/core-js/es/number/constructor.js @@ -0,0 +1,3 @@ +require('../../modules/es.number.constructor'); + +module.exports = Number; diff --git a/core-js/es/number/epsilon.js b/core-js/es/number/epsilon.js new file mode 100644 index 0000000000..627b0777c9 --- /dev/null +++ b/core-js/es/number/epsilon.js @@ -0,0 +1,3 @@ +require('../../modules/es.number.epsilon'); + +module.exports = Math.pow(2, -52); diff --git a/core-js/es/number/index.js b/core-js/es/number/index.js new file mode 100644 index 0000000000..1341b56bee --- /dev/null +++ b/core-js/es/number/index.js @@ -0,0 +1,15 @@ +require('../../modules/es.number.constructor'); +require('../../modules/es.number.epsilon'); +require('../../modules/es.number.is-finite'); +require('../../modules/es.number.is-integer'); +require('../../modules/es.number.is-nan'); +require('../../modules/es.number.is-safe-integer'); +require('../../modules/es.number.max-safe-integer'); +require('../../modules/es.number.min-safe-integer'); +require('../../modules/es.number.parse-float'); +require('../../modules/es.number.parse-int'); +require('../../modules/es.number.to-fixed'); +require('../../modules/es.number.to-precision'); +var path = require('../../internals/path'); + +module.exports = path.Number; diff --git a/core-js/es/number/is-finite.js b/core-js/es/number/is-finite.js new file mode 100644 index 0000000000..dd16f9d09e --- /dev/null +++ b/core-js/es/number/is-finite.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.is-finite'); +var path = require('../../internals/path'); + +module.exports = path.Number.isFinite; diff --git a/core-js/es/number/is-integer.js b/core-js/es/number/is-integer.js new file mode 100644 index 0000000000..c6734a954f --- /dev/null +++ b/core-js/es/number/is-integer.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.is-integer'); +var path = require('../../internals/path'); + +module.exports = path.Number.isInteger; diff --git a/core-js/es/number/is-nan.js b/core-js/es/number/is-nan.js new file mode 100644 index 0000000000..9af93bb6fe --- /dev/null +++ b/core-js/es/number/is-nan.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.is-nan'); +var path = require('../../internals/path'); + +module.exports = path.Number.isNaN; diff --git a/core-js/es/number/is-safe-integer.js b/core-js/es/number/is-safe-integer.js new file mode 100644 index 0000000000..ec34c62976 --- /dev/null +++ b/core-js/es/number/is-safe-integer.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.is-safe-integer'); +var path = require('../../internals/path'); + +module.exports = path.Number.isSafeInteger; diff --git a/core-js/es/number/max-safe-integer.js b/core-js/es/number/max-safe-integer.js new file mode 100644 index 0000000000..b901200ca0 --- /dev/null +++ b/core-js/es/number/max-safe-integer.js @@ -0,0 +1,3 @@ +require('../../modules/es.number.max-safe-integer'); + +module.exports = 0x1FFFFFFFFFFFFF; diff --git a/core-js/es/number/min-safe-integer.js b/core-js/es/number/min-safe-integer.js new file mode 100644 index 0000000000..3678895ab7 --- /dev/null +++ b/core-js/es/number/min-safe-integer.js @@ -0,0 +1,3 @@ +require('../../modules/es.number.min-safe-integer'); + +module.exports = -0x1FFFFFFFFFFFFF; diff --git a/core-js/es/number/parse-float.js b/core-js/es/number/parse-float.js new file mode 100644 index 0000000000..5d71e39386 --- /dev/null +++ b/core-js/es/number/parse-float.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.parse-float'); +var path = require('../../internals/path'); + +module.exports = path.Number.parseFloat; diff --git a/core-js/es/number/parse-int.js b/core-js/es/number/parse-int.js new file mode 100644 index 0000000000..c833b0a1e2 --- /dev/null +++ b/core-js/es/number/parse-int.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.parse-int'); +var path = require('../../internals/path'); + +module.exports = path.Number.parseInt; diff --git a/core-js/es/number/to-fixed.js b/core-js/es/number/to-fixed.js new file mode 100644 index 0000000000..e1271248ad --- /dev/null +++ b/core-js/es/number/to-fixed.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.to-fixed'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Number', 'toFixed'); diff --git a/core-js/es/number/to-precision.js b/core-js/es/number/to-precision.js new file mode 100644 index 0000000000..fd5b83b228 --- /dev/null +++ b/core-js/es/number/to-precision.js @@ -0,0 +1,4 @@ +require('../../modules/es.number.to-precision'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Number', 'toPrecision'); diff --git a/core-js/es/number/virtual/index.js b/core-js/es/number/virtual/index.js new file mode 100644 index 0000000000..693aca9c65 --- /dev/null +++ b/core-js/es/number/virtual/index.js @@ -0,0 +1,5 @@ +require('../../../modules/es.number.to-fixed'); +require('../../../modules/es.number.to-precision'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Number'); diff --git a/core-js/es/number/virtual/to-fixed.js b/core-js/es/number/virtual/to-fixed.js new file mode 100644 index 0000000000..be7265d952 --- /dev/null +++ b/core-js/es/number/virtual/to-fixed.js @@ -0,0 +1,4 @@ +require('../../../modules/es.number.to-fixed'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Number').toFixed; diff --git a/core-js/es/number/virtual/to-precision.js b/core-js/es/number/virtual/to-precision.js new file mode 100644 index 0000000000..701c5aaef8 --- /dev/null +++ b/core-js/es/number/virtual/to-precision.js @@ -0,0 +1,4 @@ +require('../../../modules/es.number.to-precision'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('Number').toPrecision; diff --git a/core-js/es/object/assign.js b/core-js/es/object/assign.js new file mode 100644 index 0000000000..b747e5bb05 --- /dev/null +++ b/core-js/es/object/assign.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.assign'); +var path = require('../../internals/path'); + +module.exports = path.Object.assign; diff --git a/core-js/es/object/create.js b/core-js/es/object/create.js new file mode 100644 index 0000000000..6f060c9245 --- /dev/null +++ b/core-js/es/object/create.js @@ -0,0 +1,8 @@ +require('../../modules/es.object.create'); +var path = require('../../internals/path'); + +var Object = path.Object; + +module.exports = function create(P, D) { + return Object.create(P, D); +}; diff --git a/core-js/es/object/define-getter.js b/core-js/es/object/define-getter.js new file mode 100644 index 0000000000..98b77a0fa3 --- /dev/null +++ b/core-js/es/object/define-getter.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.define-getter'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Object', '__defineGetter__'); diff --git a/core-js/es/object/define-properties.js b/core-js/es/object/define-properties.js new file mode 100644 index 0000000000..30c21aa0a3 --- /dev/null +++ b/core-js/es/object/define-properties.js @@ -0,0 +1,10 @@ +require('../../modules/es.object.define-properties'); +var path = require('../../internals/path'); + +var Object = path.Object; + +var defineProperties = module.exports = function defineProperties(T, D) { + return Object.defineProperties(T, D); +}; + +if (Object.defineProperties.sham) defineProperties.sham = true; diff --git a/core-js/es/object/define-property.js b/core-js/es/object/define-property.js new file mode 100644 index 0000000000..eb51b5fad4 --- /dev/null +++ b/core-js/es/object/define-property.js @@ -0,0 +1,10 @@ +require('../../modules/es.object.define-property'); +var path = require('../../internals/path'); + +var Object = path.Object; + +var defineProperty = module.exports = function defineProperty(it, key, desc) { + return Object.defineProperty(it, key, desc); +}; + +if (Object.defineProperty.sham) defineProperty.sham = true; diff --git a/core-js/es/object/define-setter.js b/core-js/es/object/define-setter.js new file mode 100644 index 0000000000..ccae06a943 --- /dev/null +++ b/core-js/es/object/define-setter.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.define-setter'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Object', '__defineSetter__'); diff --git a/core-js/es/object/entries.js b/core-js/es/object/entries.js new file mode 100644 index 0000000000..4715ad119b --- /dev/null +++ b/core-js/es/object/entries.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.entries'); +var path = require('../../internals/path'); + +module.exports = path.Object.entries; diff --git a/core-js/es/object/freeze.js b/core-js/es/object/freeze.js new file mode 100644 index 0000000000..e50b82b57b --- /dev/null +++ b/core-js/es/object/freeze.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.freeze'); +var path = require('../../internals/path'); + +module.exports = path.Object.freeze; diff --git a/core-js/es/object/from-entries.js b/core-js/es/object/from-entries.js new file mode 100644 index 0000000000..530f16dab1 --- /dev/null +++ b/core-js/es/object/from-entries.js @@ -0,0 +1,5 @@ +require('../../modules/es.array.iterator'); +require('../../modules/es.object.from-entries'); +var path = require('../../internals/path'); + +module.exports = path.Object.fromEntries; diff --git a/core-js/es/object/get-own-property-descriptor.js b/core-js/es/object/get-own-property-descriptor.js new file mode 100644 index 0000000000..002c7ed03a --- /dev/null +++ b/core-js/es/object/get-own-property-descriptor.js @@ -0,0 +1,10 @@ +require('../../modules/es.object.get-own-property-descriptor'); +var path = require('../../internals/path'); + +var Object = path.Object; + +var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) { + return Object.getOwnPropertyDescriptor(it, key); +}; + +if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true; diff --git a/core-js/es/object/get-own-property-descriptors.js b/core-js/es/object/get-own-property-descriptors.js new file mode 100644 index 0000000000..e94ed62bfa --- /dev/null +++ b/core-js/es/object/get-own-property-descriptors.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.get-own-property-descriptors'); +var path = require('../../internals/path'); + +module.exports = path.Object.getOwnPropertyDescriptors; diff --git a/core-js/es/object/get-own-property-names.js b/core-js/es/object/get-own-property-names.js new file mode 100644 index 0000000000..4b353d3342 --- /dev/null +++ b/core-js/es/object/get-own-property-names.js @@ -0,0 +1,8 @@ +require('../../modules/es.object.get-own-property-names'); +var path = require('../../internals/path'); + +var Object = path.Object; + +module.exports = function getOwnPropertyNames(it) { + return Object.getOwnPropertyNames(it); +}; diff --git a/core-js/es/object/get-own-property-symbols.js b/core-js/es/object/get-own-property-symbols.js new file mode 100644 index 0000000000..b5c4b5b828 --- /dev/null +++ b/core-js/es/object/get-own-property-symbols.js @@ -0,0 +1,4 @@ +require('../../modules/es.symbol'); +var path = require('../../internals/path'); + +module.exports = path.Object.getOwnPropertySymbols; diff --git a/core-js/es/object/get-prototype-of.js b/core-js/es/object/get-prototype-of.js new file mode 100644 index 0000000000..6c7c96d830 --- /dev/null +++ b/core-js/es/object/get-prototype-of.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.get-prototype-of'); +var path = require('../../internals/path'); + +module.exports = path.Object.getPrototypeOf; diff --git a/core-js/es/object/index.js b/core-js/es/object/index.js new file mode 100644 index 0000000000..0664dfc23a --- /dev/null +++ b/core-js/es/object/index.js @@ -0,0 +1,31 @@ +require('../../modules/es.symbol'); +require('../../modules/es.object.assign'); +require('../../modules/es.object.create'); +require('../../modules/es.object.define-property'); +require('../../modules/es.object.define-properties'); +require('../../modules/es.object.entries'); +require('../../modules/es.object.freeze'); +require('../../modules/es.object.from-entries'); +require('../../modules/es.object.get-own-property-descriptor'); +require('../../modules/es.object.get-own-property-descriptors'); +require('../../modules/es.object.get-own-property-names'); +require('../../modules/es.object.get-prototype-of'); +require('../../modules/es.object.is'); +require('../../modules/es.object.is-extensible'); +require('../../modules/es.object.is-frozen'); +require('../../modules/es.object.is-sealed'); +require('../../modules/es.object.keys'); +require('../../modules/es.object.prevent-extensions'); +require('../../modules/es.object.seal'); +require('../../modules/es.object.set-prototype-of'); +require('../../modules/es.object.values'); +require('../../modules/es.object.to-string'); +require('../../modules/es.object.define-getter'); +require('../../modules/es.object.define-setter'); +require('../../modules/es.object.lookup-getter'); +require('../../modules/es.object.lookup-setter'); +require('../../modules/es.math.to-string-tag'); +require('../../modules/es.json.to-string-tag'); +var path = require('../../internals/path'); + +module.exports = path.Object; diff --git a/core-js/es/object/is-extensible.js b/core-js/es/object/is-extensible.js new file mode 100644 index 0000000000..c38f29124a --- /dev/null +++ b/core-js/es/object/is-extensible.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.is-extensible'); +var path = require('../../internals/path'); + +module.exports = path.Object.isExtensible; diff --git a/core-js/es/object/is-frozen.js b/core-js/es/object/is-frozen.js new file mode 100644 index 0000000000..39ee8d2e7d --- /dev/null +++ b/core-js/es/object/is-frozen.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.is-frozen'); +var path = require('../../internals/path'); + +module.exports = path.Object.isFrozen; diff --git a/core-js/es/object/is-sealed.js b/core-js/es/object/is-sealed.js new file mode 100644 index 0000000000..113a488f6b --- /dev/null +++ b/core-js/es/object/is-sealed.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.is-sealed'); +var path = require('../../internals/path'); + +module.exports = path.Object.isSealed; diff --git a/core-js/es/object/is.js b/core-js/es/object/is.js new file mode 100644 index 0000000000..5691bf9368 --- /dev/null +++ b/core-js/es/object/is.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.is'); +var path = require('../../internals/path'); + +module.exports = path.Object.is; diff --git a/core-js/es/object/keys.js b/core-js/es/object/keys.js new file mode 100644 index 0000000000..c42f42ecb5 --- /dev/null +++ b/core-js/es/object/keys.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.keys'); +var path = require('../../internals/path'); + +module.exports = path.Object.keys; diff --git a/core-js/es/object/lookup-getter.js b/core-js/es/object/lookup-getter.js new file mode 100644 index 0000000000..db2d70a65a --- /dev/null +++ b/core-js/es/object/lookup-getter.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.lookup-setter'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Object', '__lookupGetter__'); diff --git a/core-js/es/object/lookup-setter.js b/core-js/es/object/lookup-setter.js new file mode 100644 index 0000000000..fb48fbf40e --- /dev/null +++ b/core-js/es/object/lookup-setter.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.lookup-setter'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Object', '__lookupSetter__'); diff --git a/core-js/es/object/prevent-extensions.js b/core-js/es/object/prevent-extensions.js new file mode 100644 index 0000000000..5a4a5f61b2 --- /dev/null +++ b/core-js/es/object/prevent-extensions.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.prevent-extensions'); +var path = require('../../internals/path'); + +module.exports = path.Object.preventExtensions; diff --git a/core-js/es/object/seal.js b/core-js/es/object/seal.js new file mode 100644 index 0000000000..0db0262c43 --- /dev/null +++ b/core-js/es/object/seal.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.seal'); +var path = require('../../internals/path'); + +module.exports = path.Object.seal; diff --git a/core-js/es/object/set-prototype-of.js b/core-js/es/object/set-prototype-of.js new file mode 100644 index 0000000000..bab296ac48 --- /dev/null +++ b/core-js/es/object/set-prototype-of.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.set-prototype-of'); +var path = require('../../internals/path'); + +module.exports = path.Object.setPrototypeOf; diff --git a/core-js/es/object/to-string.js b/core-js/es/object/to-string.js new file mode 100644 index 0000000000..491a4ef03d --- /dev/null +++ b/core-js/es/object/to-string.js @@ -0,0 +1,8 @@ +require('../../modules/es.object.to-string'); +require('../../modules/es.math.to-string-tag'); +require('../../modules/es.json.to-string-tag'); +var classof = require('../../internals/classof'); + +module.exports = function (it) { + return '[object ' + classof(it) + ']'; +}; diff --git a/core-js/es/object/values.js b/core-js/es/object/values.js new file mode 100644 index 0000000000..84539f4a87 --- /dev/null +++ b/core-js/es/object/values.js @@ -0,0 +1,4 @@ +require('../../modules/es.object.values'); +var path = require('../../internals/path'); + +module.exports = path.Object.values; diff --git a/core-js/es/parse-float.js b/core-js/es/parse-float.js new file mode 100644 index 0000000000..3528d633e8 --- /dev/null +++ b/core-js/es/parse-float.js @@ -0,0 +1,4 @@ +require('../modules/es.parse-float'); +var path = require('../internals/path'); + +module.exports = path.parseFloat; diff --git a/core-js/es/parse-int.js b/core-js/es/parse-int.js new file mode 100644 index 0000000000..75cf1271ef --- /dev/null +++ b/core-js/es/parse-int.js @@ -0,0 +1,4 @@ +require('../modules/es.parse-int'); +var path = require('../internals/path'); + +module.exports = path.parseInt; diff --git a/core-js/es/promise/all-settled.js b/core-js/es/promise/all-settled.js new file mode 100644 index 0000000000..b05ac7eb79 --- /dev/null +++ b/core-js/es/promise/all-settled.js @@ -0,0 +1,11 @@ +'use strict'; +require('../../modules/es.promise'); +require('../../modules/es.promise.all-settled'); +var path = require('../../internals/path'); + +var Promise = path.Promise; +var $allSettled = Promise.allSettled; + +module.exports = function allSettled(iterable) { + return $allSettled.call(typeof this === 'function' ? this : Promise, iterable); +}; diff --git a/core-js/es/promise/finally.js b/core-js/es/promise/finally.js new file mode 100644 index 0000000000..01d4282f81 --- /dev/null +++ b/core-js/es/promise/finally.js @@ -0,0 +1,5 @@ +require('../../modules/es.promise'); +require('../../modules/es.promise.finally'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Promise', 'finally'); diff --git a/core-js/es/promise/index.js b/core-js/es/promise/index.js new file mode 100644 index 0000000000..2b41b45cb5 --- /dev/null +++ b/core-js/es/promise/index.js @@ -0,0 +1,9 @@ +require('../../modules/es.object.to-string'); +require('../../modules/es.string.iterator'); +require('../../modules/web.dom-collections.iterator'); +require('../../modules/es.promise'); +require('../../modules/es.promise.all-settled'); +require('../../modules/es.promise.finally'); +var path = require('../../internals/path'); + +module.exports = path.Promise; diff --git a/core-js/es/reflect/apply.js b/core-js/es/reflect/apply.js new file mode 100644 index 0000000000..0dbe1286d4 --- /dev/null +++ b/core-js/es/reflect/apply.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.apply'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.apply; diff --git a/core-js/es/reflect/construct.js b/core-js/es/reflect/construct.js new file mode 100644 index 0000000000..df90026903 --- /dev/null +++ b/core-js/es/reflect/construct.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.construct'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.construct; diff --git a/core-js/es/reflect/define-property.js b/core-js/es/reflect/define-property.js new file mode 100644 index 0000000000..7b33dcaf0d --- /dev/null +++ b/core-js/es/reflect/define-property.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.define-property'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.defineProperty; diff --git a/core-js/es/reflect/delete-property.js b/core-js/es/reflect/delete-property.js new file mode 100644 index 0000000000..0e023dfbbd --- /dev/null +++ b/core-js/es/reflect/delete-property.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.delete-property'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.deleteProperty; diff --git a/core-js/es/reflect/get-own-property-descriptor.js b/core-js/es/reflect/get-own-property-descriptor.js new file mode 100644 index 0000000000..8c135a3e66 --- /dev/null +++ b/core-js/es/reflect/get-own-property-descriptor.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.get-own-property-descriptor'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.getOwnPropertyDescriptor; diff --git a/core-js/es/reflect/get-prototype-of.js b/core-js/es/reflect/get-prototype-of.js new file mode 100644 index 0000000000..aca74f81ee --- /dev/null +++ b/core-js/es/reflect/get-prototype-of.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.get-prototype-of'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.getPrototypeOf; diff --git a/core-js/es/reflect/get.js b/core-js/es/reflect/get.js new file mode 100644 index 0000000000..239e931867 --- /dev/null +++ b/core-js/es/reflect/get.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.get'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.get; diff --git a/core-js/es/reflect/has.js b/core-js/es/reflect/has.js new file mode 100644 index 0000000000..0dbf29fa06 --- /dev/null +++ b/core-js/es/reflect/has.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.has'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.has; diff --git a/core-js/es/reflect/index.js b/core-js/es/reflect/index.js new file mode 100644 index 0000000000..6a82213c98 --- /dev/null +++ b/core-js/es/reflect/index.js @@ -0,0 +1,16 @@ +require('../../modules/es.reflect.apply'); +require('../../modules/es.reflect.construct'); +require('../../modules/es.reflect.define-property'); +require('../../modules/es.reflect.delete-property'); +require('../../modules/es.reflect.get'); +require('../../modules/es.reflect.get-own-property-descriptor'); +require('../../modules/es.reflect.get-prototype-of'); +require('../../modules/es.reflect.has'); +require('../../modules/es.reflect.is-extensible'); +require('../../modules/es.reflect.own-keys'); +require('../../modules/es.reflect.prevent-extensions'); +require('../../modules/es.reflect.set'); +require('../../modules/es.reflect.set-prototype-of'); +var path = require('../../internals/path'); + +module.exports = path.Reflect; diff --git a/core-js/es/reflect/is-extensible.js b/core-js/es/reflect/is-extensible.js new file mode 100644 index 0000000000..c0943d24ff --- /dev/null +++ b/core-js/es/reflect/is-extensible.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.is-extensible'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.isExtensible; diff --git a/core-js/es/reflect/own-keys.js b/core-js/es/reflect/own-keys.js new file mode 100644 index 0000000000..364fc81887 --- /dev/null +++ b/core-js/es/reflect/own-keys.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.own-keys'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.ownKeys; diff --git a/core-js/es/reflect/prevent-extensions.js b/core-js/es/reflect/prevent-extensions.js new file mode 100644 index 0000000000..8687c1b919 --- /dev/null +++ b/core-js/es/reflect/prevent-extensions.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.prevent-extensions'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.preventExtensions; diff --git a/core-js/es/reflect/set-prototype-of.js b/core-js/es/reflect/set-prototype-of.js new file mode 100644 index 0000000000..819148a558 --- /dev/null +++ b/core-js/es/reflect/set-prototype-of.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.set-prototype-of'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.setPrototypeOf; diff --git a/core-js/es/reflect/set.js b/core-js/es/reflect/set.js new file mode 100644 index 0000000000..25ed86c32c --- /dev/null +++ b/core-js/es/reflect/set.js @@ -0,0 +1,4 @@ +require('../../modules/es.reflect.set'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.set; diff --git a/core-js/es/regexp/constructor.js b/core-js/es/regexp/constructor.js new file mode 100644 index 0000000000..195da54ded --- /dev/null +++ b/core-js/es/regexp/constructor.js @@ -0,0 +1,3 @@ +require('../../modules/es.regexp.constructor'); + +module.exports = RegExp; diff --git a/core-js/es/regexp/flags.js b/core-js/es/regexp/flags.js new file mode 100644 index 0000000000..d3eed6d28c --- /dev/null +++ b/core-js/es/regexp/flags.js @@ -0,0 +1,6 @@ +require('../../modules/es.regexp.flags'); +var flags = require('../../internals/regexp-flags'); + +module.exports = function (it) { + return flags.call(it); +}; diff --git a/core-js/es/regexp/index.js b/core-js/es/regexp/index.js new file mode 100644 index 0000000000..69467e49e3 --- /dev/null +++ b/core-js/es/regexp/index.js @@ -0,0 +1,8 @@ +require('../../modules/es.regexp.constructor'); +require('../../modules/es.regexp.to-string'); +require('../../modules/es.regexp.exec'); +require('../../modules/es.regexp.flags'); +require('../../modules/es.string.match'); +require('../../modules/es.string.replace'); +require('../../modules/es.string.search'); +require('../../modules/es.string.split'); diff --git a/core-js/es/regexp/match.js b/core-js/es/regexp/match.js new file mode 100644 index 0000000000..af0e2fa6bc --- /dev/null +++ b/core-js/es/regexp/match.js @@ -0,0 +1,8 @@ +require('../../modules/es.string.match'); +var wellKnownSymbol = require('../../internals/well-known-symbol'); + +var MATCH = wellKnownSymbol('match'); + +module.exports = function (it, str) { + return RegExp.prototype[MATCH].call(it, str); +}; diff --git a/core-js/es/regexp/replace.js b/core-js/es/regexp/replace.js new file mode 100644 index 0000000000..1311b2a158 --- /dev/null +++ b/core-js/es/regexp/replace.js @@ -0,0 +1,8 @@ +require('../../modules/es.string.replace'); +var wellKnownSymbol = require('../../internals/well-known-symbol'); + +var REPLACE = wellKnownSymbol('replace'); + +module.exports = function (it, str, replacer) { + return RegExp.prototype[REPLACE].call(it, str, replacer); +}; diff --git a/core-js/es/regexp/search.js b/core-js/es/regexp/search.js new file mode 100644 index 0000000000..4adc913e4a --- /dev/null +++ b/core-js/es/regexp/search.js @@ -0,0 +1,8 @@ +require('../../modules/es.string.search'); +var wellKnownSymbol = require('../../internals/well-known-symbol'); + +var SEARCH = wellKnownSymbol('search'); + +module.exports = function (it, str) { + return RegExp.prototype[SEARCH].call(it, str); +}; diff --git a/core-js/es/regexp/split.js b/core-js/es/regexp/split.js new file mode 100644 index 0000000000..49ae5f2bcc --- /dev/null +++ b/core-js/es/regexp/split.js @@ -0,0 +1,8 @@ +require('../../modules/es.string.split'); +var wellKnownSymbol = require('../../internals/well-known-symbol'); + +var SPLIT = wellKnownSymbol('split'); + +module.exports = function (it, str, limit) { + return RegExp.prototype[SPLIT].call(it, str, limit); +}; diff --git a/core-js/es/regexp/to-string.js b/core-js/es/regexp/to-string.js new file mode 100644 index 0000000000..3072e63e89 --- /dev/null +++ b/core-js/es/regexp/to-string.js @@ -0,0 +1,5 @@ +require('../../modules/es.regexp.to-string'); + +module.exports = function toString(it) { + return RegExp.prototype.toString.call(it); +}; diff --git a/core-js/es/set/index.js b/core-js/es/set/index.js new file mode 100644 index 0000000000..52322b6915 --- /dev/null +++ b/core-js/es/set/index.js @@ -0,0 +1,7 @@ +require('../../modules/es.set'); +require('../../modules/es.object.to-string'); +require('../../modules/es.string.iterator'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +module.exports = path.Set; diff --git a/core-js/es/string/anchor.js b/core-js/es/string/anchor.js new file mode 100644 index 0000000000..254317e17b --- /dev/null +++ b/core-js/es/string/anchor.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.anchor'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'anchor'); diff --git a/core-js/es/string/big.js b/core-js/es/string/big.js new file mode 100644 index 0000000000..d0878eb617 --- /dev/null +++ b/core-js/es/string/big.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.big'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'big'); diff --git a/core-js/es/string/blink.js b/core-js/es/string/blink.js new file mode 100644 index 0000000000..fc96d57fba --- /dev/null +++ b/core-js/es/string/blink.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.blink'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'blink'); diff --git a/core-js/es/string/bold.js b/core-js/es/string/bold.js new file mode 100644 index 0000000000..f098a7ada9 --- /dev/null +++ b/core-js/es/string/bold.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.bold'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'bold'); diff --git a/core-js/es/string/code-point-at.js b/core-js/es/string/code-point-at.js new file mode 100644 index 0000000000..cbaaae36a2 --- /dev/null +++ b/core-js/es/string/code-point-at.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.code-point-at'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'codePointAt'); diff --git a/core-js/es/string/ends-with.js b/core-js/es/string/ends-with.js new file mode 100644 index 0000000000..26d7ffe5e3 --- /dev/null +++ b/core-js/es/string/ends-with.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.ends-with'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'endsWith'); diff --git a/core-js/es/string/fixed.js b/core-js/es/string/fixed.js new file mode 100644 index 0000000000..099ada47bd --- /dev/null +++ b/core-js/es/string/fixed.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.fixed'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'fixed'); diff --git a/core-js/es/string/fontcolor.js b/core-js/es/string/fontcolor.js new file mode 100644 index 0000000000..f3606f6030 --- /dev/null +++ b/core-js/es/string/fontcolor.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.fontcolor'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'fontcolor'); diff --git a/core-js/es/string/fontsize.js b/core-js/es/string/fontsize.js new file mode 100644 index 0000000000..499bfa5514 --- /dev/null +++ b/core-js/es/string/fontsize.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.fontsize'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'fontsize'); diff --git a/core-js/es/string/from-code-point.js b/core-js/es/string/from-code-point.js new file mode 100644 index 0000000000..1eff7642f6 --- /dev/null +++ b/core-js/es/string/from-code-point.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.from-code-point'); +var path = require('../../internals/path'); + +module.exports = path.String.fromCodePoint; diff --git a/core-js/es/string/includes.js b/core-js/es/string/includes.js new file mode 100644 index 0000000000..26d2ad9d3a --- /dev/null +++ b/core-js/es/string/includes.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.includes'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'includes'); diff --git a/core-js/es/string/index.js b/core-js/es/string/index.js new file mode 100644 index 0000000000..b843d33ff9 --- /dev/null +++ b/core-js/es/string/index.js @@ -0,0 +1,34 @@ +require('../../modules/es.string.from-code-point'); +require('../../modules/es.string.raw'); +require('../../modules/es.string.code-point-at'); +require('../../modules/es.string.ends-with'); +require('../../modules/es.string.includes'); +require('../../modules/es.string.match'); +require('../../modules/es.string.match-all'); +require('../../modules/es.string.pad-end'); +require('../../modules/es.string.pad-start'); +require('../../modules/es.string.repeat'); +require('../../modules/es.string.replace'); +require('../../modules/es.string.search'); +require('../../modules/es.string.split'); +require('../../modules/es.string.starts-with'); +require('../../modules/es.string.trim'); +require('../../modules/es.string.trim-start'); +require('../../modules/es.string.trim-end'); +require('../../modules/es.string.iterator'); +require('../../modules/es.string.anchor'); +require('../../modules/es.string.big'); +require('../../modules/es.string.blink'); +require('../../modules/es.string.bold'); +require('../../modules/es.string.fixed'); +require('../../modules/es.string.fontcolor'); +require('../../modules/es.string.fontsize'); +require('../../modules/es.string.italics'); +require('../../modules/es.string.link'); +require('../../modules/es.string.small'); +require('../../modules/es.string.strike'); +require('../../modules/es.string.sub'); +require('../../modules/es.string.sup'); +var path = require('../../internals/path'); + +module.exports = path.String; diff --git a/core-js/es/string/italics.js b/core-js/es/string/italics.js new file mode 100644 index 0000000000..6057f4fdac --- /dev/null +++ b/core-js/es/string/italics.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.italics'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'italics'); diff --git a/core-js/es/string/iterator.js b/core-js/es/string/iterator.js new file mode 100644 index 0000000000..b6d9a1a6dc --- /dev/null +++ b/core-js/es/string/iterator.js @@ -0,0 +1,8 @@ +require('../../modules/es.string.iterator'); +var Iterators = require('../../internals/iterators'); + +var getStringIterator = Iterators.String; + +module.exports = function (it) { + return getStringIterator.call(it); +}; diff --git a/core-js/es/string/link.js b/core-js/es/string/link.js new file mode 100644 index 0000000000..c195d61270 --- /dev/null +++ b/core-js/es/string/link.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.link'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'link'); diff --git a/core-js/es/string/match-all.js b/core-js/es/string/match-all.js new file mode 100644 index 0000000000..e951f4e494 --- /dev/null +++ b/core-js/es/string/match-all.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.match-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'matchAll'); diff --git a/core-js/es/string/match.js b/core-js/es/string/match.js new file mode 100644 index 0000000000..0a372374d7 --- /dev/null +++ b/core-js/es/string/match.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.match'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'match'); diff --git a/core-js/es/string/pad-end.js b/core-js/es/string/pad-end.js new file mode 100644 index 0000000000..237b96d1be --- /dev/null +++ b/core-js/es/string/pad-end.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.pad-end'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'padEnd'); diff --git a/core-js/es/string/pad-start.js b/core-js/es/string/pad-start.js new file mode 100644 index 0000000000..250496f1ff --- /dev/null +++ b/core-js/es/string/pad-start.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.pad-start'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'padStart'); diff --git a/core-js/es/string/raw.js b/core-js/es/string/raw.js new file mode 100644 index 0000000000..e75c54c0f3 --- /dev/null +++ b/core-js/es/string/raw.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.raw'); +var path = require('../../internals/path'); + +module.exports = path.String.raw; diff --git a/core-js/es/string/repeat.js b/core-js/es/string/repeat.js new file mode 100644 index 0000000000..bd6992bd01 --- /dev/null +++ b/core-js/es/string/repeat.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.repeat'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'repeat'); diff --git a/core-js/es/string/replace.js b/core-js/es/string/replace.js new file mode 100644 index 0000000000..0ac4e6a1a3 --- /dev/null +++ b/core-js/es/string/replace.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.replace'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'replace'); diff --git a/core-js/es/string/search.js b/core-js/es/string/search.js new file mode 100644 index 0000000000..c2ed44a696 --- /dev/null +++ b/core-js/es/string/search.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.search'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'search'); diff --git a/core-js/es/string/small.js b/core-js/es/string/small.js new file mode 100644 index 0000000000..4e8780f60e --- /dev/null +++ b/core-js/es/string/small.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.small'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'small'); diff --git a/core-js/es/string/split.js b/core-js/es/string/split.js new file mode 100644 index 0000000000..0651c055f6 --- /dev/null +++ b/core-js/es/string/split.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.split'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'split'); diff --git a/core-js/es/string/starts-with.js b/core-js/es/string/starts-with.js new file mode 100644 index 0000000000..2b22eba167 --- /dev/null +++ b/core-js/es/string/starts-with.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.starts-with'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'startsWith'); diff --git a/core-js/es/string/strike.js b/core-js/es/string/strike.js new file mode 100644 index 0000000000..f986f9e482 --- /dev/null +++ b/core-js/es/string/strike.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.strike'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'strike'); diff --git a/core-js/es/string/sub.js b/core-js/es/string/sub.js new file mode 100644 index 0000000000..19c6c384d2 --- /dev/null +++ b/core-js/es/string/sub.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.sub'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'sub'); diff --git a/core-js/es/string/sup.js b/core-js/es/string/sup.js new file mode 100644 index 0000000000..419785d983 --- /dev/null +++ b/core-js/es/string/sup.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.sup'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'sup'); diff --git a/core-js/es/string/trim-end.js b/core-js/es/string/trim-end.js new file mode 100644 index 0000000000..43042987e3 --- /dev/null +++ b/core-js/es/string/trim-end.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.trim-end'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'trimRight'); diff --git a/core-js/es/string/trim-left.js b/core-js/es/string/trim-left.js new file mode 100644 index 0000000000..a24dcdec33 --- /dev/null +++ b/core-js/es/string/trim-left.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.trim-start'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'trimLeft'); diff --git a/core-js/es/string/trim-right.js b/core-js/es/string/trim-right.js new file mode 100644 index 0000000000..43042987e3 --- /dev/null +++ b/core-js/es/string/trim-right.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.trim-end'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'trimRight'); diff --git a/core-js/es/string/trim-start.js b/core-js/es/string/trim-start.js new file mode 100644 index 0000000000..a24dcdec33 --- /dev/null +++ b/core-js/es/string/trim-start.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.trim-start'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'trimLeft'); diff --git a/core-js/es/string/trim.js b/core-js/es/string/trim.js new file mode 100644 index 0000000000..0fca933129 --- /dev/null +++ b/core-js/es/string/trim.js @@ -0,0 +1,4 @@ +require('../../modules/es.string.trim'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'trim'); diff --git a/core-js/es/string/virtual/anchor.js b/core-js/es/string/virtual/anchor.js new file mode 100644 index 0000000000..3b5cf6b650 --- /dev/null +++ b/core-js/es/string/virtual/anchor.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.anchor'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').anchor; diff --git a/core-js/es/string/virtual/big.js b/core-js/es/string/virtual/big.js new file mode 100644 index 0000000000..a63bd0fbff --- /dev/null +++ b/core-js/es/string/virtual/big.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.big'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').big; diff --git a/core-js/es/string/virtual/blink.js b/core-js/es/string/virtual/blink.js new file mode 100644 index 0000000000..8619c25b43 --- /dev/null +++ b/core-js/es/string/virtual/blink.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.blink'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').blink; diff --git a/core-js/es/string/virtual/bold.js b/core-js/es/string/virtual/bold.js new file mode 100644 index 0000000000..1f5419a42f --- /dev/null +++ b/core-js/es/string/virtual/bold.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.bold'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').bold; diff --git a/core-js/es/string/virtual/code-point-at.js b/core-js/es/string/virtual/code-point-at.js new file mode 100644 index 0000000000..c12691d980 --- /dev/null +++ b/core-js/es/string/virtual/code-point-at.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.code-point-at'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').codePointAt; diff --git a/core-js/es/string/virtual/ends-with.js b/core-js/es/string/virtual/ends-with.js new file mode 100644 index 0000000000..81a13221ee --- /dev/null +++ b/core-js/es/string/virtual/ends-with.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.ends-with'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').endsWith; diff --git a/core-js/es/string/virtual/fixed.js b/core-js/es/string/virtual/fixed.js new file mode 100644 index 0000000000..b3b775f002 --- /dev/null +++ b/core-js/es/string/virtual/fixed.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.fixed'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').fixed; diff --git a/core-js/es/string/virtual/fontcolor.js b/core-js/es/string/virtual/fontcolor.js new file mode 100644 index 0000000000..5b89a227b7 --- /dev/null +++ b/core-js/es/string/virtual/fontcolor.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.fontcolor'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').fontcolor; diff --git a/core-js/es/string/virtual/fontsize.js b/core-js/es/string/virtual/fontsize.js new file mode 100644 index 0000000000..28491b0d68 --- /dev/null +++ b/core-js/es/string/virtual/fontsize.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.fontsize'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').fontsize; diff --git a/core-js/es/string/virtual/includes.js b/core-js/es/string/virtual/includes.js new file mode 100644 index 0000000000..e6d9fabb3b --- /dev/null +++ b/core-js/es/string/virtual/includes.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.includes'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').includes; diff --git a/core-js/es/string/virtual/index.js b/core-js/es/string/virtual/index.js new file mode 100644 index 0000000000..1151b79834 --- /dev/null +++ b/core-js/es/string/virtual/index.js @@ -0,0 +1,32 @@ +require('../../../modules/es.string.code-point-at'); +require('../../../modules/es.string.ends-with'); +require('../../../modules/es.string.includes'); +require('../../../modules/es.string.match'); +require('../../../modules/es.string.match-all'); +require('../../../modules/es.string.pad-end'); +require('../../../modules/es.string.pad-start'); +require('../../../modules/es.string.repeat'); +require('../../../modules/es.string.replace'); +require('../../../modules/es.string.search'); +require('../../../modules/es.string.split'); +require('../../../modules/es.string.starts-with'); +require('../../../modules/es.string.trim'); +require('../../../modules/es.string.trim-start'); +require('../../../modules/es.string.trim-end'); +require('../../../modules/es.string.iterator'); +require('../../../modules/es.string.anchor'); +require('../../../modules/es.string.big'); +require('../../../modules/es.string.blink'); +require('../../../modules/es.string.bold'); +require('../../../modules/es.string.fixed'); +require('../../../modules/es.string.fontcolor'); +require('../../../modules/es.string.fontsize'); +require('../../../modules/es.string.italics'); +require('../../../modules/es.string.link'); +require('../../../modules/es.string.small'); +require('../../../modules/es.string.strike'); +require('../../../modules/es.string.sub'); +require('../../../modules/es.string.sup'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String'); diff --git a/core-js/es/string/virtual/italics.js b/core-js/es/string/virtual/italics.js new file mode 100644 index 0000000000..c6cf80b859 --- /dev/null +++ b/core-js/es/string/virtual/italics.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.italics'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').italics; diff --git a/core-js/es/string/virtual/iterator.js b/core-js/es/string/virtual/iterator.js new file mode 100644 index 0000000000..df1e2aaaa2 --- /dev/null +++ b/core-js/es/string/virtual/iterator.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.iterator'); +var Iterators = require('../../../internals/iterators'); + +module.exports = Iterators.String; diff --git a/core-js/es/string/virtual/link.js b/core-js/es/string/virtual/link.js new file mode 100644 index 0000000000..d387e1686a --- /dev/null +++ b/core-js/es/string/virtual/link.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.link'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').link; diff --git a/core-js/es/string/virtual/match-all.js b/core-js/es/string/virtual/match-all.js new file mode 100644 index 0000000000..6bad2f8f65 --- /dev/null +++ b/core-js/es/string/virtual/match-all.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.match-all'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').matchAll; diff --git a/core-js/es/string/virtual/pad-end.js b/core-js/es/string/virtual/pad-end.js new file mode 100644 index 0000000000..a7d54de4c1 --- /dev/null +++ b/core-js/es/string/virtual/pad-end.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.pad-end'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').padEnd; diff --git a/core-js/es/string/virtual/pad-start.js b/core-js/es/string/virtual/pad-start.js new file mode 100644 index 0000000000..7695cb2f35 --- /dev/null +++ b/core-js/es/string/virtual/pad-start.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.pad-start'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').padStart; diff --git a/core-js/es/string/virtual/repeat.js b/core-js/es/string/virtual/repeat.js new file mode 100644 index 0000000000..dab88b5732 --- /dev/null +++ b/core-js/es/string/virtual/repeat.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.repeat'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').repeat; diff --git a/core-js/es/string/virtual/small.js b/core-js/es/string/virtual/small.js new file mode 100644 index 0000000000..e9352a8da9 --- /dev/null +++ b/core-js/es/string/virtual/small.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.small'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').small; diff --git a/core-js/es/string/virtual/starts-with.js b/core-js/es/string/virtual/starts-with.js new file mode 100644 index 0000000000..917071b924 --- /dev/null +++ b/core-js/es/string/virtual/starts-with.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.starts-with'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').startsWith; diff --git a/core-js/es/string/virtual/strike.js b/core-js/es/string/virtual/strike.js new file mode 100644 index 0000000000..971a1293a0 --- /dev/null +++ b/core-js/es/string/virtual/strike.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.strike'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').strike; diff --git a/core-js/es/string/virtual/sub.js b/core-js/es/string/virtual/sub.js new file mode 100644 index 0000000000..0514fb8bed --- /dev/null +++ b/core-js/es/string/virtual/sub.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.sub'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').sub; diff --git a/core-js/es/string/virtual/sup.js b/core-js/es/string/virtual/sup.js new file mode 100644 index 0000000000..61debf3094 --- /dev/null +++ b/core-js/es/string/virtual/sup.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.sup'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').sup; diff --git a/core-js/es/string/virtual/trim-end.js b/core-js/es/string/virtual/trim-end.js new file mode 100644 index 0000000000..9c1d0c0312 --- /dev/null +++ b/core-js/es/string/virtual/trim-end.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.trim-end'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').trimRight; diff --git a/core-js/es/string/virtual/trim-left.js b/core-js/es/string/virtual/trim-left.js new file mode 100644 index 0000000000..17cfc12dbf --- /dev/null +++ b/core-js/es/string/virtual/trim-left.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.trim-start'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').trimLeft; diff --git a/core-js/es/string/virtual/trim-right.js b/core-js/es/string/virtual/trim-right.js new file mode 100644 index 0000000000..9c1d0c0312 --- /dev/null +++ b/core-js/es/string/virtual/trim-right.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.trim-end'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').trimRight; diff --git a/core-js/es/string/virtual/trim-start.js b/core-js/es/string/virtual/trim-start.js new file mode 100644 index 0000000000..17cfc12dbf --- /dev/null +++ b/core-js/es/string/virtual/trim-start.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.trim-start'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').trimLeft; diff --git a/core-js/es/string/virtual/trim.js b/core-js/es/string/virtual/trim.js new file mode 100644 index 0000000000..6d7b41d6a2 --- /dev/null +++ b/core-js/es/string/virtual/trim.js @@ -0,0 +1,4 @@ +require('../../../modules/es.string.trim'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').trim; diff --git a/core-js/es/symbol/async-iterator.js b/core-js/es/symbol/async-iterator.js new file mode 100644 index 0000000000..6f5dd5d5ed --- /dev/null +++ b/core-js/es/symbol/async-iterator.js @@ -0,0 +1,4 @@ +require('../../modules/es.symbol.async-iterator'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('asyncIterator'); diff --git a/core-js/es/symbol/description.js b/core-js/es/symbol/description.js new file mode 100644 index 0000000000..7bb4b2bc9c --- /dev/null +++ b/core-js/es/symbol/description.js @@ -0,0 +1 @@ +require('../../modules/es.symbol.description'); diff --git a/core-js/es/symbol/for.js b/core-js/es/symbol/for.js new file mode 100644 index 0000000000..9406c70e1b --- /dev/null +++ b/core-js/es/symbol/for.js @@ -0,0 +1,4 @@ +require('../../modules/es.symbol'); +var path = require('../../internals/path'); + +module.exports = path.Symbol['for']; diff --git a/core-js/es/symbol/has-instance.js b/core-js/es/symbol/has-instance.js new file mode 100644 index 0000000000..8fbd177224 --- /dev/null +++ b/core-js/es/symbol/has-instance.js @@ -0,0 +1,5 @@ +require('../../modules/es.symbol.has-instance'); +require('../../modules/es.function.has-instance'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('hasInstance'); diff --git a/core-js/es/symbol/index.js b/core-js/es/symbol/index.js new file mode 100644 index 0000000000..4d6acf4182 --- /dev/null +++ b/core-js/es/symbol/index.js @@ -0,0 +1,22 @@ +require('../../modules/es.array.concat'); +require('../../modules/es.object.to-string'); +require('../../modules/es.symbol'); +require('../../modules/es.symbol.async-iterator'); +require('../../modules/es.symbol.description'); +require('../../modules/es.symbol.has-instance'); +require('../../modules/es.symbol.is-concat-spreadable'); +require('../../modules/es.symbol.iterator'); +require('../../modules/es.symbol.match'); +require('../../modules/es.symbol.match-all'); +require('../../modules/es.symbol.replace'); +require('../../modules/es.symbol.search'); +require('../../modules/es.symbol.species'); +require('../../modules/es.symbol.split'); +require('../../modules/es.symbol.to-primitive'); +require('../../modules/es.symbol.to-string-tag'); +require('../../modules/es.symbol.unscopables'); +require('../../modules/es.math.to-string-tag'); +require('../../modules/es.json.to-string-tag'); +var path = require('../../internals/path'); + +module.exports = path.Symbol; diff --git a/core-js/es/symbol/is-concat-spreadable.js b/core-js/es/symbol/is-concat-spreadable.js new file mode 100644 index 0000000000..860123c01c --- /dev/null +++ b/core-js/es/symbol/is-concat-spreadable.js @@ -0,0 +1,5 @@ +require('../../modules/es.symbol.is-concat-spreadable'); +require('../../modules/es.array.concat'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('isConcatSpreadable'); diff --git a/core-js/es/symbol/iterator.js b/core-js/es/symbol/iterator.js new file mode 100644 index 0000000000..b8398936f4 --- /dev/null +++ b/core-js/es/symbol/iterator.js @@ -0,0 +1,6 @@ +require('../../modules/es.symbol.iterator'); +require('../../modules/es.string.iterator'); +require('../../modules/web.dom-collections.iterator'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('iterator'); diff --git a/core-js/es/symbol/key-for.js b/core-js/es/symbol/key-for.js new file mode 100644 index 0000000000..6c832b9266 --- /dev/null +++ b/core-js/es/symbol/key-for.js @@ -0,0 +1,4 @@ +require('../../modules/es.symbol'); +var path = require('../../internals/path'); + +module.exports = path.Symbol.keyFor; diff --git a/core-js/es/symbol/match-all.js b/core-js/es/symbol/match-all.js new file mode 100644 index 0000000000..dd1c243863 --- /dev/null +++ b/core-js/es/symbol/match-all.js @@ -0,0 +1,5 @@ +require('../../modules/es.symbol.match-all'); +require('../../modules/es.string.match-all'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('matchAll'); diff --git a/core-js/es/symbol/match.js b/core-js/es/symbol/match.js new file mode 100644 index 0000000000..de607a86ec --- /dev/null +++ b/core-js/es/symbol/match.js @@ -0,0 +1,5 @@ +require('../../modules/es.symbol.match'); +require('../../modules/es.string.match'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('match'); diff --git a/core-js/es/symbol/replace.js b/core-js/es/symbol/replace.js new file mode 100644 index 0000000000..95ad78cedd --- /dev/null +++ b/core-js/es/symbol/replace.js @@ -0,0 +1,5 @@ +require('../../modules/es.symbol.replace'); +require('../../modules/es.string.replace'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('replace'); diff --git a/core-js/es/symbol/search.js b/core-js/es/symbol/search.js new file mode 100644 index 0000000000..1717f1ca69 --- /dev/null +++ b/core-js/es/symbol/search.js @@ -0,0 +1,5 @@ +require('../../modules/es.symbol.search'); +require('../../modules/es.string.search'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('search'); diff --git a/core-js/es/symbol/species.js b/core-js/es/symbol/species.js new file mode 100644 index 0000000000..3139bc6b7b --- /dev/null +++ b/core-js/es/symbol/species.js @@ -0,0 +1,4 @@ +require('../../modules/es.symbol.species'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('species'); diff --git a/core-js/es/symbol/split.js b/core-js/es/symbol/split.js new file mode 100644 index 0000000000..3045f77123 --- /dev/null +++ b/core-js/es/symbol/split.js @@ -0,0 +1,5 @@ +require('../../modules/es.symbol.split'); +require('../../modules/es.string.split'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('split'); diff --git a/core-js/es/symbol/to-primitive.js b/core-js/es/symbol/to-primitive.js new file mode 100644 index 0000000000..655270f086 --- /dev/null +++ b/core-js/es/symbol/to-primitive.js @@ -0,0 +1,4 @@ +require('../../modules/es.symbol.to-primitive'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('toPrimitive'); diff --git a/core-js/es/symbol/to-string-tag.js b/core-js/es/symbol/to-string-tag.js new file mode 100644 index 0000000000..6f29062ffc --- /dev/null +++ b/core-js/es/symbol/to-string-tag.js @@ -0,0 +1,7 @@ +require('../../modules/es.symbol.to-string-tag'); +require('../../modules/es.object.to-string'); +require('../../modules/es.math.to-string-tag'); +require('../../modules/es.json.to-string-tag'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('toStringTag'); diff --git a/core-js/es/symbol/unscopables.js b/core-js/es/symbol/unscopables.js new file mode 100644 index 0000000000..cc6f5eb979 --- /dev/null +++ b/core-js/es/symbol/unscopables.js @@ -0,0 +1,4 @@ +require('../../modules/es.symbol.unscopables'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('unscopables'); diff --git a/core-js/es/typed-array/copy-within.js b/core-js/es/typed-array/copy-within.js new file mode 100644 index 0000000000..1352cec72f --- /dev/null +++ b/core-js/es/typed-array/copy-within.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.copy-within'); diff --git a/core-js/es/typed-array/entries.js b/core-js/es/typed-array/entries.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/es/typed-array/entries.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/es/typed-array/every.js b/core-js/es/typed-array/every.js new file mode 100644 index 0000000000..681164be00 --- /dev/null +++ b/core-js/es/typed-array/every.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.every'); diff --git a/core-js/es/typed-array/fill.js b/core-js/es/typed-array/fill.js new file mode 100644 index 0000000000..4d92ac6654 --- /dev/null +++ b/core-js/es/typed-array/fill.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.fill'); diff --git a/core-js/es/typed-array/filter.js b/core-js/es/typed-array/filter.js new file mode 100644 index 0000000000..7d0a630ffa --- /dev/null +++ b/core-js/es/typed-array/filter.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.filter'); diff --git a/core-js/es/typed-array/find-index.js b/core-js/es/typed-array/find-index.js new file mode 100644 index 0000000000..039cd5edde --- /dev/null +++ b/core-js/es/typed-array/find-index.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.find-index'); diff --git a/core-js/es/typed-array/find.js b/core-js/es/typed-array/find.js new file mode 100644 index 0000000000..b3251b9a04 --- /dev/null +++ b/core-js/es/typed-array/find.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.find'); diff --git a/core-js/es/typed-array/float32-array.js b/core-js/es/typed-array/float32-array.js new file mode 100644 index 0000000000..70d1f810fe --- /dev/null +++ b/core-js/es/typed-array/float32-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.float32-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Float32Array; diff --git a/core-js/es/typed-array/float64-array.js b/core-js/es/typed-array/float64-array.js new file mode 100644 index 0000000000..b84eae0a9c --- /dev/null +++ b/core-js/es/typed-array/float64-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.float64-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Float64Array; diff --git a/core-js/es/typed-array/for-each.js b/core-js/es/typed-array/for-each.js new file mode 100644 index 0000000000..defe03a8dc --- /dev/null +++ b/core-js/es/typed-array/for-each.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.for-each'); diff --git a/core-js/es/typed-array/from.js b/core-js/es/typed-array/from.js new file mode 100644 index 0000000000..e0f34441d1 --- /dev/null +++ b/core-js/es/typed-array/from.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.from'); diff --git a/core-js/es/typed-array/includes.js b/core-js/es/typed-array/includes.js new file mode 100644 index 0000000000..5ff65f9645 --- /dev/null +++ b/core-js/es/typed-array/includes.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.includes'); diff --git a/core-js/es/typed-array/index-of.js b/core-js/es/typed-array/index-of.js new file mode 100644 index 0000000000..87081c0f2b --- /dev/null +++ b/core-js/es/typed-array/index-of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.index-of'); diff --git a/core-js/es/typed-array/index.js b/core-js/es/typed-array/index.js new file mode 100644 index 0000000000..4605b35beb --- /dev/null +++ b/core-js/es/typed-array/index.js @@ -0,0 +1,12 @@ +require('../../modules/es.typed-array.int8-array'); +require('../../modules/es.typed-array.uint8-array'); +require('../../modules/es.typed-array.uint8-clamped-array'); +require('../../modules/es.typed-array.int16-array'); +require('../../modules/es.typed-array.uint16-array'); +require('../../modules/es.typed-array.int32-array'); +require('../../modules/es.typed-array.uint32-array'); +require('../../modules/es.typed-array.float32-array'); +require('../../modules/es.typed-array.float64-array'); +require('./methods'); + +module.exports = require('../../internals/global'); diff --git a/core-js/es/typed-array/int16-array.js b/core-js/es/typed-array/int16-array.js new file mode 100644 index 0000000000..81f5a8e5d0 --- /dev/null +++ b/core-js/es/typed-array/int16-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.int16-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Int16Array; diff --git a/core-js/es/typed-array/int32-array.js b/core-js/es/typed-array/int32-array.js new file mode 100644 index 0000000000..48176bf56a --- /dev/null +++ b/core-js/es/typed-array/int32-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.int32-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Int32Array; diff --git a/core-js/es/typed-array/int8-array.js b/core-js/es/typed-array/int8-array.js new file mode 100644 index 0000000000..7d53845a78 --- /dev/null +++ b/core-js/es/typed-array/int8-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.int8-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Int8Array; diff --git a/core-js/es/typed-array/iterator.js b/core-js/es/typed-array/iterator.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/es/typed-array/iterator.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/es/typed-array/join.js b/core-js/es/typed-array/join.js new file mode 100644 index 0000000000..431129c92f --- /dev/null +++ b/core-js/es/typed-array/join.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.join'); diff --git a/core-js/es/typed-array/keys.js b/core-js/es/typed-array/keys.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/es/typed-array/keys.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/es/typed-array/last-index-of.js b/core-js/es/typed-array/last-index-of.js new file mode 100644 index 0000000000..5682bf44ea --- /dev/null +++ b/core-js/es/typed-array/last-index-of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.last-index-of'); diff --git a/core-js/es/typed-array/map.js b/core-js/es/typed-array/map.js new file mode 100644 index 0000000000..db08fed371 --- /dev/null +++ b/core-js/es/typed-array/map.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.map'); diff --git a/core-js/es/typed-array/methods.js b/core-js/es/typed-array/methods.js new file mode 100644 index 0000000000..4c6ee887fa --- /dev/null +++ b/core-js/es/typed-array/methods.js @@ -0,0 +1,26 @@ +require('../../modules/es.typed-array.from'); +require('../../modules/es.typed-array.of'); +require('../../modules/es.typed-array.copy-within'); +require('../../modules/es.typed-array.every'); +require('../../modules/es.typed-array.fill'); +require('../../modules/es.typed-array.filter'); +require('../../modules/es.typed-array.find'); +require('../../modules/es.typed-array.find-index'); +require('../../modules/es.typed-array.for-each'); +require('../../modules/es.typed-array.includes'); +require('../../modules/es.typed-array.index-of'); +require('../../modules/es.typed-array.join'); +require('../../modules/es.typed-array.last-index-of'); +require('../../modules/es.typed-array.map'); +require('../../modules/es.typed-array.reduce'); +require('../../modules/es.typed-array.reduce-right'); +require('../../modules/es.typed-array.reverse'); +require('../../modules/es.typed-array.set'); +require('../../modules/es.typed-array.slice'); +require('../../modules/es.typed-array.some'); +require('../../modules/es.typed-array.sort'); +require('../../modules/es.typed-array.subarray'); +require('../../modules/es.typed-array.to-locale-string'); +require('../../modules/es.typed-array.to-string'); +require('../../modules/es.typed-array.iterator'); +require('../../modules/es.object.to-string'); diff --git a/core-js/es/typed-array/of.js b/core-js/es/typed-array/of.js new file mode 100644 index 0000000000..121bf5e2d6 --- /dev/null +++ b/core-js/es/typed-array/of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.of'); diff --git a/core-js/es/typed-array/reduce-right.js b/core-js/es/typed-array/reduce-right.js new file mode 100644 index 0000000000..cbd321fc62 --- /dev/null +++ b/core-js/es/typed-array/reduce-right.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reduce-right'); diff --git a/core-js/es/typed-array/reduce.js b/core-js/es/typed-array/reduce.js new file mode 100644 index 0000000000..e2a6f28283 --- /dev/null +++ b/core-js/es/typed-array/reduce.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reduce'); diff --git a/core-js/es/typed-array/reverse.js b/core-js/es/typed-array/reverse.js new file mode 100644 index 0000000000..14995f497b --- /dev/null +++ b/core-js/es/typed-array/reverse.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reverse'); diff --git a/core-js/es/typed-array/set.js b/core-js/es/typed-array/set.js new file mode 100644 index 0000000000..5330e22983 --- /dev/null +++ b/core-js/es/typed-array/set.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.set'); diff --git a/core-js/es/typed-array/slice.js b/core-js/es/typed-array/slice.js new file mode 100644 index 0000000000..37fb8c141a --- /dev/null +++ b/core-js/es/typed-array/slice.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.slice'); diff --git a/core-js/es/typed-array/some.js b/core-js/es/typed-array/some.js new file mode 100644 index 0000000000..495c322f7d --- /dev/null +++ b/core-js/es/typed-array/some.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.some'); diff --git a/core-js/es/typed-array/sort.js b/core-js/es/typed-array/sort.js new file mode 100644 index 0000000000..d6c7e30b99 --- /dev/null +++ b/core-js/es/typed-array/sort.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.sort'); diff --git a/core-js/es/typed-array/subarray.js b/core-js/es/typed-array/subarray.js new file mode 100644 index 0000000000..dbad4ca2d6 --- /dev/null +++ b/core-js/es/typed-array/subarray.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.subarray'); diff --git a/core-js/es/typed-array/to-locale-string.js b/core-js/es/typed-array/to-locale-string.js new file mode 100644 index 0000000000..12c809e233 --- /dev/null +++ b/core-js/es/typed-array/to-locale-string.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.to-locale-string'); diff --git a/core-js/es/typed-array/to-string.js b/core-js/es/typed-array/to-string.js new file mode 100644 index 0000000000..bf9416079f --- /dev/null +++ b/core-js/es/typed-array/to-string.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.to-string'); diff --git a/core-js/es/typed-array/uint16-array.js b/core-js/es/typed-array/uint16-array.js new file mode 100644 index 0000000000..9fe6065e50 --- /dev/null +++ b/core-js/es/typed-array/uint16-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.uint16-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Uint16Array; diff --git a/core-js/es/typed-array/uint32-array.js b/core-js/es/typed-array/uint32-array.js new file mode 100644 index 0000000000..26bdb10c22 --- /dev/null +++ b/core-js/es/typed-array/uint32-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.uint32-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Uint32Array; diff --git a/core-js/es/typed-array/uint8-array.js b/core-js/es/typed-array/uint8-array.js new file mode 100644 index 0000000000..96a5bf12f9 --- /dev/null +++ b/core-js/es/typed-array/uint8-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.uint8-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Uint8Array; diff --git a/core-js/es/typed-array/uint8-clamped-array.js b/core-js/es/typed-array/uint8-clamped-array.js new file mode 100644 index 0000000000..7e2d3ce703 --- /dev/null +++ b/core-js/es/typed-array/uint8-clamped-array.js @@ -0,0 +1,5 @@ +require('../../modules/es.typed-array.uint8-clamped-array'); +require('./methods'); +var global = require('../../internals/global'); + +module.exports = global.Uint8ClampedArray; diff --git a/core-js/es/typed-array/values.js b/core-js/es/typed-array/values.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/es/typed-array/values.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/es/weak-map/index.js b/core-js/es/weak-map/index.js new file mode 100644 index 0000000000..11c79a7b14 --- /dev/null +++ b/core-js/es/weak-map/index.js @@ -0,0 +1,6 @@ +require('../../modules/es.object.to-string'); +require('../../modules/es.weak-map'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +module.exports = path.WeakMap; diff --git a/core-js/es/weak-set/index.js b/core-js/es/weak-set/index.js new file mode 100644 index 0000000000..ca5f257d49 --- /dev/null +++ b/core-js/es/weak-set/index.js @@ -0,0 +1,6 @@ +require('../../modules/es.object.to-string'); +require('../../modules/es.weak-set'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +module.exports = path.WeakSet; diff --git a/core-js/features/README.md b/core-js/features/README.md new file mode 100644 index 0000000000..62c88a0ddf --- /dev/null +++ b/core-js/features/README.md @@ -0,0 +1 @@ +This folder contains entry points for all `core-js` features with dependencies. It's the recommended way for usage only required features. diff --git a/core-js/features/aggregate-error.js b/core-js/features/aggregate-error.js new file mode 100644 index 0000000000..65d8afd3f3 --- /dev/null +++ b/core-js/features/aggregate-error.js @@ -0,0 +1,6 @@ +require('../modules/web.dom-collections.iterator'); +require('../modules/es.string.iterator'); +require('../modules/esnext.aggregate-error'); +var path = require('../internals/path'); + +module.exports = path.AggregateError; diff --git a/core-js/features/array-buffer/constructor.js b/core-js/features/array-buffer/constructor.js new file mode 100644 index 0000000000..726f87038f --- /dev/null +++ b/core-js/features/array-buffer/constructor.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer/constructor'); diff --git a/core-js/features/array-buffer/index.js b/core-js/features/array-buffer/index.js new file mode 100644 index 0000000000..80b721e901 --- /dev/null +++ b/core-js/features/array-buffer/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer'); diff --git a/core-js/features/array-buffer/is-view.js b/core-js/features/array-buffer/is-view.js new file mode 100644 index 0000000000..7fe0ee7702 --- /dev/null +++ b/core-js/features/array-buffer/is-view.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer/is-view'); diff --git a/core-js/features/array-buffer/slice.js b/core-js/features/array-buffer/slice.js new file mode 100644 index 0000000000..237d3b4d68 --- /dev/null +++ b/core-js/features/array-buffer/slice.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer/slice'); diff --git a/core-js/features/array/concat.js b/core-js/features/array/concat.js new file mode 100644 index 0000000000..09185fea44 --- /dev/null +++ b/core-js/features/array/concat.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/concat'); diff --git a/core-js/features/array/copy-within.js b/core-js/features/array/copy-within.js new file mode 100644 index 0000000000..171ea9bab9 --- /dev/null +++ b/core-js/features/array/copy-within.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/copy-within'); diff --git a/core-js/features/array/entries.js b/core-js/features/array/entries.js new file mode 100644 index 0000000000..21631f91fa --- /dev/null +++ b/core-js/features/array/entries.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/entries'); diff --git a/core-js/features/array/every.js b/core-js/features/array/every.js new file mode 100644 index 0000000000..e04ec0d264 --- /dev/null +++ b/core-js/features/array/every.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/every'); diff --git a/core-js/features/array/fill.js b/core-js/features/array/fill.js new file mode 100644 index 0000000000..8d43319836 --- /dev/null +++ b/core-js/features/array/fill.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/fill'); diff --git a/core-js/features/array/filter.js b/core-js/features/array/filter.js new file mode 100644 index 0000000000..5fedc7343e --- /dev/null +++ b/core-js/features/array/filter.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/filter'); diff --git a/core-js/features/array/find-index.js b/core-js/features/array/find-index.js new file mode 100644 index 0000000000..0f687ead10 --- /dev/null +++ b/core-js/features/array/find-index.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/find-index'); diff --git a/core-js/features/array/find.js b/core-js/features/array/find.js new file mode 100644 index 0000000000..2fc2611777 --- /dev/null +++ b/core-js/features/array/find.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/find'); diff --git a/core-js/features/array/flat-map.js b/core-js/features/array/flat-map.js new file mode 100644 index 0000000000..87a5555503 --- /dev/null +++ b/core-js/features/array/flat-map.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/flat-map'); diff --git a/core-js/features/array/flat.js b/core-js/features/array/flat.js new file mode 100644 index 0000000000..7b32eb70e9 --- /dev/null +++ b/core-js/features/array/flat.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/flat'); diff --git a/core-js/features/array/for-each.js b/core-js/features/array/for-each.js new file mode 100644 index 0000000000..df36b3b7e1 --- /dev/null +++ b/core-js/features/array/for-each.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/for-each'); diff --git a/core-js/features/array/from.js b/core-js/features/array/from.js new file mode 100644 index 0000000000..483cff183b --- /dev/null +++ b/core-js/features/array/from.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/from'); diff --git a/core-js/features/array/includes.js b/core-js/features/array/includes.js new file mode 100644 index 0000000000..64cc5866ba --- /dev/null +++ b/core-js/features/array/includes.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/includes'); diff --git a/core-js/features/array/index-of.js b/core-js/features/array/index-of.js new file mode 100644 index 0000000000..42f3d838cd --- /dev/null +++ b/core-js/features/array/index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/index-of'); diff --git a/core-js/features/array/index.js b/core-js/features/array/index.js new file mode 100644 index 0000000000..5997b1d0a5 --- /dev/null +++ b/core-js/features/array/index.js @@ -0,0 +1,5 @@ +module.exports = require('../../es/array'); + +require('../../modules/esnext.array.is-template-object'); +require('../../modules/esnext.array.last-item'); +require('../../modules/esnext.array.last-index'); diff --git a/core-js/features/array/is-array.js b/core-js/features/array/is-array.js new file mode 100644 index 0000000000..12bd214b70 --- /dev/null +++ b/core-js/features/array/is-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/is-array'); diff --git a/core-js/features/array/is-template-object.js b/core-js/features/array/is-template-object.js new file mode 100644 index 0000000000..f5eaf818c8 --- /dev/null +++ b/core-js/features/array/is-template-object.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.array.is-template-object'); +var path = require('../../internals/path'); + +module.exports = path.Array.isTemplateObject; diff --git a/core-js/features/array/iterator.js b/core-js/features/array/iterator.js new file mode 100644 index 0000000000..774d23555f --- /dev/null +++ b/core-js/features/array/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/iterator'); diff --git a/core-js/features/array/join.js b/core-js/features/array/join.js new file mode 100644 index 0000000000..4390ed3baa --- /dev/null +++ b/core-js/features/array/join.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/join'); diff --git a/core-js/features/array/keys.js b/core-js/features/array/keys.js new file mode 100644 index 0000000000..241f21ae6c --- /dev/null +++ b/core-js/features/array/keys.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/keys'); diff --git a/core-js/features/array/last-index-of.js b/core-js/features/array/last-index-of.js new file mode 100644 index 0000000000..0eca23c915 --- /dev/null +++ b/core-js/features/array/last-index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/last-index-of'); diff --git a/core-js/features/array/last-index.js b/core-js/features/array/last-index.js new file mode 100644 index 0000000000..230cea05ff --- /dev/null +++ b/core-js/features/array/last-index.js @@ -0,0 +1 @@ +require('../../modules/esnext.array.last-index'); diff --git a/core-js/features/array/last-item.js b/core-js/features/array/last-item.js new file mode 100644 index 0000000000..5a4b25b623 --- /dev/null +++ b/core-js/features/array/last-item.js @@ -0,0 +1 @@ +require('../../modules/esnext.array.last-item'); diff --git a/core-js/features/array/map.js b/core-js/features/array/map.js new file mode 100644 index 0000000000..d3cea88bc0 --- /dev/null +++ b/core-js/features/array/map.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/map'); diff --git a/core-js/features/array/of.js b/core-js/features/array/of.js new file mode 100644 index 0000000000..0e69d5becf --- /dev/null +++ b/core-js/features/array/of.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/of'); diff --git a/core-js/features/array/reduce-right.js b/core-js/features/array/reduce-right.js new file mode 100644 index 0000000000..72e0f58ba5 --- /dev/null +++ b/core-js/features/array/reduce-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/reduce-right'); diff --git a/core-js/features/array/reduce.js b/core-js/features/array/reduce.js new file mode 100644 index 0000000000..c688c9fdea --- /dev/null +++ b/core-js/features/array/reduce.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/reduce'); diff --git a/core-js/features/array/reverse.js b/core-js/features/array/reverse.js new file mode 100644 index 0000000000..65a1d7a830 --- /dev/null +++ b/core-js/features/array/reverse.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/reverse'); diff --git a/core-js/features/array/slice.js b/core-js/features/array/slice.js new file mode 100644 index 0000000000..67345b2d88 --- /dev/null +++ b/core-js/features/array/slice.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/slice'); diff --git a/core-js/features/array/some.js b/core-js/features/array/some.js new file mode 100644 index 0000000000..ce62873e9b --- /dev/null +++ b/core-js/features/array/some.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/some'); diff --git a/core-js/features/array/sort.js b/core-js/features/array/sort.js new file mode 100644 index 0000000000..4a58b24490 --- /dev/null +++ b/core-js/features/array/sort.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/sort'); diff --git a/core-js/features/array/splice.js b/core-js/features/array/splice.js new file mode 100644 index 0000000000..898b964a36 --- /dev/null +++ b/core-js/features/array/splice.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/splice'); diff --git a/core-js/features/array/values.js b/core-js/features/array/values.js new file mode 100644 index 0000000000..6e8956c4b1 --- /dev/null +++ b/core-js/features/array/values.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/values'); diff --git a/core-js/features/array/virtual/concat.js b/core-js/features/array/virtual/concat.js new file mode 100644 index 0000000000..e4aad47ecf --- /dev/null +++ b/core-js/features/array/virtual/concat.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/concat'); diff --git a/core-js/features/array/virtual/copy-within.js b/core-js/features/array/virtual/copy-within.js new file mode 100644 index 0000000000..3bb56c0d99 --- /dev/null +++ b/core-js/features/array/virtual/copy-within.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/copy-within'); diff --git a/core-js/features/array/virtual/entries.js b/core-js/features/array/virtual/entries.js new file mode 100644 index 0000000000..561c358c17 --- /dev/null +++ b/core-js/features/array/virtual/entries.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/entries'); diff --git a/core-js/features/array/virtual/every.js b/core-js/features/array/virtual/every.js new file mode 100644 index 0000000000..9b22ec88d9 --- /dev/null +++ b/core-js/features/array/virtual/every.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/every'); diff --git a/core-js/features/array/virtual/fill.js b/core-js/features/array/virtual/fill.js new file mode 100644 index 0000000000..2a2ae7628b --- /dev/null +++ b/core-js/features/array/virtual/fill.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/fill'); diff --git a/core-js/features/array/virtual/filter.js b/core-js/features/array/virtual/filter.js new file mode 100644 index 0000000000..bc98bd19c5 --- /dev/null +++ b/core-js/features/array/virtual/filter.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/filter'); diff --git a/core-js/features/array/virtual/find-index.js b/core-js/features/array/virtual/find-index.js new file mode 100644 index 0000000000..dc352bd974 --- /dev/null +++ b/core-js/features/array/virtual/find-index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/find-index'); diff --git a/core-js/features/array/virtual/find.js b/core-js/features/array/virtual/find.js new file mode 100644 index 0000000000..54ebe1d788 --- /dev/null +++ b/core-js/features/array/virtual/find.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/find'); diff --git a/core-js/features/array/virtual/flat-map.js b/core-js/features/array/virtual/flat-map.js new file mode 100644 index 0000000000..08c9be00b3 --- /dev/null +++ b/core-js/features/array/virtual/flat-map.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/flat-map'); diff --git a/core-js/features/array/virtual/flat.js b/core-js/features/array/virtual/flat.js new file mode 100644 index 0000000000..c53d93f4b5 --- /dev/null +++ b/core-js/features/array/virtual/flat.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/flat'); diff --git a/core-js/features/array/virtual/for-each.js b/core-js/features/array/virtual/for-each.js new file mode 100644 index 0000000000..9b3880f299 --- /dev/null +++ b/core-js/features/array/virtual/for-each.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/for-each'); diff --git a/core-js/features/array/virtual/includes.js b/core-js/features/array/virtual/includes.js new file mode 100644 index 0000000000..e5623fc7a1 --- /dev/null +++ b/core-js/features/array/virtual/includes.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/includes'); diff --git a/core-js/features/array/virtual/index-of.js b/core-js/features/array/virtual/index-of.js new file mode 100644 index 0000000000..e819d9b18e --- /dev/null +++ b/core-js/features/array/virtual/index-of.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/index-of'); diff --git a/core-js/features/array/virtual/index.js b/core-js/features/array/virtual/index.js new file mode 100644 index 0000000000..e6bff15e76 --- /dev/null +++ b/core-js/features/array/virtual/index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual'); diff --git a/core-js/features/array/virtual/iterator.js b/core-js/features/array/virtual/iterator.js new file mode 100644 index 0000000000..f99a1a05a3 --- /dev/null +++ b/core-js/features/array/virtual/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/iterator'); diff --git a/core-js/features/array/virtual/join.js b/core-js/features/array/virtual/join.js new file mode 100644 index 0000000000..0fb295ed63 --- /dev/null +++ b/core-js/features/array/virtual/join.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/join'); diff --git a/core-js/features/array/virtual/keys.js b/core-js/features/array/virtual/keys.js new file mode 100644 index 0000000000..efc2d88b10 --- /dev/null +++ b/core-js/features/array/virtual/keys.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/keys'); diff --git a/core-js/features/array/virtual/last-index-of.js b/core-js/features/array/virtual/last-index-of.js new file mode 100644 index 0000000000..cc4ba59778 --- /dev/null +++ b/core-js/features/array/virtual/last-index-of.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/last-index-of'); diff --git a/core-js/features/array/virtual/map.js b/core-js/features/array/virtual/map.js new file mode 100644 index 0000000000..bdd7e52335 --- /dev/null +++ b/core-js/features/array/virtual/map.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/map'); diff --git a/core-js/features/array/virtual/reduce-right.js b/core-js/features/array/virtual/reduce-right.js new file mode 100644 index 0000000000..e00d5391a7 --- /dev/null +++ b/core-js/features/array/virtual/reduce-right.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/reduce-right'); diff --git a/core-js/features/array/virtual/reduce.js b/core-js/features/array/virtual/reduce.js new file mode 100644 index 0000000000..47a30bac4e --- /dev/null +++ b/core-js/features/array/virtual/reduce.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/reduce'); diff --git a/core-js/features/array/virtual/reverse.js b/core-js/features/array/virtual/reverse.js new file mode 100644 index 0000000000..780cd09b78 --- /dev/null +++ b/core-js/features/array/virtual/reverse.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/reverse'); diff --git a/core-js/features/array/virtual/slice.js b/core-js/features/array/virtual/slice.js new file mode 100644 index 0000000000..4d65726f58 --- /dev/null +++ b/core-js/features/array/virtual/slice.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/slice'); diff --git a/core-js/features/array/virtual/some.js b/core-js/features/array/virtual/some.js new file mode 100644 index 0000000000..cb86d9e373 --- /dev/null +++ b/core-js/features/array/virtual/some.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/some'); diff --git a/core-js/features/array/virtual/sort.js b/core-js/features/array/virtual/sort.js new file mode 100644 index 0000000000..5008b036b7 --- /dev/null +++ b/core-js/features/array/virtual/sort.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/sort'); diff --git a/core-js/features/array/virtual/splice.js b/core-js/features/array/virtual/splice.js new file mode 100644 index 0000000000..feace09451 --- /dev/null +++ b/core-js/features/array/virtual/splice.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/splice'); diff --git a/core-js/features/array/virtual/values.js b/core-js/features/array/virtual/values.js new file mode 100644 index 0000000000..7aa326fb0a --- /dev/null +++ b/core-js/features/array/virtual/values.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/values'); diff --git a/core-js/features/clear-immediate.js b/core-js/features/clear-immediate.js new file mode 100644 index 0000000000..54d9bb2d51 --- /dev/null +++ b/core-js/features/clear-immediate.js @@ -0,0 +1 @@ +module.exports = require('../stable/clear-immediate'); diff --git a/core-js/features/composite-key.js b/core-js/features/composite-key.js new file mode 100644 index 0000000000..9fd507b10f --- /dev/null +++ b/core-js/features/composite-key.js @@ -0,0 +1,4 @@ +require('../modules/esnext.composite-key'); +var path = require('../internals/path'); + +module.exports = path.compositeKey; diff --git a/core-js/features/composite-symbol.js b/core-js/features/composite-symbol.js new file mode 100644 index 0000000000..fce960024d --- /dev/null +++ b/core-js/features/composite-symbol.js @@ -0,0 +1,5 @@ +require('../modules/es.symbol'); +require('../modules/esnext.composite-symbol'); +var path = require('../internals/path'); + +module.exports = path.compositeSymbol; diff --git a/core-js/features/data-view/index.js b/core-js/features/data-view/index.js new file mode 100644 index 0000000000..7a754971ca --- /dev/null +++ b/core-js/features/data-view/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/data-view'); diff --git a/core-js/features/date/index.js b/core-js/features/date/index.js new file mode 100644 index 0000000000..5ff65b85b2 --- /dev/null +++ b/core-js/features/date/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/date'); diff --git a/core-js/features/date/now.js b/core-js/features/date/now.js new file mode 100644 index 0000000000..e196b5f3ca --- /dev/null +++ b/core-js/features/date/now.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/now'); diff --git a/core-js/features/date/to-iso-string.js b/core-js/features/date/to-iso-string.js new file mode 100644 index 0000000000..c9348195f5 --- /dev/null +++ b/core-js/features/date/to-iso-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-iso-string'); diff --git a/core-js/features/date/to-json.js b/core-js/features/date/to-json.js new file mode 100644 index 0000000000..9966af465b --- /dev/null +++ b/core-js/features/date/to-json.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-json'); diff --git a/core-js/features/date/to-primitive.js b/core-js/features/date/to-primitive.js new file mode 100644 index 0000000000..f9f11e47cb --- /dev/null +++ b/core-js/features/date/to-primitive.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-primitive'); diff --git a/core-js/features/date/to-string.js b/core-js/features/date/to-string.js new file mode 100644 index 0000000000..055f26c439 --- /dev/null +++ b/core-js/features/date/to-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-string'); diff --git a/core-js/features/dom-collections/for-each.js b/core-js/features/dom-collections/for-each.js new file mode 100644 index 0000000000..6f9c15dde0 --- /dev/null +++ b/core-js/features/dom-collections/for-each.js @@ -0,0 +1 @@ +module.exports = require('../../stable/dom-collections/for-each'); diff --git a/core-js/features/dom-collections/index.js b/core-js/features/dom-collections/index.js new file mode 100644 index 0000000000..1fe8ae80fa --- /dev/null +++ b/core-js/features/dom-collections/index.js @@ -0,0 +1 @@ +module.exports = require('../../stable/dom-collections'); diff --git a/core-js/features/dom-collections/iterator.js b/core-js/features/dom-collections/iterator.js new file mode 100644 index 0000000000..03ac513117 --- /dev/null +++ b/core-js/features/dom-collections/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../stable/dom-collections/iterator'); diff --git a/core-js/features/function/bind.js b/core-js/features/function/bind.js new file mode 100644 index 0000000000..108a677315 --- /dev/null +++ b/core-js/features/function/bind.js @@ -0,0 +1 @@ +module.exports = require('../../es/function/bind'); diff --git a/core-js/features/function/has-instance.js b/core-js/features/function/has-instance.js new file mode 100644 index 0000000000..eac5999193 --- /dev/null +++ b/core-js/features/function/has-instance.js @@ -0,0 +1 @@ +module.exports = require('../../es/function/has-instance'); diff --git a/core-js/features/function/index.js b/core-js/features/function/index.js new file mode 100644 index 0000000000..3bed0f56b7 --- /dev/null +++ b/core-js/features/function/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/function'); diff --git a/core-js/features/function/name.js b/core-js/features/function/name.js new file mode 100644 index 0000000000..b4fe6766cc --- /dev/null +++ b/core-js/features/function/name.js @@ -0,0 +1 @@ +module.exports = require('../../es/function/name'); diff --git a/core-js/features/function/virtual/bind.js b/core-js/features/function/virtual/bind.js new file mode 100644 index 0000000000..2820ffb11d --- /dev/null +++ b/core-js/features/function/virtual/bind.js @@ -0,0 +1 @@ +module.exports = require('../../../es/function/virtual/bind'); diff --git a/core-js/features/function/virtual/index.js b/core-js/features/function/virtual/index.js new file mode 100644 index 0000000000..3234d9d071 --- /dev/null +++ b/core-js/features/function/virtual/index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/function/virtual'); diff --git a/core-js/features/get-iterator-method.js b/core-js/features/get-iterator-method.js new file mode 100644 index 0000000000..a5afc2bd58 --- /dev/null +++ b/core-js/features/get-iterator-method.js @@ -0,0 +1,4 @@ +require('../modules/web.dom-collections.iterator'); +require('../modules/es.string.iterator'); + +module.exports = require('../internals/get-iterator-method'); diff --git a/core-js/features/get-iterator.js b/core-js/features/get-iterator.js new file mode 100644 index 0000000000..c4c6a7884f --- /dev/null +++ b/core-js/features/get-iterator.js @@ -0,0 +1,4 @@ +require('../modules/web.dom-collections.iterator'); +require('../modules/es.string.iterator'); + +module.exports = require('../internals/get-iterator'); diff --git a/core-js/features/global-this.js b/core-js/features/global-this.js new file mode 100644 index 0000000000..f056723c42 --- /dev/null +++ b/core-js/features/global-this.js @@ -0,0 +1,3 @@ +require('../modules/esnext.global-this'); + +module.exports = require('../internals/global'); diff --git a/core-js/features/index.js b/core-js/features/index.js new file mode 100644 index 0000000000..c259160ef5 --- /dev/null +++ b/core-js/features/index.js @@ -0,0 +1 @@ +module.exports = require('..'); diff --git a/core-js/features/instance/at.js b/core-js/features/instance/at.js new file mode 100644 index 0000000000..f9b4f7986d --- /dev/null +++ b/core-js/features/instance/at.js @@ -0,0 +1,9 @@ +var at = require('../string/virtual/at'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.at; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.at) ? at : own; +}; diff --git a/core-js/features/instance/bind.js b/core-js/features/instance/bind.js new file mode 100644 index 0000000000..7f168092f6 --- /dev/null +++ b/core-js/features/instance/bind.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/bind'); diff --git a/core-js/features/instance/code-point-at.js b/core-js/features/instance/code-point-at.js new file mode 100644 index 0000000000..f353ea3e83 --- /dev/null +++ b/core-js/features/instance/code-point-at.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/code-point-at'); diff --git a/core-js/features/instance/code-points.js b/core-js/features/instance/code-points.js new file mode 100644 index 0000000000..6437299295 --- /dev/null +++ b/core-js/features/instance/code-points.js @@ -0,0 +1,9 @@ +var codePoints = require('../string/virtual/code-points'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.codePoints; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.codePoints) ? codePoints : own; +}; diff --git a/core-js/features/instance/concat.js b/core-js/features/instance/concat.js new file mode 100644 index 0000000000..1387932eba --- /dev/null +++ b/core-js/features/instance/concat.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/concat'); diff --git a/core-js/features/instance/copy-within.js b/core-js/features/instance/copy-within.js new file mode 100644 index 0000000000..15e9d29ca2 --- /dev/null +++ b/core-js/features/instance/copy-within.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/copy-within'); diff --git a/core-js/features/instance/ends-with.js b/core-js/features/instance/ends-with.js new file mode 100644 index 0000000000..72a0380408 --- /dev/null +++ b/core-js/features/instance/ends-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/ends-with'); diff --git a/core-js/features/instance/entries.js b/core-js/features/instance/entries.js new file mode 100644 index 0000000000..0f3cc1e0c7 --- /dev/null +++ b/core-js/features/instance/entries.js @@ -0,0 +1 @@ +module.exports = require('../../stable/instance/entries'); diff --git a/core-js/features/instance/every.js b/core-js/features/instance/every.js new file mode 100644 index 0000000000..9b285d51ae --- /dev/null +++ b/core-js/features/instance/every.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/every'); diff --git a/core-js/features/instance/fill.js b/core-js/features/instance/fill.js new file mode 100644 index 0000000000..884763c3c8 --- /dev/null +++ b/core-js/features/instance/fill.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/fill'); diff --git a/core-js/features/instance/filter.js b/core-js/features/instance/filter.js new file mode 100644 index 0000000000..94b2339649 --- /dev/null +++ b/core-js/features/instance/filter.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/filter'); diff --git a/core-js/features/instance/find-index.js b/core-js/features/instance/find-index.js new file mode 100644 index 0000000000..79e4118375 --- /dev/null +++ b/core-js/features/instance/find-index.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/find-index'); diff --git a/core-js/features/instance/find.js b/core-js/features/instance/find.js new file mode 100644 index 0000000000..9edd5736ea --- /dev/null +++ b/core-js/features/instance/find.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/find'); diff --git a/core-js/features/instance/flags.js b/core-js/features/instance/flags.js new file mode 100644 index 0000000000..e3bfaa720c --- /dev/null +++ b/core-js/features/instance/flags.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/flags'); diff --git a/core-js/features/instance/flat-map.js b/core-js/features/instance/flat-map.js new file mode 100644 index 0000000000..a98bebd71e --- /dev/null +++ b/core-js/features/instance/flat-map.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/flat-map'); diff --git a/core-js/features/instance/flat.js b/core-js/features/instance/flat.js new file mode 100644 index 0000000000..bc46540952 --- /dev/null +++ b/core-js/features/instance/flat.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/flat'); diff --git a/core-js/features/instance/for-each.js b/core-js/features/instance/for-each.js new file mode 100644 index 0000000000..0540efa004 --- /dev/null +++ b/core-js/features/instance/for-each.js @@ -0,0 +1 @@ +module.exports = require('../../stable/instance/for-each'); diff --git a/core-js/features/instance/includes.js b/core-js/features/instance/includes.js new file mode 100644 index 0000000000..6d13532177 --- /dev/null +++ b/core-js/features/instance/includes.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/includes'); diff --git a/core-js/features/instance/index-of.js b/core-js/features/instance/index-of.js new file mode 100644 index 0000000000..8700e0e2c0 --- /dev/null +++ b/core-js/features/instance/index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/index-of'); diff --git a/core-js/features/instance/keys.js b/core-js/features/instance/keys.js new file mode 100644 index 0000000000..0f562f8742 --- /dev/null +++ b/core-js/features/instance/keys.js @@ -0,0 +1 @@ +module.exports = require('../../stable/instance/keys'); diff --git a/core-js/features/instance/last-index-of.js b/core-js/features/instance/last-index-of.js new file mode 100644 index 0000000000..b99739ef8a --- /dev/null +++ b/core-js/features/instance/last-index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/last-index-of'); diff --git a/core-js/features/instance/map.js b/core-js/features/instance/map.js new file mode 100644 index 0000000000..bfb6be1b28 --- /dev/null +++ b/core-js/features/instance/map.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/map'); diff --git a/core-js/features/instance/match-all.js b/core-js/features/instance/match-all.js new file mode 100644 index 0000000000..2decf588e9 --- /dev/null +++ b/core-js/features/instance/match-all.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/match-all'); diff --git a/core-js/features/instance/pad-end.js b/core-js/features/instance/pad-end.js new file mode 100644 index 0000000000..16ed95a01a --- /dev/null +++ b/core-js/features/instance/pad-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/pad-end'); diff --git a/core-js/features/instance/pad-start.js b/core-js/features/instance/pad-start.js new file mode 100644 index 0000000000..01925ffbba --- /dev/null +++ b/core-js/features/instance/pad-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/pad-start'); diff --git a/core-js/features/instance/reduce-right.js b/core-js/features/instance/reduce-right.js new file mode 100644 index 0000000000..2810409d94 --- /dev/null +++ b/core-js/features/instance/reduce-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/reduce-right'); diff --git a/core-js/features/instance/reduce.js b/core-js/features/instance/reduce.js new file mode 100644 index 0000000000..ecee1c959a --- /dev/null +++ b/core-js/features/instance/reduce.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/reduce'); diff --git a/core-js/features/instance/repeat.js b/core-js/features/instance/repeat.js new file mode 100644 index 0000000000..c0a7ec87a6 --- /dev/null +++ b/core-js/features/instance/repeat.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/repeat'); diff --git a/core-js/features/instance/replace-all.js b/core-js/features/instance/replace-all.js new file mode 100644 index 0000000000..d920a60146 --- /dev/null +++ b/core-js/features/instance/replace-all.js @@ -0,0 +1,9 @@ +var replaceAll = require('../string/virtual/replace-all'); + +var StringPrototype = String.prototype; + +module.exports = function (it) { + var own = it.replaceAll; + return typeof it === 'string' || it === StringPrototype + || (it instanceof String && own === StringPrototype.replaceAll) ? replaceAll : own; +}; diff --git a/core-js/features/instance/reverse.js b/core-js/features/instance/reverse.js new file mode 100644 index 0000000000..9983586581 --- /dev/null +++ b/core-js/features/instance/reverse.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/reverse'); diff --git a/core-js/features/instance/slice.js b/core-js/features/instance/slice.js new file mode 100644 index 0000000000..1755c4191b --- /dev/null +++ b/core-js/features/instance/slice.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/slice'); diff --git a/core-js/features/instance/some.js b/core-js/features/instance/some.js new file mode 100644 index 0000000000..b32c903b30 --- /dev/null +++ b/core-js/features/instance/some.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/some'); diff --git a/core-js/features/instance/sort.js b/core-js/features/instance/sort.js new file mode 100644 index 0000000000..8891434c22 --- /dev/null +++ b/core-js/features/instance/sort.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/sort'); diff --git a/core-js/features/instance/splice.js b/core-js/features/instance/splice.js new file mode 100644 index 0000000000..1d20660f06 --- /dev/null +++ b/core-js/features/instance/splice.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/splice'); diff --git a/core-js/features/instance/starts-with.js b/core-js/features/instance/starts-with.js new file mode 100644 index 0000000000..4c8905255a --- /dev/null +++ b/core-js/features/instance/starts-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/starts-with'); diff --git a/core-js/features/instance/trim-end.js b/core-js/features/instance/trim-end.js new file mode 100644 index 0000000000..eb75cde145 --- /dev/null +++ b/core-js/features/instance/trim-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-end'); diff --git a/core-js/features/instance/trim-left.js b/core-js/features/instance/trim-left.js new file mode 100644 index 0000000000..5bef37ab77 --- /dev/null +++ b/core-js/features/instance/trim-left.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-left'); diff --git a/core-js/features/instance/trim-right.js b/core-js/features/instance/trim-right.js new file mode 100644 index 0000000000..c425c7bf7b --- /dev/null +++ b/core-js/features/instance/trim-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-right'); diff --git a/core-js/features/instance/trim-start.js b/core-js/features/instance/trim-start.js new file mode 100644 index 0000000000..88616985fa --- /dev/null +++ b/core-js/features/instance/trim-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-start'); diff --git a/core-js/features/instance/trim.js b/core-js/features/instance/trim.js new file mode 100644 index 0000000000..61c69d5030 --- /dev/null +++ b/core-js/features/instance/trim.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim'); diff --git a/core-js/features/instance/values.js b/core-js/features/instance/values.js new file mode 100644 index 0000000000..9a29e4f069 --- /dev/null +++ b/core-js/features/instance/values.js @@ -0,0 +1 @@ +module.exports = require('../../stable/instance/values'); diff --git a/core-js/features/is-iterable.js b/core-js/features/is-iterable.js new file mode 100644 index 0000000000..7ca65d5b98 --- /dev/null +++ b/core-js/features/is-iterable.js @@ -0,0 +1,4 @@ +require('../modules/web.dom-collections.iterator'); +require('../modules/es.string.iterator'); + +module.exports = require('../internals/is-iterable'); diff --git a/core-js/features/json/index.js b/core-js/features/json/index.js new file mode 100644 index 0000000000..c0b897ff78 --- /dev/null +++ b/core-js/features/json/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/json'); diff --git a/core-js/features/json/stringify.js b/core-js/features/json/stringify.js new file mode 100644 index 0000000000..20cf890355 --- /dev/null +++ b/core-js/features/json/stringify.js @@ -0,0 +1 @@ +module.exports = require('../../es/json/stringify'); diff --git a/core-js/features/json/to-string-tag.js b/core-js/features/json/to-string-tag.js new file mode 100644 index 0000000000..9e9567295b --- /dev/null +++ b/core-js/features/json/to-string-tag.js @@ -0,0 +1 @@ +module.exports = require('../../es/json/to-string-tag'); diff --git a/core-js/features/map/delete-all.js b/core-js/features/map/delete-all.js new file mode 100644 index 0000000000..ecb21135ba --- /dev/null +++ b/core-js/features/map/delete-all.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.delete-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'deleteAll'); diff --git a/core-js/features/map/every.js b/core-js/features/map/every.js new file mode 100644 index 0000000000..a86e3930a6 --- /dev/null +++ b/core-js/features/map/every.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.every'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'every'); diff --git a/core-js/features/map/filter.js b/core-js/features/map/filter.js new file mode 100644 index 0000000000..23265265b7 --- /dev/null +++ b/core-js/features/map/filter.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.filter'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'filter'); diff --git a/core-js/features/map/find-key.js b/core-js/features/map/find-key.js new file mode 100644 index 0000000000..662c42363d --- /dev/null +++ b/core-js/features/map/find-key.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.find-key'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'findKey'); diff --git a/core-js/features/map/find.js b/core-js/features/map/find.js new file mode 100644 index 0000000000..993b2268c7 --- /dev/null +++ b/core-js/features/map/find.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.find'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'find'); diff --git a/core-js/features/map/from.js b/core-js/features/map/from.js new file mode 100644 index 0000000000..b7d75f907c --- /dev/null +++ b/core-js/features/map/from.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.map'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.map.from'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var Map = path.Map; +var mapFrom = Map.from; + +module.exports = function from(source, mapFn, thisArg) { + return mapFrom.call(typeof this === 'function' ? this : Map, source, mapFn, thisArg); +}; diff --git a/core-js/features/map/group-by.js b/core-js/features/map/group-by.js new file mode 100644 index 0000000000..c4dfdca59a --- /dev/null +++ b/core-js/features/map/group-by.js @@ -0,0 +1,11 @@ +'use strict'; +require('../../modules/es.map'); +require('../../modules/esnext.map.group-by'); +var path = require('../../internals/path'); + +var Map = path.Map; +var mapGroupBy = Map.groupBy; + +module.exports = function groupBy(source, iterable, keyDerivative) { + return mapGroupBy.call(typeof this === 'function' ? this : Map, source, iterable, keyDerivative); +}; diff --git a/core-js/features/map/includes.js b/core-js/features/map/includes.js new file mode 100644 index 0000000000..3ba5acd135 --- /dev/null +++ b/core-js/features/map/includes.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.includes'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'includes'); diff --git a/core-js/features/map/index.js b/core-js/features/map/index.js new file mode 100644 index 0000000000..bc7a5360c0 --- /dev/null +++ b/core-js/features/map/index.js @@ -0,0 +1,20 @@ +module.exports = require('../../es/map'); + +require('../../modules/esnext.map.from'); +require('../../modules/esnext.map.of'); +require('../../modules/esnext.map.delete-all'); +require('../../modules/esnext.map.every'); +require('../../modules/esnext.map.filter'); +require('../../modules/esnext.map.find'); +require('../../modules/esnext.map.find-key'); +require('../../modules/esnext.map.group-by'); +require('../../modules/esnext.map.includes'); +require('../../modules/esnext.map.key-by'); +require('../../modules/esnext.map.key-of'); +require('../../modules/esnext.map.map-keys'); +require('../../modules/esnext.map.map-values'); +require('../../modules/esnext.map.merge'); +require('../../modules/esnext.map.reduce'); +require('../../modules/esnext.map.some'); +require('../../modules/esnext.map.update'); +require('../../modules/esnext.map.update-or-insert'); diff --git a/core-js/features/map/key-by.js b/core-js/features/map/key-by.js new file mode 100644 index 0000000000..b156f020d0 --- /dev/null +++ b/core-js/features/map/key-by.js @@ -0,0 +1,11 @@ +'use strict'; +require('../../modules/es.map'); +require('../../modules/esnext.map.key-by'); +var path = require('../../internals/path'); + +var Map = path.Map; +var mapKeyBy = Map.keyBy; + +module.exports = function keyBy(source, iterable, keyDerivative) { + return mapKeyBy.call(typeof this === 'function' ? this : Map, source, iterable, keyDerivative); +}; diff --git a/core-js/features/map/key-of.js b/core-js/features/map/key-of.js new file mode 100644 index 0000000000..0d0789a4c8 --- /dev/null +++ b/core-js/features/map/key-of.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.key-of'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'keyOf'); diff --git a/core-js/features/map/map-keys.js b/core-js/features/map/map-keys.js new file mode 100644 index 0000000000..07a49a3271 --- /dev/null +++ b/core-js/features/map/map-keys.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.map-keys'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'mapKeys'); diff --git a/core-js/features/map/map-values.js b/core-js/features/map/map-values.js new file mode 100644 index 0000000000..40bf6ca2f6 --- /dev/null +++ b/core-js/features/map/map-values.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.map-values'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'mapValues'); diff --git a/core-js/features/map/merge.js b/core-js/features/map/merge.js new file mode 100644 index 0000000000..839620d6cb --- /dev/null +++ b/core-js/features/map/merge.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.merge'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'merge'); diff --git a/core-js/features/map/of.js b/core-js/features/map/of.js new file mode 100644 index 0000000000..57f2a76254 --- /dev/null +++ b/core-js/features/map/of.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.map'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.map.of'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var Map = path.Map; +var mapOf = Map.of; + +module.exports = function of() { + return mapOf.apply(typeof this === 'function' ? this : Map, arguments); +}; diff --git a/core-js/features/map/reduce.js b/core-js/features/map/reduce.js new file mode 100644 index 0000000000..272b6f8428 --- /dev/null +++ b/core-js/features/map/reduce.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.reduce'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'reduce'); diff --git a/core-js/features/map/some.js b/core-js/features/map/some.js new file mode 100644 index 0000000000..48192fe28b --- /dev/null +++ b/core-js/features/map/some.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.some'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'some'); diff --git a/core-js/features/map/update-or-insert.js b/core-js/features/map/update-or-insert.js new file mode 100644 index 0000000000..09c43531c4 --- /dev/null +++ b/core-js/features/map/update-or-insert.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.update-or-insert'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'updateOrInsert'); diff --git a/core-js/features/map/update.js b/core-js/features/map/update.js new file mode 100644 index 0000000000..3352690095 --- /dev/null +++ b/core-js/features/map/update.js @@ -0,0 +1,5 @@ +require('../../modules/es.map'); +require('../../modules/esnext.map.update'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Map', 'update'); diff --git a/core-js/features/math/acosh.js b/core-js/features/math/acosh.js new file mode 100644 index 0000000000..dd8ba00261 --- /dev/null +++ b/core-js/features/math/acosh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/acosh'); diff --git a/core-js/features/math/asinh.js b/core-js/features/math/asinh.js new file mode 100644 index 0000000000..f811e075c7 --- /dev/null +++ b/core-js/features/math/asinh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/asinh'); diff --git a/core-js/features/math/atanh.js b/core-js/features/math/atanh.js new file mode 100644 index 0000000000..b063d11c0a --- /dev/null +++ b/core-js/features/math/atanh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/atanh'); diff --git a/core-js/features/math/cbrt.js b/core-js/features/math/cbrt.js new file mode 100644 index 0000000000..a0679fc9cd --- /dev/null +++ b/core-js/features/math/cbrt.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/cbrt'); diff --git a/core-js/features/math/clamp.js b/core-js/features/math/clamp.js new file mode 100644 index 0000000000..7b81611772 --- /dev/null +++ b/core-js/features/math/clamp.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.clamp'); +var path = require('../../internals/path'); + +module.exports = path.Math.clamp; diff --git a/core-js/features/math/clz32.js b/core-js/features/math/clz32.js new file mode 100644 index 0000000000..e6460540e4 --- /dev/null +++ b/core-js/features/math/clz32.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/clz32'); diff --git a/core-js/features/math/cosh.js b/core-js/features/math/cosh.js new file mode 100644 index 0000000000..a2be861ee0 --- /dev/null +++ b/core-js/features/math/cosh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/cosh'); diff --git a/core-js/features/math/deg-per-rad.js b/core-js/features/math/deg-per-rad.js new file mode 100644 index 0000000000..c9451124d8 --- /dev/null +++ b/core-js/features/math/deg-per-rad.js @@ -0,0 +1,3 @@ +require('../../modules/esnext.math.deg-per-rad'); + +module.exports = Math.PI / 180; diff --git a/core-js/features/math/degrees.js b/core-js/features/math/degrees.js new file mode 100644 index 0000000000..119c32704d --- /dev/null +++ b/core-js/features/math/degrees.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.degrees'); +var path = require('../../internals/path'); + +module.exports = path.Math.degrees; diff --git a/core-js/features/math/expm1.js b/core-js/features/math/expm1.js new file mode 100644 index 0000000000..a268bf3185 --- /dev/null +++ b/core-js/features/math/expm1.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/expm1'); diff --git a/core-js/features/math/fround.js b/core-js/features/math/fround.js new file mode 100644 index 0000000000..1dc91bb680 --- /dev/null +++ b/core-js/features/math/fround.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/fround'); diff --git a/core-js/features/math/fscale.js b/core-js/features/math/fscale.js new file mode 100644 index 0000000000..2a3cdd89c5 --- /dev/null +++ b/core-js/features/math/fscale.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.fscale'); +var path = require('../../internals/path'); + +module.exports = path.Math.fscale; diff --git a/core-js/features/math/hypot.js b/core-js/features/math/hypot.js new file mode 100644 index 0000000000..e6d0e640b1 --- /dev/null +++ b/core-js/features/math/hypot.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/hypot'); diff --git a/core-js/features/math/iaddh.js b/core-js/features/math/iaddh.js new file mode 100644 index 0000000000..abfcd8a519 --- /dev/null +++ b/core-js/features/math/iaddh.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.iaddh'); +var path = require('../../internals/path'); + +module.exports = path.Math.iaddh; diff --git a/core-js/features/math/imul.js b/core-js/features/math/imul.js new file mode 100644 index 0000000000..8cca8ef8ff --- /dev/null +++ b/core-js/features/math/imul.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/imul'); diff --git a/core-js/features/math/imulh.js b/core-js/features/math/imulh.js new file mode 100644 index 0000000000..b81cf3456d --- /dev/null +++ b/core-js/features/math/imulh.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.imulh'); +var path = require('../../internals/path'); + +module.exports = path.Math.imulh; diff --git a/core-js/features/math/index.js b/core-js/features/math/index.js new file mode 100644 index 0000000000..c2aae1535d --- /dev/null +++ b/core-js/features/math/index.js @@ -0,0 +1,15 @@ +module.exports = require('../../es/math'); + +require('../../modules/esnext.math.clamp'); +require('../../modules/esnext.math.deg-per-rad'); +require('../../modules/esnext.math.degrees'); +require('../../modules/esnext.math.fscale'); +require('../../modules/esnext.math.iaddh'); +require('../../modules/esnext.math.isubh'); +require('../../modules/esnext.math.imulh'); +require('../../modules/esnext.math.rad-per-deg'); +require('../../modules/esnext.math.radians'); +require('../../modules/esnext.math.scale'); +require('../../modules/esnext.math.seeded-prng'); +require('../../modules/esnext.math.signbit'); +require('../../modules/esnext.math.umulh'); diff --git a/core-js/features/math/isubh.js b/core-js/features/math/isubh.js new file mode 100644 index 0000000000..a14e102289 --- /dev/null +++ b/core-js/features/math/isubh.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.isubh'); +var path = require('../../internals/path'); + +module.exports = path.Math.isubh; diff --git a/core-js/features/math/log10.js b/core-js/features/math/log10.js new file mode 100644 index 0000000000..272e219074 --- /dev/null +++ b/core-js/features/math/log10.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/log10'); diff --git a/core-js/features/math/log1p.js b/core-js/features/math/log1p.js new file mode 100644 index 0000000000..8974895c6d --- /dev/null +++ b/core-js/features/math/log1p.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/log1p'); diff --git a/core-js/features/math/log2.js b/core-js/features/math/log2.js new file mode 100644 index 0000000000..792eb936fe --- /dev/null +++ b/core-js/features/math/log2.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/log2'); diff --git a/core-js/features/math/rad-per-deg.js b/core-js/features/math/rad-per-deg.js new file mode 100644 index 0000000000..3eee674929 --- /dev/null +++ b/core-js/features/math/rad-per-deg.js @@ -0,0 +1,3 @@ +require('../../modules/esnext.math.rad-per-deg'); + +module.exports = 180 / Math.PI; diff --git a/core-js/features/math/radians.js b/core-js/features/math/radians.js new file mode 100644 index 0000000000..1f02607922 --- /dev/null +++ b/core-js/features/math/radians.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.radians'); +var path = require('../../internals/path'); + +module.exports = path.Math.radians; diff --git a/core-js/features/math/scale.js b/core-js/features/math/scale.js new file mode 100644 index 0000000000..c44428d952 --- /dev/null +++ b/core-js/features/math/scale.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.scale'); +var path = require('../../internals/path'); + +module.exports = path.Math.scale; diff --git a/core-js/features/math/seeded-prng.js b/core-js/features/math/seeded-prng.js new file mode 100644 index 0000000000..80491b90c0 --- /dev/null +++ b/core-js/features/math/seeded-prng.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.seeded-prng'); +var path = require('../../internals/path'); + +module.exports = path.Math.seededPRNG; diff --git a/core-js/features/math/sign.js b/core-js/features/math/sign.js new file mode 100644 index 0000000000..1fd8f83005 --- /dev/null +++ b/core-js/features/math/sign.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/sign'); diff --git a/core-js/features/math/signbit.js b/core-js/features/math/signbit.js new file mode 100644 index 0000000000..ac2862a539 --- /dev/null +++ b/core-js/features/math/signbit.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.signbit'); +var path = require('../../internals/path'); + +module.exports = path.Math.signbit; diff --git a/core-js/features/math/sinh.js b/core-js/features/math/sinh.js new file mode 100644 index 0000000000..0314605140 --- /dev/null +++ b/core-js/features/math/sinh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/sinh'); diff --git a/core-js/features/math/tanh.js b/core-js/features/math/tanh.js new file mode 100644 index 0000000000..d5bbc71216 --- /dev/null +++ b/core-js/features/math/tanh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/tanh'); diff --git a/core-js/features/math/to-string-tag.js b/core-js/features/math/to-string-tag.js new file mode 100644 index 0000000000..081cf92548 --- /dev/null +++ b/core-js/features/math/to-string-tag.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/to-string-tag'); diff --git a/core-js/features/math/trunc.js b/core-js/features/math/trunc.js new file mode 100644 index 0000000000..08da6bfded --- /dev/null +++ b/core-js/features/math/trunc.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/trunc'); diff --git a/core-js/features/math/umulh.js b/core-js/features/math/umulh.js new file mode 100644 index 0000000000..447bf712e3 --- /dev/null +++ b/core-js/features/math/umulh.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.math.umulh'); +var path = require('../../internals/path'); + +module.exports = path.Math.umulh; diff --git a/core-js/features/number/constructor.js b/core-js/features/number/constructor.js new file mode 100644 index 0000000000..2564b5428c --- /dev/null +++ b/core-js/features/number/constructor.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/constructor'); diff --git a/core-js/features/number/epsilon.js b/core-js/features/number/epsilon.js new file mode 100644 index 0000000000..c655aea68b --- /dev/null +++ b/core-js/features/number/epsilon.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/epsilon'); diff --git a/core-js/features/number/from-string.js b/core-js/features/number/from-string.js new file mode 100644 index 0000000000..65654be13e --- /dev/null +++ b/core-js/features/number/from-string.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.number.from-string'); +var path = require('../../internals/path'); + +module.exports = path.Number.fromString; diff --git a/core-js/features/number/index.js b/core-js/features/number/index.js new file mode 100644 index 0000000000..3de7c8fda3 --- /dev/null +++ b/core-js/features/number/index.js @@ -0,0 +1,3 @@ +module.exports = require('../../es/number'); + +require('../../modules/esnext.number.from-string'); diff --git a/core-js/features/number/is-finite.js b/core-js/features/number/is-finite.js new file mode 100644 index 0000000000..4df7cee02f --- /dev/null +++ b/core-js/features/number/is-finite.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-finite'); diff --git a/core-js/features/number/is-integer.js b/core-js/features/number/is-integer.js new file mode 100644 index 0000000000..703130788b --- /dev/null +++ b/core-js/features/number/is-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-integer'); diff --git a/core-js/features/number/is-nan.js b/core-js/features/number/is-nan.js new file mode 100644 index 0000000000..93b4a6a522 --- /dev/null +++ b/core-js/features/number/is-nan.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-nan'); diff --git a/core-js/features/number/is-safe-integer.js b/core-js/features/number/is-safe-integer.js new file mode 100644 index 0000000000..260215b8a9 --- /dev/null +++ b/core-js/features/number/is-safe-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-safe-integer'); diff --git a/core-js/features/number/max-safe-integer.js b/core-js/features/number/max-safe-integer.js new file mode 100644 index 0000000000..2bd9174710 --- /dev/null +++ b/core-js/features/number/max-safe-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/max-safe-integer'); diff --git a/core-js/features/number/min-safe-integer.js b/core-js/features/number/min-safe-integer.js new file mode 100644 index 0000000000..bcfe57e771 --- /dev/null +++ b/core-js/features/number/min-safe-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/min-safe-integer'); diff --git a/core-js/features/number/parse-float.js b/core-js/features/number/parse-float.js new file mode 100644 index 0000000000..bd9e1c61d2 --- /dev/null +++ b/core-js/features/number/parse-float.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/parse-float'); diff --git a/core-js/features/number/parse-int.js b/core-js/features/number/parse-int.js new file mode 100644 index 0000000000..06473b8aa2 --- /dev/null +++ b/core-js/features/number/parse-int.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/parse-int'); diff --git a/core-js/features/number/to-fixed.js b/core-js/features/number/to-fixed.js new file mode 100644 index 0000000000..a63c47aba9 --- /dev/null +++ b/core-js/features/number/to-fixed.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/to-fixed'); diff --git a/core-js/features/number/to-precision.js b/core-js/features/number/to-precision.js new file mode 100644 index 0000000000..94c0c0bb4f --- /dev/null +++ b/core-js/features/number/to-precision.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/to-precision'); diff --git a/core-js/features/number/virtual/index.js b/core-js/features/number/virtual/index.js new file mode 100644 index 0000000000..538fb741a9 --- /dev/null +++ b/core-js/features/number/virtual/index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/number/virtual'); diff --git a/core-js/features/number/virtual/to-fixed.js b/core-js/features/number/virtual/to-fixed.js new file mode 100644 index 0000000000..34a6e3d9de --- /dev/null +++ b/core-js/features/number/virtual/to-fixed.js @@ -0,0 +1 @@ +module.exports = require('../../../es/number/virtual/to-fixed'); diff --git a/core-js/features/number/virtual/to-precision.js b/core-js/features/number/virtual/to-precision.js new file mode 100644 index 0000000000..34d15ac152 --- /dev/null +++ b/core-js/features/number/virtual/to-precision.js @@ -0,0 +1 @@ +module.exports = require('../../../es/number/virtual/to-precision'); diff --git a/core-js/features/object/assign.js b/core-js/features/object/assign.js new file mode 100644 index 0000000000..71bb520708 --- /dev/null +++ b/core-js/features/object/assign.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/assign'); diff --git a/core-js/features/object/create.js b/core-js/features/object/create.js new file mode 100644 index 0000000000..c8c535c776 --- /dev/null +++ b/core-js/features/object/create.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/create'); diff --git a/core-js/features/object/define-getter.js b/core-js/features/object/define-getter.js new file mode 100644 index 0000000000..9dcc7dce99 --- /dev/null +++ b/core-js/features/object/define-getter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-getter'); diff --git a/core-js/features/object/define-properties.js b/core-js/features/object/define-properties.js new file mode 100644 index 0000000000..df17acf962 --- /dev/null +++ b/core-js/features/object/define-properties.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-properties'); diff --git a/core-js/features/object/define-property.js b/core-js/features/object/define-property.js new file mode 100644 index 0000000000..0d3d32bbc2 --- /dev/null +++ b/core-js/features/object/define-property.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-property'); diff --git a/core-js/features/object/define-setter.js b/core-js/features/object/define-setter.js new file mode 100644 index 0000000000..51eba85f1b --- /dev/null +++ b/core-js/features/object/define-setter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-setter'); diff --git a/core-js/features/object/entries.js b/core-js/features/object/entries.js new file mode 100644 index 0000000000..a0720ef4d5 --- /dev/null +++ b/core-js/features/object/entries.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/entries'); diff --git a/core-js/features/object/freeze.js b/core-js/features/object/freeze.js new file mode 100644 index 0000000000..fb649bba6d --- /dev/null +++ b/core-js/features/object/freeze.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/freeze'); diff --git a/core-js/features/object/from-entries.js b/core-js/features/object/from-entries.js new file mode 100644 index 0000000000..8b8ae99043 --- /dev/null +++ b/core-js/features/object/from-entries.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/from-entries'); diff --git a/core-js/features/object/get-own-property-descriptor.js b/core-js/features/object/get-own-property-descriptor.js new file mode 100644 index 0000000000..b0404d86dd --- /dev/null +++ b/core-js/features/object/get-own-property-descriptor.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-descriptor'); diff --git a/core-js/features/object/get-own-property-descriptors.js b/core-js/features/object/get-own-property-descriptors.js new file mode 100644 index 0000000000..2cec864d83 --- /dev/null +++ b/core-js/features/object/get-own-property-descriptors.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-descriptors'); diff --git a/core-js/features/object/get-own-property-names.js b/core-js/features/object/get-own-property-names.js new file mode 100644 index 0000000000..13d60c0cd7 --- /dev/null +++ b/core-js/features/object/get-own-property-names.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-names'); diff --git a/core-js/features/object/get-own-property-symbols.js b/core-js/features/object/get-own-property-symbols.js new file mode 100644 index 0000000000..301e00a9cf --- /dev/null +++ b/core-js/features/object/get-own-property-symbols.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-symbols'); diff --git a/core-js/features/object/get-prototype-of.js b/core-js/features/object/get-prototype-of.js new file mode 100644 index 0000000000..27d2631e2b --- /dev/null +++ b/core-js/features/object/get-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-prototype-of'); diff --git a/core-js/features/object/index.js b/core-js/features/object/index.js new file mode 100644 index 0000000000..ce38cc2695 --- /dev/null +++ b/core-js/features/object/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/object'); diff --git a/core-js/features/object/is-extensible.js b/core-js/features/object/is-extensible.js new file mode 100644 index 0000000000..c228ed7a28 --- /dev/null +++ b/core-js/features/object/is-extensible.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is-extensible'); diff --git a/core-js/features/object/is-frozen.js b/core-js/features/object/is-frozen.js new file mode 100644 index 0000000000..67bfab7201 --- /dev/null +++ b/core-js/features/object/is-frozen.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is-frozen'); diff --git a/core-js/features/object/is-sealed.js b/core-js/features/object/is-sealed.js new file mode 100644 index 0000000000..f4b1b13981 --- /dev/null +++ b/core-js/features/object/is-sealed.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is-sealed'); diff --git a/core-js/features/object/is.js b/core-js/features/object/is.js new file mode 100644 index 0000000000..70fd5bd5f8 --- /dev/null +++ b/core-js/features/object/is.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is'); diff --git a/core-js/features/object/keys.js b/core-js/features/object/keys.js new file mode 100644 index 0000000000..076a4dbec3 --- /dev/null +++ b/core-js/features/object/keys.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/keys'); diff --git a/core-js/features/object/lookup-getter.js b/core-js/features/object/lookup-getter.js new file mode 100644 index 0000000000..77c189c83f --- /dev/null +++ b/core-js/features/object/lookup-getter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/lookup-getter'); diff --git a/core-js/features/object/lookup-setter.js b/core-js/features/object/lookup-setter.js new file mode 100644 index 0000000000..c81418c26d --- /dev/null +++ b/core-js/features/object/lookup-setter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/lookup-setter'); diff --git a/core-js/features/object/prevent-extensions.js b/core-js/features/object/prevent-extensions.js new file mode 100644 index 0000000000..45e224eaee --- /dev/null +++ b/core-js/features/object/prevent-extensions.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/prevent-extensions'); diff --git a/core-js/features/object/seal.js b/core-js/features/object/seal.js new file mode 100644 index 0000000000..9982772e45 --- /dev/null +++ b/core-js/features/object/seal.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/seal'); diff --git a/core-js/features/object/set-prototype-of.js b/core-js/features/object/set-prototype-of.js new file mode 100644 index 0000000000..829f3a1b99 --- /dev/null +++ b/core-js/features/object/set-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/set-prototype-of'); diff --git a/core-js/features/object/to-string.js b/core-js/features/object/to-string.js new file mode 100644 index 0000000000..cd78944a1c --- /dev/null +++ b/core-js/features/object/to-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/to-string'); diff --git a/core-js/features/object/values.js b/core-js/features/object/values.js new file mode 100644 index 0000000000..20c13ee08e --- /dev/null +++ b/core-js/features/object/values.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/values'); diff --git a/core-js/features/observable/index.js b/core-js/features/observable/index.js new file mode 100644 index 0000000000..9f694bc9ac --- /dev/null +++ b/core-js/features/observable/index.js @@ -0,0 +1,8 @@ +require('../../modules/esnext.observable'); +require('../../modules/esnext.symbol.observable'); +require('../../modules/es.object.to-string'); +require('../../modules/es.string.iterator'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +module.exports = path.Observable; diff --git a/core-js/features/parse-float.js b/core-js/features/parse-float.js new file mode 100644 index 0000000000..8fa047145b --- /dev/null +++ b/core-js/features/parse-float.js @@ -0,0 +1 @@ +module.exports = require('../es/parse-float'); diff --git a/core-js/features/parse-int.js b/core-js/features/parse-int.js new file mode 100644 index 0000000000..5ca5602343 --- /dev/null +++ b/core-js/features/parse-int.js @@ -0,0 +1 @@ +module.exports = require('../es/parse-int'); diff --git a/core-js/features/promise/all-settled.js b/core-js/features/promise/all-settled.js new file mode 100644 index 0000000000..2b11d6b8f9 --- /dev/null +++ b/core-js/features/promise/all-settled.js @@ -0,0 +1,4 @@ +// TODO: Remove from `core-js@4` +require('../../modules/esnext.promise.all-settled'); + +module.exports = require('../../es/promise/all-settled'); diff --git a/core-js/features/promise/any.js b/core-js/features/promise/any.js new file mode 100644 index 0000000000..7246403513 --- /dev/null +++ b/core-js/features/promise/any.js @@ -0,0 +1,12 @@ +'use strict'; +require('../../modules/es.promise'); +require('../../modules/esnext.aggregate-error'); +require('../../modules/esnext.promise.any'); +var path = require('../../internals/path'); + +var Promise = path.Promise; +var $any = Promise.any; + +module.exports = function any(iterable) { + return $any.call(typeof this === 'function' ? this : Promise, iterable); +}; diff --git a/core-js/features/promise/finally.js b/core-js/features/promise/finally.js new file mode 100644 index 0000000000..33a51d4e3f --- /dev/null +++ b/core-js/features/promise/finally.js @@ -0,0 +1 @@ +module.exports = require('../../es/promise/finally'); diff --git a/core-js/features/promise/index.js b/core-js/features/promise/index.js new file mode 100644 index 0000000000..71492a27fc --- /dev/null +++ b/core-js/features/promise/index.js @@ -0,0 +1,7 @@ +module.exports = require('../../es/promise'); + +require('../../modules/esnext.aggregate-error'); +// TODO: Remove from `core-js@4` +require('../../modules/esnext.promise.all-settled'); +require('../../modules/esnext.promise.try'); +require('../../modules/esnext.promise.any'); diff --git a/core-js/features/promise/try.js b/core-js/features/promise/try.js new file mode 100644 index 0000000000..b7a6e3b4f0 --- /dev/null +++ b/core-js/features/promise/try.js @@ -0,0 +1,11 @@ +'use strict'; +require('../../modules/es.promise'); +require('../../modules/esnext.promise.try'); +var path = require('../../internals/path'); + +var Promise = path.Promise; +var promiseTry = Promise['try']; + +module.exports = { 'try': function (callbackfn) { + return promiseTry.call(typeof this === 'function' ? this : Promise, callbackfn); +} }['try']; diff --git a/core-js/features/queue-microtask.js b/core-js/features/queue-microtask.js new file mode 100644 index 0000000000..33a41cea4c --- /dev/null +++ b/core-js/features/queue-microtask.js @@ -0,0 +1 @@ +module.exports = require('../stable/queue-microtask'); diff --git a/core-js/features/reflect/apply.js b/core-js/features/reflect/apply.js new file mode 100644 index 0000000000..d7b952067d --- /dev/null +++ b/core-js/features/reflect/apply.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/apply'); diff --git a/core-js/features/reflect/construct.js b/core-js/features/reflect/construct.js new file mode 100644 index 0000000000..0f286a32e0 --- /dev/null +++ b/core-js/features/reflect/construct.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/construct'); diff --git a/core-js/features/reflect/define-metadata.js b/core-js/features/reflect/define-metadata.js new file mode 100644 index 0000000000..156cc957d1 --- /dev/null +++ b/core-js/features/reflect/define-metadata.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.define-metadata'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.defineMetadata; diff --git a/core-js/features/reflect/define-property.js b/core-js/features/reflect/define-property.js new file mode 100644 index 0000000000..d19b9265d3 --- /dev/null +++ b/core-js/features/reflect/define-property.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/define-property'); diff --git a/core-js/features/reflect/delete-metadata.js b/core-js/features/reflect/delete-metadata.js new file mode 100644 index 0000000000..bbb8c48162 --- /dev/null +++ b/core-js/features/reflect/delete-metadata.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.delete-metadata'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.deleteMetadata; diff --git a/core-js/features/reflect/delete-property.js b/core-js/features/reflect/delete-property.js new file mode 100644 index 0000000000..d79e29b3fe --- /dev/null +++ b/core-js/features/reflect/delete-property.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/delete-property'); diff --git a/core-js/features/reflect/get-metadata-keys.js b/core-js/features/reflect/get-metadata-keys.js new file mode 100644 index 0000000000..8137178ab7 --- /dev/null +++ b/core-js/features/reflect/get-metadata-keys.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.get-metadata-keys'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.getMetadataKeys; diff --git a/core-js/features/reflect/get-metadata.js b/core-js/features/reflect/get-metadata.js new file mode 100644 index 0000000000..3d00b4e4b7 --- /dev/null +++ b/core-js/features/reflect/get-metadata.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.get-metadata'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.getMetadata; diff --git a/core-js/features/reflect/get-own-metadata-keys.js b/core-js/features/reflect/get-own-metadata-keys.js new file mode 100644 index 0000000000..020828fd83 --- /dev/null +++ b/core-js/features/reflect/get-own-metadata-keys.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.get-own-metadata-keys'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.getOwnMetadataKeys; diff --git a/core-js/features/reflect/get-own-metadata.js b/core-js/features/reflect/get-own-metadata.js new file mode 100644 index 0000000000..90f626c895 --- /dev/null +++ b/core-js/features/reflect/get-own-metadata.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.get-own-metadata'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.getOwnMetadata; diff --git a/core-js/features/reflect/get-own-property-descriptor.js b/core-js/features/reflect/get-own-property-descriptor.js new file mode 100644 index 0000000000..0483bca36b --- /dev/null +++ b/core-js/features/reflect/get-own-property-descriptor.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/get-own-property-descriptor'); diff --git a/core-js/features/reflect/get-prototype-of.js b/core-js/features/reflect/get-prototype-of.js new file mode 100644 index 0000000000..cd6d7e0ba3 --- /dev/null +++ b/core-js/features/reflect/get-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/get-prototype-of'); diff --git a/core-js/features/reflect/get.js b/core-js/features/reflect/get.js new file mode 100644 index 0000000000..ee78111138 --- /dev/null +++ b/core-js/features/reflect/get.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/get'); diff --git a/core-js/features/reflect/has-metadata.js b/core-js/features/reflect/has-metadata.js new file mode 100644 index 0000000000..3072c51e32 --- /dev/null +++ b/core-js/features/reflect/has-metadata.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.has-metadata'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.hasMetadata; diff --git a/core-js/features/reflect/has-own-metadata.js b/core-js/features/reflect/has-own-metadata.js new file mode 100644 index 0000000000..09eb765436 --- /dev/null +++ b/core-js/features/reflect/has-own-metadata.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.has-own-metadata'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.hasOwnMetadata; diff --git a/core-js/features/reflect/has.js b/core-js/features/reflect/has.js new file mode 100644 index 0000000000..94ab23b957 --- /dev/null +++ b/core-js/features/reflect/has.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/has'); diff --git a/core-js/features/reflect/index.js b/core-js/features/reflect/index.js new file mode 100644 index 0000000000..2bcb0bda42 --- /dev/null +++ b/core-js/features/reflect/index.js @@ -0,0 +1,11 @@ +module.exports = require('../../es/reflect'); + +require('../../modules/esnext.reflect.define-metadata'); +require('../../modules/esnext.reflect.delete-metadata'); +require('../../modules/esnext.reflect.get-metadata'); +require('../../modules/esnext.reflect.get-metadata-keys'); +require('../../modules/esnext.reflect.get-own-metadata'); +require('../../modules/esnext.reflect.get-own-metadata-keys'); +require('../../modules/esnext.reflect.has-metadata'); +require('../../modules/esnext.reflect.has-own-metadata'); +require('../../modules/esnext.reflect.metadata'); diff --git a/core-js/features/reflect/is-extensible.js b/core-js/features/reflect/is-extensible.js new file mode 100644 index 0000000000..79eee47a47 --- /dev/null +++ b/core-js/features/reflect/is-extensible.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/is-extensible'); diff --git a/core-js/features/reflect/metadata.js b/core-js/features/reflect/metadata.js new file mode 100644 index 0000000000..d1faf13a9f --- /dev/null +++ b/core-js/features/reflect/metadata.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.reflect.metadata'); +var path = require('../../internals/path'); + +module.exports = path.Reflect.metadata; diff --git a/core-js/features/reflect/own-keys.js b/core-js/features/reflect/own-keys.js new file mode 100644 index 0000000000..d2690afcd7 --- /dev/null +++ b/core-js/features/reflect/own-keys.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/own-keys'); diff --git a/core-js/features/reflect/prevent-extensions.js b/core-js/features/reflect/prevent-extensions.js new file mode 100644 index 0000000000..7f536b2fc4 --- /dev/null +++ b/core-js/features/reflect/prevent-extensions.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/prevent-extensions'); diff --git a/core-js/features/reflect/set-prototype-of.js b/core-js/features/reflect/set-prototype-of.js new file mode 100644 index 0000000000..334b24f7f3 --- /dev/null +++ b/core-js/features/reflect/set-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/set-prototype-of'); diff --git a/core-js/features/reflect/set.js b/core-js/features/reflect/set.js new file mode 100644 index 0000000000..fb8326924e --- /dev/null +++ b/core-js/features/reflect/set.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/set'); diff --git a/core-js/features/regexp/constructor.js b/core-js/features/regexp/constructor.js new file mode 100644 index 0000000000..39f94c96b1 --- /dev/null +++ b/core-js/features/regexp/constructor.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/constructor'); diff --git a/core-js/features/regexp/flags.js b/core-js/features/regexp/flags.js new file mode 100644 index 0000000000..c8cca6a53f --- /dev/null +++ b/core-js/features/regexp/flags.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/flags'); diff --git a/core-js/features/regexp/index.js b/core-js/features/regexp/index.js new file mode 100644 index 0000000000..232877ca9e --- /dev/null +++ b/core-js/features/regexp/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp'); diff --git a/core-js/features/regexp/match.js b/core-js/features/regexp/match.js new file mode 100644 index 0000000000..18c58a6259 --- /dev/null +++ b/core-js/features/regexp/match.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/match'); diff --git a/core-js/features/regexp/replace.js b/core-js/features/regexp/replace.js new file mode 100644 index 0000000000..7164a238d5 --- /dev/null +++ b/core-js/features/regexp/replace.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/replace'); diff --git a/core-js/features/regexp/search.js b/core-js/features/regexp/search.js new file mode 100644 index 0000000000..6b0635152d --- /dev/null +++ b/core-js/features/regexp/search.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/search'); diff --git a/core-js/features/regexp/split.js b/core-js/features/regexp/split.js new file mode 100644 index 0000000000..4739453e69 --- /dev/null +++ b/core-js/features/regexp/split.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/split'); diff --git a/core-js/features/regexp/to-string.js b/core-js/features/regexp/to-string.js new file mode 100644 index 0000000000..4d7834251e --- /dev/null +++ b/core-js/features/regexp/to-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/to-string'); diff --git a/core-js/features/set-immediate.js b/core-js/features/set-immediate.js new file mode 100644 index 0000000000..8306724c61 --- /dev/null +++ b/core-js/features/set-immediate.js @@ -0,0 +1 @@ +module.exports = require('../stable/set-immediate'); diff --git a/core-js/features/set-interval.js b/core-js/features/set-interval.js new file mode 100644 index 0000000000..faa70f8de6 --- /dev/null +++ b/core-js/features/set-interval.js @@ -0,0 +1 @@ +module.exports = require('../stable/set-interval'); diff --git a/core-js/features/set-timeout.js b/core-js/features/set-timeout.js new file mode 100644 index 0000000000..cec67eee1e --- /dev/null +++ b/core-js/features/set-timeout.js @@ -0,0 +1 @@ +module.exports = require('../stable/set-timeout'); diff --git a/core-js/features/set/add-all.js b/core-js/features/set/add-all.js new file mode 100644 index 0000000000..d045d5eed6 --- /dev/null +++ b/core-js/features/set/add-all.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.add-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'addAll'); diff --git a/core-js/features/set/delete-all.js b/core-js/features/set/delete-all.js new file mode 100644 index 0000000000..aa7597453b --- /dev/null +++ b/core-js/features/set/delete-all.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.delete-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'deleteAll'); diff --git a/core-js/features/set/difference.js b/core-js/features/set/difference.js new file mode 100644 index 0000000000..24a7194827 --- /dev/null +++ b/core-js/features/set/difference.js @@ -0,0 +1,7 @@ +require('../../modules/es.set'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.set.difference'); +require('../../modules/web.dom-collections.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'difference'); diff --git a/core-js/features/set/every.js b/core-js/features/set/every.js new file mode 100644 index 0000000000..f22294ad39 --- /dev/null +++ b/core-js/features/set/every.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.every'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'every'); diff --git a/core-js/features/set/filter.js b/core-js/features/set/filter.js new file mode 100644 index 0000000000..ffb4a027d5 --- /dev/null +++ b/core-js/features/set/filter.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.filter'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'filter'); diff --git a/core-js/features/set/find.js b/core-js/features/set/find.js new file mode 100644 index 0000000000..8627805dc0 --- /dev/null +++ b/core-js/features/set/find.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.find'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'find'); diff --git a/core-js/features/set/from.js b/core-js/features/set/from.js new file mode 100644 index 0000000000..f18623b3cb --- /dev/null +++ b/core-js/features/set/from.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.set'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.set.from'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var Set = path.Set; +var setFrom = Set.from; + +module.exports = function from(source, mapFn, thisArg) { + return setFrom.call(typeof this === 'function' ? this : Set, source, mapFn, thisArg); +}; diff --git a/core-js/features/set/index.js b/core-js/features/set/index.js new file mode 100644 index 0000000000..63a4f2333b --- /dev/null +++ b/core-js/features/set/index.js @@ -0,0 +1,20 @@ +module.exports = require('../../es/set'); + +require('../../modules/esnext.set.from'); +require('../../modules/esnext.set.of'); +require('../../modules/esnext.set.add-all'); +require('../../modules/esnext.set.delete-all'); +require('../../modules/esnext.set.every'); +require('../../modules/esnext.set.difference'); +require('../../modules/esnext.set.filter'); +require('../../modules/esnext.set.find'); +require('../../modules/esnext.set.intersection'); +require('../../modules/esnext.set.is-disjoint-from'); +require('../../modules/esnext.set.is-subset-of'); +require('../../modules/esnext.set.is-superset-of'); +require('../../modules/esnext.set.join'); +require('../../modules/esnext.set.map'); +require('../../modules/esnext.set.reduce'); +require('../../modules/esnext.set.some'); +require('../../modules/esnext.set.symmetric-difference'); +require('../../modules/esnext.set.union'); diff --git a/core-js/features/set/intersection.js b/core-js/features/set/intersection.js new file mode 100644 index 0000000000..203edfe96e --- /dev/null +++ b/core-js/features/set/intersection.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.intersection'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'intersection'); diff --git a/core-js/features/set/is-disjoint-from.js b/core-js/features/set/is-disjoint-from.js new file mode 100644 index 0000000000..88ca08be98 --- /dev/null +++ b/core-js/features/set/is-disjoint-from.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.is-disjoint-from'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'isDisjointFrom'); diff --git a/core-js/features/set/is-subset-of.js b/core-js/features/set/is-subset-of.js new file mode 100644 index 0000000000..21ab3d498d --- /dev/null +++ b/core-js/features/set/is-subset-of.js @@ -0,0 +1,7 @@ +require('../../modules/es.set'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.set.is-subset-of'); +require('../../modules/web.dom-collections.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'isSubsetOf'); diff --git a/core-js/features/set/is-superset-of.js b/core-js/features/set/is-superset-of.js new file mode 100644 index 0000000000..4da6ba12e4 --- /dev/null +++ b/core-js/features/set/is-superset-of.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.is-superset-of'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'isSupersetOf'); diff --git a/core-js/features/set/join.js b/core-js/features/set/join.js new file mode 100644 index 0000000000..b3ae27daef --- /dev/null +++ b/core-js/features/set/join.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.join'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'join'); diff --git a/core-js/features/set/map.js b/core-js/features/set/map.js new file mode 100644 index 0000000000..3957002a74 --- /dev/null +++ b/core-js/features/set/map.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.map'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'map'); diff --git a/core-js/features/set/of.js b/core-js/features/set/of.js new file mode 100644 index 0000000000..114558a2ec --- /dev/null +++ b/core-js/features/set/of.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.set'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.set.of'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var Set = path.Set; +var setOf = Set.of; + +module.exports = function of() { + return setOf.apply(typeof this === 'function' ? this : Set, arguments); +}; diff --git a/core-js/features/set/reduce.js b/core-js/features/set/reduce.js new file mode 100644 index 0000000000..11ab6a4ff6 --- /dev/null +++ b/core-js/features/set/reduce.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.reduce'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'reduce'); diff --git a/core-js/features/set/some.js b/core-js/features/set/some.js new file mode 100644 index 0000000000..0b4227a9f7 --- /dev/null +++ b/core-js/features/set/some.js @@ -0,0 +1,5 @@ +require('../../modules/es.set'); +require('../../modules/esnext.set.some'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'some'); diff --git a/core-js/features/set/symmetric-difference.js b/core-js/features/set/symmetric-difference.js new file mode 100644 index 0000000000..fb04d637aa --- /dev/null +++ b/core-js/features/set/symmetric-difference.js @@ -0,0 +1,7 @@ +require('../../modules/es.set'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.set.symmetric-difference'); +require('../../modules/web.dom-collections.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'symmetricDifference'); diff --git a/core-js/features/set/union.js b/core-js/features/set/union.js new file mode 100644 index 0000000000..d180f8b8e7 --- /dev/null +++ b/core-js/features/set/union.js @@ -0,0 +1,7 @@ +require('../../modules/es.set'); +require('../../modules/es.string.iterator'); +require('../../modules/esnext.set.union'); +require('../../modules/web.dom-collections.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Set', 'union'); diff --git a/core-js/features/string/anchor.js b/core-js/features/string/anchor.js new file mode 100644 index 0000000000..4705d8e0e9 --- /dev/null +++ b/core-js/features/string/anchor.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/anchor'); diff --git a/core-js/features/string/at.js b/core-js/features/string/at.js new file mode 100644 index 0000000000..d8bcca8fbf --- /dev/null +++ b/core-js/features/string/at.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.string.at'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'at'); diff --git a/core-js/features/string/big.js b/core-js/features/string/big.js new file mode 100644 index 0000000000..8bcf44148f --- /dev/null +++ b/core-js/features/string/big.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/big'); diff --git a/core-js/features/string/blink.js b/core-js/features/string/blink.js new file mode 100644 index 0000000000..334f4a1dc8 --- /dev/null +++ b/core-js/features/string/blink.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/blink'); diff --git a/core-js/features/string/bold.js b/core-js/features/string/bold.js new file mode 100644 index 0000000000..6dbf233088 --- /dev/null +++ b/core-js/features/string/bold.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/bold'); diff --git a/core-js/features/string/code-point-at.js b/core-js/features/string/code-point-at.js new file mode 100644 index 0000000000..fb74eaee91 --- /dev/null +++ b/core-js/features/string/code-point-at.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/code-point-at'); diff --git a/core-js/features/string/code-points.js b/core-js/features/string/code-points.js new file mode 100644 index 0000000000..8a783f3155 --- /dev/null +++ b/core-js/features/string/code-points.js @@ -0,0 +1,3 @@ +require('../../modules/esnext.string.code-points'); + +module.exports = require('../../internals/entry-unbind')('String', 'codePoints'); diff --git a/core-js/features/string/ends-with.js b/core-js/features/string/ends-with.js new file mode 100644 index 0000000000..89dfe343bb --- /dev/null +++ b/core-js/features/string/ends-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/ends-with'); diff --git a/core-js/features/string/fixed.js b/core-js/features/string/fixed.js new file mode 100644 index 0000000000..450d466c56 --- /dev/null +++ b/core-js/features/string/fixed.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/fixed'); diff --git a/core-js/features/string/fontcolor.js b/core-js/features/string/fontcolor.js new file mode 100644 index 0000000000..0d1033b1d0 --- /dev/null +++ b/core-js/features/string/fontcolor.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/fontcolor'); diff --git a/core-js/features/string/fontsize.js b/core-js/features/string/fontsize.js new file mode 100644 index 0000000000..2167503c08 --- /dev/null +++ b/core-js/features/string/fontsize.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/fontsize'); diff --git a/core-js/features/string/from-code-point.js b/core-js/features/string/from-code-point.js new file mode 100644 index 0000000000..2ac7d708f7 --- /dev/null +++ b/core-js/features/string/from-code-point.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/from-code-point'); diff --git a/core-js/features/string/includes.js b/core-js/features/string/includes.js new file mode 100644 index 0000000000..62baf5c7ac --- /dev/null +++ b/core-js/features/string/includes.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/includes'); diff --git a/core-js/features/string/index.js b/core-js/features/string/index.js new file mode 100644 index 0000000000..3ff3064891 --- /dev/null +++ b/core-js/features/string/index.js @@ -0,0 +1,6 @@ +module.exports = require('../../es/string'); + +require('../../modules/esnext.string.at'); +// TODO: remove from `core-js@4` +require('../../modules/esnext.string.match-all'); +require('../../modules/esnext.string.replace-all'); diff --git a/core-js/features/string/italics.js b/core-js/features/string/italics.js new file mode 100644 index 0000000000..0bca65552f --- /dev/null +++ b/core-js/features/string/italics.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/italics'); diff --git a/core-js/features/string/iterator.js b/core-js/features/string/iterator.js new file mode 100644 index 0000000000..06e162ca0e --- /dev/null +++ b/core-js/features/string/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/iterator'); diff --git a/core-js/features/string/link.js b/core-js/features/string/link.js new file mode 100644 index 0000000000..d2ff7b9f3d --- /dev/null +++ b/core-js/features/string/link.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/link'); diff --git a/core-js/features/string/match-all.js b/core-js/features/string/match-all.js new file mode 100644 index 0000000000..949cdd4830 --- /dev/null +++ b/core-js/features/string/match-all.js @@ -0,0 +1,4 @@ +// TODO: remove from `core-js@4` +require('../../modules/esnext.string.match-all'); + +module.exports = require('../../es/string/match-all'); diff --git a/core-js/features/string/match.js b/core-js/features/string/match.js new file mode 100644 index 0000000000..7e56b7777e --- /dev/null +++ b/core-js/features/string/match.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/match'); diff --git a/core-js/features/string/pad-end.js b/core-js/features/string/pad-end.js new file mode 100644 index 0000000000..ef266cb5c3 --- /dev/null +++ b/core-js/features/string/pad-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/pad-end'); diff --git a/core-js/features/string/pad-start.js b/core-js/features/string/pad-start.js new file mode 100644 index 0000000000..45f47934f6 --- /dev/null +++ b/core-js/features/string/pad-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/pad-start'); diff --git a/core-js/features/string/raw.js b/core-js/features/string/raw.js new file mode 100644 index 0000000000..6bbc950aee --- /dev/null +++ b/core-js/features/string/raw.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/raw'); diff --git a/core-js/features/string/repeat.js b/core-js/features/string/repeat.js new file mode 100644 index 0000000000..b9b9939bbc --- /dev/null +++ b/core-js/features/string/repeat.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/repeat'); diff --git a/core-js/features/string/replace-all.js b/core-js/features/string/replace-all.js new file mode 100644 index 0000000000..6de7f51917 --- /dev/null +++ b/core-js/features/string/replace-all.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.string.replace-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('String', 'replaceAll'); diff --git a/core-js/features/string/replace.js b/core-js/features/string/replace.js new file mode 100644 index 0000000000..25cfcf730a --- /dev/null +++ b/core-js/features/string/replace.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/replace'); diff --git a/core-js/features/string/search.js b/core-js/features/string/search.js new file mode 100644 index 0000000000..629c7a5542 --- /dev/null +++ b/core-js/features/string/search.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/search'); diff --git a/core-js/features/string/small.js b/core-js/features/string/small.js new file mode 100644 index 0000000000..da002780cf --- /dev/null +++ b/core-js/features/string/small.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/small'); diff --git a/core-js/features/string/split.js b/core-js/features/string/split.js new file mode 100644 index 0000000000..1ec2611975 --- /dev/null +++ b/core-js/features/string/split.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/split'); diff --git a/core-js/features/string/starts-with.js b/core-js/features/string/starts-with.js new file mode 100644 index 0000000000..6b4598b5c7 --- /dev/null +++ b/core-js/features/string/starts-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/starts-with'); diff --git a/core-js/features/string/strike.js b/core-js/features/string/strike.js new file mode 100644 index 0000000000..6e2154628d --- /dev/null +++ b/core-js/features/string/strike.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/strike'); diff --git a/core-js/features/string/sub.js b/core-js/features/string/sub.js new file mode 100644 index 0000000000..0f5d2e37e7 --- /dev/null +++ b/core-js/features/string/sub.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/sub'); diff --git a/core-js/features/string/sup.js b/core-js/features/string/sup.js new file mode 100644 index 0000000000..9e6d1fff69 --- /dev/null +++ b/core-js/features/string/sup.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/sup'); diff --git a/core-js/features/string/trim-end.js b/core-js/features/string/trim-end.js new file mode 100644 index 0000000000..3fe1209064 --- /dev/null +++ b/core-js/features/string/trim-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-end'); diff --git a/core-js/features/string/trim-left.js b/core-js/features/string/trim-left.js new file mode 100644 index 0000000000..2260e53ec9 --- /dev/null +++ b/core-js/features/string/trim-left.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-left'); diff --git a/core-js/features/string/trim-right.js b/core-js/features/string/trim-right.js new file mode 100644 index 0000000000..5ec4c3b29b --- /dev/null +++ b/core-js/features/string/trim-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-right'); diff --git a/core-js/features/string/trim-start.js b/core-js/features/string/trim-start.js new file mode 100644 index 0000000000..75e8212f6a --- /dev/null +++ b/core-js/features/string/trim-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-start'); diff --git a/core-js/features/string/trim.js b/core-js/features/string/trim.js new file mode 100644 index 0000000000..8231ac80bc --- /dev/null +++ b/core-js/features/string/trim.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim'); diff --git a/core-js/features/string/virtual/anchor.js b/core-js/features/string/virtual/anchor.js new file mode 100644 index 0000000000..1d3b8b8764 --- /dev/null +++ b/core-js/features/string/virtual/anchor.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/anchor'); diff --git a/core-js/features/string/virtual/at.js b/core-js/features/string/virtual/at.js new file mode 100644 index 0000000000..c78ec2c2d8 --- /dev/null +++ b/core-js/features/string/virtual/at.js @@ -0,0 +1,4 @@ +require('../../../modules/esnext.string.at'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').at; diff --git a/core-js/features/string/virtual/big.js b/core-js/features/string/virtual/big.js new file mode 100644 index 0000000000..cb8c788448 --- /dev/null +++ b/core-js/features/string/virtual/big.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/big'); diff --git a/core-js/features/string/virtual/blink.js b/core-js/features/string/virtual/blink.js new file mode 100644 index 0000000000..d4ad1b8239 --- /dev/null +++ b/core-js/features/string/virtual/blink.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/blink'); diff --git a/core-js/features/string/virtual/bold.js b/core-js/features/string/virtual/bold.js new file mode 100644 index 0000000000..58ff2fa275 --- /dev/null +++ b/core-js/features/string/virtual/bold.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/bold'); diff --git a/core-js/features/string/virtual/code-point-at.js b/core-js/features/string/virtual/code-point-at.js new file mode 100644 index 0000000000..a23f0a7913 --- /dev/null +++ b/core-js/features/string/virtual/code-point-at.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/code-point-at'); diff --git a/core-js/features/string/virtual/code-points.js b/core-js/features/string/virtual/code-points.js new file mode 100644 index 0000000000..e99051653c --- /dev/null +++ b/core-js/features/string/virtual/code-points.js @@ -0,0 +1,3 @@ +require('../../../modules/esnext.string.code-points'); + +module.exports = require('../../../internals/entry-virtual')('String').codePoints; diff --git a/core-js/features/string/virtual/ends-with.js b/core-js/features/string/virtual/ends-with.js new file mode 100644 index 0000000000..e7c2d360c4 --- /dev/null +++ b/core-js/features/string/virtual/ends-with.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/ends-with'); diff --git a/core-js/features/string/virtual/fixed.js b/core-js/features/string/virtual/fixed.js new file mode 100644 index 0000000000..adcae23a3b --- /dev/null +++ b/core-js/features/string/virtual/fixed.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/fixed'); diff --git a/core-js/features/string/virtual/fontcolor.js b/core-js/features/string/virtual/fontcolor.js new file mode 100644 index 0000000000..c0435a264e --- /dev/null +++ b/core-js/features/string/virtual/fontcolor.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/fontcolor'); diff --git a/core-js/features/string/virtual/fontsize.js b/core-js/features/string/virtual/fontsize.js new file mode 100644 index 0000000000..0952c468bd --- /dev/null +++ b/core-js/features/string/virtual/fontsize.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/fontsize'); diff --git a/core-js/features/string/virtual/includes.js b/core-js/features/string/virtual/includes.js new file mode 100644 index 0000000000..671747b853 --- /dev/null +++ b/core-js/features/string/virtual/includes.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/includes'); diff --git a/core-js/features/string/virtual/index.js b/core-js/features/string/virtual/index.js new file mode 100644 index 0000000000..d3f9104f65 --- /dev/null +++ b/core-js/features/string/virtual/index.js @@ -0,0 +1,6 @@ +module.exports = require('../../../es/string/virtual'); + +require('../../../modules/esnext.string.at'); +// TODO: remove from `core-js@4` +require('../../../modules/esnext.string.match-all'); +require('../../../modules/esnext.string.replace-all'); diff --git a/core-js/features/string/virtual/italics.js b/core-js/features/string/virtual/italics.js new file mode 100644 index 0000000000..b7e72cdbaf --- /dev/null +++ b/core-js/features/string/virtual/italics.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/italics'); diff --git a/core-js/features/string/virtual/iterator.js b/core-js/features/string/virtual/iterator.js new file mode 100644 index 0000000000..f52320e511 --- /dev/null +++ b/core-js/features/string/virtual/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/iterator'); diff --git a/core-js/features/string/virtual/link.js b/core-js/features/string/virtual/link.js new file mode 100644 index 0000000000..20fe8ab879 --- /dev/null +++ b/core-js/features/string/virtual/link.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/link'); diff --git a/core-js/features/string/virtual/match-all.js b/core-js/features/string/virtual/match-all.js new file mode 100644 index 0000000000..d6da16859c --- /dev/null +++ b/core-js/features/string/virtual/match-all.js @@ -0,0 +1,4 @@ +// TODO: remove from `core-js@4` +require('../../../modules/esnext.string.match-all'); + +module.exports = require('../../../es/string/virtual/match-all'); diff --git a/core-js/features/string/virtual/pad-end.js b/core-js/features/string/virtual/pad-end.js new file mode 100644 index 0000000000..128a7ee403 --- /dev/null +++ b/core-js/features/string/virtual/pad-end.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/pad-end'); diff --git a/core-js/features/string/virtual/pad-start.js b/core-js/features/string/virtual/pad-start.js new file mode 100644 index 0000000000..a5e86e81f5 --- /dev/null +++ b/core-js/features/string/virtual/pad-start.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/pad-start'); diff --git a/core-js/features/string/virtual/repeat.js b/core-js/features/string/virtual/repeat.js new file mode 100644 index 0000000000..591cbfdbff --- /dev/null +++ b/core-js/features/string/virtual/repeat.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/repeat'); diff --git a/core-js/features/string/virtual/replace-all.js b/core-js/features/string/virtual/replace-all.js new file mode 100644 index 0000000000..781f261d38 --- /dev/null +++ b/core-js/features/string/virtual/replace-all.js @@ -0,0 +1,4 @@ +require('../../../modules/esnext.string.replace-all'); +var entryVirtual = require('../../../internals/entry-virtual'); + +module.exports = entryVirtual('String').replaceAll; diff --git a/core-js/features/string/virtual/small.js b/core-js/features/string/virtual/small.js new file mode 100644 index 0000000000..4c5373075b --- /dev/null +++ b/core-js/features/string/virtual/small.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/small'); diff --git a/core-js/features/string/virtual/starts-with.js b/core-js/features/string/virtual/starts-with.js new file mode 100644 index 0000000000..9722995139 --- /dev/null +++ b/core-js/features/string/virtual/starts-with.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/starts-with'); diff --git a/core-js/features/string/virtual/strike.js b/core-js/features/string/virtual/strike.js new file mode 100644 index 0000000000..3570027d84 --- /dev/null +++ b/core-js/features/string/virtual/strike.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/strike'); diff --git a/core-js/features/string/virtual/sub.js b/core-js/features/string/virtual/sub.js new file mode 100644 index 0000000000..d3a9c6e534 --- /dev/null +++ b/core-js/features/string/virtual/sub.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/sub'); diff --git a/core-js/features/string/virtual/sup.js b/core-js/features/string/virtual/sup.js new file mode 100644 index 0000000000..a2fe71dff0 --- /dev/null +++ b/core-js/features/string/virtual/sup.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/sup'); diff --git a/core-js/features/string/virtual/trim-end.js b/core-js/features/string/virtual/trim-end.js new file mode 100644 index 0000000000..f450167c55 --- /dev/null +++ b/core-js/features/string/virtual/trim-end.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-end'); diff --git a/core-js/features/string/virtual/trim-left.js b/core-js/features/string/virtual/trim-left.js new file mode 100644 index 0000000000..515e7e507c --- /dev/null +++ b/core-js/features/string/virtual/trim-left.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-left'); diff --git a/core-js/features/string/virtual/trim-right.js b/core-js/features/string/virtual/trim-right.js new file mode 100644 index 0000000000..8823454fa3 --- /dev/null +++ b/core-js/features/string/virtual/trim-right.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-right'); diff --git a/core-js/features/string/virtual/trim-start.js b/core-js/features/string/virtual/trim-start.js new file mode 100644 index 0000000000..3afb6eff83 --- /dev/null +++ b/core-js/features/string/virtual/trim-start.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-start'); diff --git a/core-js/features/string/virtual/trim.js b/core-js/features/string/virtual/trim.js new file mode 100644 index 0000000000..12a266abbf --- /dev/null +++ b/core-js/features/string/virtual/trim.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim'); diff --git a/core-js/features/symbol/async-dispose.js b/core-js/features/symbol/async-dispose.js new file mode 100644 index 0000000000..39fde3708e --- /dev/null +++ b/core-js/features/symbol/async-dispose.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.symbol.async-dispose'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('asyncDispose'); diff --git a/core-js/features/symbol/async-iterator.js b/core-js/features/symbol/async-iterator.js new file mode 100644 index 0000000000..2d69e19ca2 --- /dev/null +++ b/core-js/features/symbol/async-iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/async-iterator'); diff --git a/core-js/features/symbol/description.js b/core-js/features/symbol/description.js new file mode 100644 index 0000000000..7bb4b2bc9c --- /dev/null +++ b/core-js/features/symbol/description.js @@ -0,0 +1 @@ +require('../../modules/es.symbol.description'); diff --git a/core-js/features/symbol/dispose.js b/core-js/features/symbol/dispose.js new file mode 100644 index 0000000000..09ba080f77 --- /dev/null +++ b/core-js/features/symbol/dispose.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.symbol.dispose'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('dispose'); diff --git a/core-js/features/symbol/for.js b/core-js/features/symbol/for.js new file mode 100644 index 0000000000..58633a4ba9 --- /dev/null +++ b/core-js/features/symbol/for.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/for'); diff --git a/core-js/features/symbol/has-instance.js b/core-js/features/symbol/has-instance.js new file mode 100644 index 0000000000..82bca7ec27 --- /dev/null +++ b/core-js/features/symbol/has-instance.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/has-instance'); diff --git a/core-js/features/symbol/index.js b/core-js/features/symbol/index.js new file mode 100644 index 0000000000..8d801b77f8 --- /dev/null +++ b/core-js/features/symbol/index.js @@ -0,0 +1,7 @@ +module.exports = require('../../es/symbol'); + +require('../../modules/esnext.symbol.async-dispose'); +require('../../modules/esnext.symbol.dispose'); +require('../../modules/esnext.symbol.observable'); +require('../../modules/esnext.symbol.pattern-match'); +require('../../modules/esnext.symbol.replace-all'); diff --git a/core-js/features/symbol/is-concat-spreadable.js b/core-js/features/symbol/is-concat-spreadable.js new file mode 100644 index 0000000000..ce3514e1a2 --- /dev/null +++ b/core-js/features/symbol/is-concat-spreadable.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/is-concat-spreadable'); diff --git a/core-js/features/symbol/iterator.js b/core-js/features/symbol/iterator.js new file mode 100644 index 0000000000..1a102a6c57 --- /dev/null +++ b/core-js/features/symbol/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/iterator'); diff --git a/core-js/features/symbol/key-for.js b/core-js/features/symbol/key-for.js new file mode 100644 index 0000000000..c66cab7e90 --- /dev/null +++ b/core-js/features/symbol/key-for.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/key-for'); diff --git a/core-js/features/symbol/match-all.js b/core-js/features/symbol/match-all.js new file mode 100644 index 0000000000..66730fe290 --- /dev/null +++ b/core-js/features/symbol/match-all.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/match-all'); diff --git a/core-js/features/symbol/match.js b/core-js/features/symbol/match.js new file mode 100644 index 0000000000..66c5805a5e --- /dev/null +++ b/core-js/features/symbol/match.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/match'); diff --git a/core-js/features/symbol/observable.js b/core-js/features/symbol/observable.js new file mode 100644 index 0000000000..f16e2ce550 --- /dev/null +++ b/core-js/features/symbol/observable.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.symbol.observable'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('observable'); diff --git a/core-js/features/symbol/pattern-match.js b/core-js/features/symbol/pattern-match.js new file mode 100644 index 0000000000..0ccbf594b2 --- /dev/null +++ b/core-js/features/symbol/pattern-match.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.symbol.pattern-match'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('patternMatch'); diff --git a/core-js/features/symbol/replace-all.js b/core-js/features/symbol/replace-all.js new file mode 100644 index 0000000000..570e04a6d6 --- /dev/null +++ b/core-js/features/symbol/replace-all.js @@ -0,0 +1,4 @@ +require('../../modules/esnext.symbol.replace-all'); +var WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol'); + +module.exports = WrappedWellKnownSymbolModule.f('replaceAll'); diff --git a/core-js/features/symbol/replace.js b/core-js/features/symbol/replace.js new file mode 100644 index 0000000000..85324c9231 --- /dev/null +++ b/core-js/features/symbol/replace.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/replace'); diff --git a/core-js/features/symbol/search.js b/core-js/features/symbol/search.js new file mode 100644 index 0000000000..33772f66be --- /dev/null +++ b/core-js/features/symbol/search.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/search'); diff --git a/core-js/features/symbol/species.js b/core-js/features/symbol/species.js new file mode 100644 index 0000000000..87979c67e3 --- /dev/null +++ b/core-js/features/symbol/species.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/species'); diff --git a/core-js/features/symbol/split.js b/core-js/features/symbol/split.js new file mode 100644 index 0000000000..c3855a3005 --- /dev/null +++ b/core-js/features/symbol/split.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/split'); diff --git a/core-js/features/symbol/to-primitive.js b/core-js/features/symbol/to-primitive.js new file mode 100644 index 0000000000..1fbb427471 --- /dev/null +++ b/core-js/features/symbol/to-primitive.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/to-primitive'); diff --git a/core-js/features/symbol/to-string-tag.js b/core-js/features/symbol/to-string-tag.js new file mode 100644 index 0000000000..eeeb3a1354 --- /dev/null +++ b/core-js/features/symbol/to-string-tag.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/to-string-tag'); diff --git a/core-js/features/symbol/unscopables.js b/core-js/features/symbol/unscopables.js new file mode 100644 index 0000000000..7ae091b300 --- /dev/null +++ b/core-js/features/symbol/unscopables.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/unscopables'); diff --git a/core-js/features/typed-array/copy-within.js b/core-js/features/typed-array/copy-within.js new file mode 100644 index 0000000000..1352cec72f --- /dev/null +++ b/core-js/features/typed-array/copy-within.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.copy-within'); diff --git a/core-js/features/typed-array/entries.js b/core-js/features/typed-array/entries.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/features/typed-array/entries.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/features/typed-array/every.js b/core-js/features/typed-array/every.js new file mode 100644 index 0000000000..681164be00 --- /dev/null +++ b/core-js/features/typed-array/every.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.every'); diff --git a/core-js/features/typed-array/fill.js b/core-js/features/typed-array/fill.js new file mode 100644 index 0000000000..4d92ac6654 --- /dev/null +++ b/core-js/features/typed-array/fill.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.fill'); diff --git a/core-js/features/typed-array/filter.js b/core-js/features/typed-array/filter.js new file mode 100644 index 0000000000..7d0a630ffa --- /dev/null +++ b/core-js/features/typed-array/filter.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.filter'); diff --git a/core-js/features/typed-array/find-index.js b/core-js/features/typed-array/find-index.js new file mode 100644 index 0000000000..039cd5edde --- /dev/null +++ b/core-js/features/typed-array/find-index.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.find-index'); diff --git a/core-js/features/typed-array/find.js b/core-js/features/typed-array/find.js new file mode 100644 index 0000000000..b3251b9a04 --- /dev/null +++ b/core-js/features/typed-array/find.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.find'); diff --git a/core-js/features/typed-array/float32-array.js b/core-js/features/typed-array/float32-array.js new file mode 100644 index 0000000000..78c91f0a78 --- /dev/null +++ b/core-js/features/typed-array/float32-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/float32-array'); diff --git a/core-js/features/typed-array/float64-array.js b/core-js/features/typed-array/float64-array.js new file mode 100644 index 0000000000..cb90104de0 --- /dev/null +++ b/core-js/features/typed-array/float64-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/float64-array'); diff --git a/core-js/features/typed-array/for-each.js b/core-js/features/typed-array/for-each.js new file mode 100644 index 0000000000..defe03a8dc --- /dev/null +++ b/core-js/features/typed-array/for-each.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.for-each'); diff --git a/core-js/features/typed-array/from.js b/core-js/features/typed-array/from.js new file mode 100644 index 0000000000..e0f34441d1 --- /dev/null +++ b/core-js/features/typed-array/from.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.from'); diff --git a/core-js/features/typed-array/includes.js b/core-js/features/typed-array/includes.js new file mode 100644 index 0000000000..5ff65f9645 --- /dev/null +++ b/core-js/features/typed-array/includes.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.includes'); diff --git a/core-js/features/typed-array/index-of.js b/core-js/features/typed-array/index-of.js new file mode 100644 index 0000000000..87081c0f2b --- /dev/null +++ b/core-js/features/typed-array/index-of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.index-of'); diff --git a/core-js/features/typed-array/index.js b/core-js/features/typed-array/index.js new file mode 100644 index 0000000000..f3ded39d59 --- /dev/null +++ b/core-js/features/typed-array/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array'); diff --git a/core-js/features/typed-array/int16-array.js b/core-js/features/typed-array/int16-array.js new file mode 100644 index 0000000000..d083357db0 --- /dev/null +++ b/core-js/features/typed-array/int16-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/int16-array'); diff --git a/core-js/features/typed-array/int32-array.js b/core-js/features/typed-array/int32-array.js new file mode 100644 index 0000000000..365a971501 --- /dev/null +++ b/core-js/features/typed-array/int32-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/int32-array'); diff --git a/core-js/features/typed-array/int8-array.js b/core-js/features/typed-array/int8-array.js new file mode 100644 index 0000000000..0b9f28c6e1 --- /dev/null +++ b/core-js/features/typed-array/int8-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/int8-array'); diff --git a/core-js/features/typed-array/iterator.js b/core-js/features/typed-array/iterator.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/features/typed-array/iterator.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/features/typed-array/join.js b/core-js/features/typed-array/join.js new file mode 100644 index 0000000000..431129c92f --- /dev/null +++ b/core-js/features/typed-array/join.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.join'); diff --git a/core-js/features/typed-array/keys.js b/core-js/features/typed-array/keys.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/features/typed-array/keys.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/features/typed-array/last-index-of.js b/core-js/features/typed-array/last-index-of.js new file mode 100644 index 0000000000..5682bf44ea --- /dev/null +++ b/core-js/features/typed-array/last-index-of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.last-index-of'); diff --git a/core-js/features/typed-array/map.js b/core-js/features/typed-array/map.js new file mode 100644 index 0000000000..db08fed371 --- /dev/null +++ b/core-js/features/typed-array/map.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.map'); diff --git a/core-js/features/typed-array/of.js b/core-js/features/typed-array/of.js new file mode 100644 index 0000000000..121bf5e2d6 --- /dev/null +++ b/core-js/features/typed-array/of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.of'); diff --git a/core-js/features/typed-array/reduce-right.js b/core-js/features/typed-array/reduce-right.js new file mode 100644 index 0000000000..cbd321fc62 --- /dev/null +++ b/core-js/features/typed-array/reduce-right.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reduce-right'); diff --git a/core-js/features/typed-array/reduce.js b/core-js/features/typed-array/reduce.js new file mode 100644 index 0000000000..e2a6f28283 --- /dev/null +++ b/core-js/features/typed-array/reduce.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reduce'); diff --git a/core-js/features/typed-array/reverse.js b/core-js/features/typed-array/reverse.js new file mode 100644 index 0000000000..14995f497b --- /dev/null +++ b/core-js/features/typed-array/reverse.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reverse'); diff --git a/core-js/features/typed-array/set.js b/core-js/features/typed-array/set.js new file mode 100644 index 0000000000..5330e22983 --- /dev/null +++ b/core-js/features/typed-array/set.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.set'); diff --git a/core-js/features/typed-array/slice.js b/core-js/features/typed-array/slice.js new file mode 100644 index 0000000000..37fb8c141a --- /dev/null +++ b/core-js/features/typed-array/slice.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.slice'); diff --git a/core-js/features/typed-array/some.js b/core-js/features/typed-array/some.js new file mode 100644 index 0000000000..495c322f7d --- /dev/null +++ b/core-js/features/typed-array/some.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.some'); diff --git a/core-js/features/typed-array/sort.js b/core-js/features/typed-array/sort.js new file mode 100644 index 0000000000..d6c7e30b99 --- /dev/null +++ b/core-js/features/typed-array/sort.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.sort'); diff --git a/core-js/features/typed-array/subarray.js b/core-js/features/typed-array/subarray.js new file mode 100644 index 0000000000..dbad4ca2d6 --- /dev/null +++ b/core-js/features/typed-array/subarray.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.subarray'); diff --git a/core-js/features/typed-array/to-locale-string.js b/core-js/features/typed-array/to-locale-string.js new file mode 100644 index 0000000000..12c809e233 --- /dev/null +++ b/core-js/features/typed-array/to-locale-string.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.to-locale-string'); diff --git a/core-js/features/typed-array/to-string.js b/core-js/features/typed-array/to-string.js new file mode 100644 index 0000000000..bf9416079f --- /dev/null +++ b/core-js/features/typed-array/to-string.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.to-string'); diff --git a/core-js/features/typed-array/uint16-array.js b/core-js/features/typed-array/uint16-array.js new file mode 100644 index 0000000000..5ef2cb4977 --- /dev/null +++ b/core-js/features/typed-array/uint16-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint16-array'); diff --git a/core-js/features/typed-array/uint32-array.js b/core-js/features/typed-array/uint32-array.js new file mode 100644 index 0000000000..f84c728f6d --- /dev/null +++ b/core-js/features/typed-array/uint32-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint32-array'); diff --git a/core-js/features/typed-array/uint8-array.js b/core-js/features/typed-array/uint8-array.js new file mode 100644 index 0000000000..29dbfd6f92 --- /dev/null +++ b/core-js/features/typed-array/uint8-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint8-array'); diff --git a/core-js/features/typed-array/uint8-clamped-array.js b/core-js/features/typed-array/uint8-clamped-array.js new file mode 100644 index 0000000000..8fcc6497ab --- /dev/null +++ b/core-js/features/typed-array/uint8-clamped-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint8-clamped-array'); diff --git a/core-js/features/typed-array/values.js b/core-js/features/typed-array/values.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/features/typed-array/values.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/features/url-search-params/index.js b/core-js/features/url-search-params/index.js new file mode 100644 index 0000000000..35f1b59f7f --- /dev/null +++ b/core-js/features/url-search-params/index.js @@ -0,0 +1 @@ +module.exports = require('../../stable/url-search-params'); diff --git a/core-js/features/url/index.js b/core-js/features/url/index.js new file mode 100644 index 0000000000..8f9ef4f777 --- /dev/null +++ b/core-js/features/url/index.js @@ -0,0 +1 @@ +module.exports = require('../../stable/url'); diff --git a/core-js/features/url/to-json.js b/core-js/features/url/to-json.js new file mode 100644 index 0000000000..74b9809ffb --- /dev/null +++ b/core-js/features/url/to-json.js @@ -0,0 +1 @@ +module.exports = require('../../stable/url/to-json'); diff --git a/core-js/features/weak-map/delete-all.js b/core-js/features/weak-map/delete-all.js new file mode 100644 index 0000000000..00163f2d09 --- /dev/null +++ b/core-js/features/weak-map/delete-all.js @@ -0,0 +1,5 @@ +require('../../modules/es.weak-map'); +require('../../modules/esnext.weak-map.delete-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('WeakMap', 'deleteAll'); diff --git a/core-js/features/weak-map/from.js b/core-js/features/weak-map/from.js new file mode 100644 index 0000000000..159aecd7cb --- /dev/null +++ b/core-js/features/weak-map/from.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.string.iterator'); +require('../../modules/es.weak-map'); +require('../../modules/esnext.weak-map.from'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var WeakMap = path.WeakMap; +var weakMapFrom = WeakMap.from; + +module.exports = function from(source, mapFn, thisArg) { + return weakMapFrom.call(typeof this === 'function' ? this : WeakMap, source, mapFn, thisArg); +}; diff --git a/core-js/features/weak-map/index.js b/core-js/features/weak-map/index.js new file mode 100644 index 0000000000..a4f4bae85a --- /dev/null +++ b/core-js/features/weak-map/index.js @@ -0,0 +1,5 @@ +module.exports = require('../../es/weak-map'); + +require('../../modules/esnext.weak-map.from'); +require('../../modules/esnext.weak-map.of'); +require('../../modules/esnext.weak-map.delete-all'); diff --git a/core-js/features/weak-map/of.js b/core-js/features/weak-map/of.js new file mode 100644 index 0000000000..5bdf627e8b --- /dev/null +++ b/core-js/features/weak-map/of.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.string.iterator'); +require('../../modules/es.weak-map'); +require('../../modules/esnext.weak-map.of'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var WeakMap = path.WeakMap; +var weakMapOf = WeakMap.of; + +module.exports = function of() { + return weakMapOf.apply(typeof this === 'function' ? this : WeakMap, arguments); +}; diff --git a/core-js/features/weak-set/add-all.js b/core-js/features/weak-set/add-all.js new file mode 100644 index 0000000000..cf7624292f --- /dev/null +++ b/core-js/features/weak-set/add-all.js @@ -0,0 +1,5 @@ +require('../../modules/es.weak-set'); +require('../../modules/esnext.weak-set.add-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('WeakSet', 'addAll'); diff --git a/core-js/features/weak-set/delete-all.js b/core-js/features/weak-set/delete-all.js new file mode 100644 index 0000000000..21e7b43800 --- /dev/null +++ b/core-js/features/weak-set/delete-all.js @@ -0,0 +1,5 @@ +require('../../modules/es.weak-set'); +require('../../modules/esnext.weak-set.delete-all'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('WeakSet', 'deleteAll'); diff --git a/core-js/features/weak-set/from.js b/core-js/features/weak-set/from.js new file mode 100644 index 0000000000..cd8716af43 --- /dev/null +++ b/core-js/features/weak-set/from.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.string.iterator'); +require('../../modules/es.weak-set'); +require('../../modules/esnext.weak-set.from'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var WeakSet = path.WeakSet; +var weakSetfrom = WeakSet.from; + +module.exports = function from(source, mapFn, thisArg) { + return weakSetfrom.call(typeof this === 'function' ? this : WeakSet, source, mapFn, thisArg); +}; diff --git a/core-js/features/weak-set/index.js b/core-js/features/weak-set/index.js new file mode 100644 index 0000000000..3cbfc7c01a --- /dev/null +++ b/core-js/features/weak-set/index.js @@ -0,0 +1,6 @@ +module.exports = require('../../es/weak-set'); + +require('../../modules/esnext.weak-set.add-all'); +require('../../modules/esnext.weak-set.delete-all'); +require('../../modules/esnext.weak-set.from'); +require('../../modules/esnext.weak-set.of'); diff --git a/core-js/features/weak-set/of.js b/core-js/features/weak-set/of.js new file mode 100644 index 0000000000..4937c39b7a --- /dev/null +++ b/core-js/features/weak-set/of.js @@ -0,0 +1,13 @@ +'use strict'; +require('../../modules/es.string.iterator'); +require('../../modules/es.weak-set'); +require('../../modules/esnext.weak-set.of'); +require('../../modules/web.dom-collections.iterator'); +var path = require('../../internals/path'); + +var WeakSet = path.WeakSet; +var weakSetOf = WeakSet.of; + +module.exports = function of() { + return weakSetOf.apply(typeof this === 'function' ? this : WeakSet, arguments); +}; diff --git a/core-js/index.js b/core-js/index.js new file mode 100644 index 0000000000..cbaed8cac3 --- /dev/null +++ b/core-js/index.js @@ -0,0 +1,5 @@ +require('./es'); +require('./proposals'); +require('./web'); + +module.exports = require('./internals/path'); diff --git a/core-js/internals/README.md b/core-js/internals/README.md new file mode 100644 index 0000000000..f5cca304ca --- /dev/null +++ b/core-js/internals/README.md @@ -0,0 +1 @@ +This folder contains internal parts of `core-js` like helpers. diff --git a/core-js/internals/a-function.js b/core-js/internals/a-function.js new file mode 100644 index 0000000000..b597471f9c --- /dev/null +++ b/core-js/internals/a-function.js @@ -0,0 +1,5 @@ +module.exports = function (it) { + if (typeof it != 'function') { + throw TypeError(String(it) + ' is not a function'); + } return it; +}; diff --git a/core-js/internals/a-possible-prototype.js b/core-js/internals/a-possible-prototype.js new file mode 100644 index 0000000000..7736376e9d --- /dev/null +++ b/core-js/internals/a-possible-prototype.js @@ -0,0 +1,7 @@ +var isObject = require('../internals/is-object'); + +module.exports = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError("Can't set " + String(it) + ' as a prototype'); + } return it; +}; diff --git a/core-js/internals/add-to-unscopables.js b/core-js/internals/add-to-unscopables.js new file mode 100644 index 0000000000..54043cf7b8 --- /dev/null +++ b/core-js/internals/add-to-unscopables.js @@ -0,0 +1,17 @@ +var wellKnownSymbol = require('../internals/well-known-symbol'); +var create = require('../internals/object-create'); +var hide = require('../internals/hide'); + +var UNSCOPABLES = wellKnownSymbol('unscopables'); +var ArrayPrototype = Array.prototype; + +// Array.prototype[@@unscopables] +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +if (ArrayPrototype[UNSCOPABLES] == undefined) { + hide(ArrayPrototype, UNSCOPABLES, create(null)); +} + +// add a key to Array.prototype[@@unscopables] +module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; +}; diff --git a/core-js/internals/advance-string-index.js b/core-js/internals/advance-string-index.js new file mode 100644 index 0000000000..700fbf012a --- /dev/null +++ b/core-js/internals/advance-string-index.js @@ -0,0 +1,8 @@ +'use strict'; +var charAt = require('../internals/string-multibyte').charAt; + +// `AdvanceStringIndex` abstract operation +// https://tc39.github.io/ecma262/#sec-advancestringindex +module.exports = function (S, index, unicode) { + return index + (unicode ? charAt(S, index).length : 1); +}; diff --git a/core-js/internals/an-instance.js b/core-js/internals/an-instance.js new file mode 100644 index 0000000000..6f471ccf9f --- /dev/null +++ b/core-js/internals/an-instance.js @@ -0,0 +1,5 @@ +module.exports = function (it, Constructor, name) { + if (!(it instanceof Constructor)) { + throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); + } return it; +}; diff --git a/core-js/internals/an-object.js b/core-js/internals/an-object.js new file mode 100644 index 0000000000..40557966d5 --- /dev/null +++ b/core-js/internals/an-object.js @@ -0,0 +1,7 @@ +var isObject = require('../internals/is-object'); + +module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + ' is not an object'); + } return it; +}; diff --git a/core-js/internals/array-buffer-view-core.js b/core-js/internals/array-buffer-view-core.js new file mode 100644 index 0000000000..30934d6073 --- /dev/null +++ b/core-js/internals/array-buffer-view-core.js @@ -0,0 +1,164 @@ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var isObject = require('../internals/is-object'); +var has = require('../internals/has'); +var classof = require('../internals/classof'); +var hide = require('../internals/hide'); +var redefine = require('../internals/redefine'); +var defineProperty = require('../internals/object-define-property').f; +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var uid = require('../internals/uid'); + +var DataView = global.DataView; +var DataViewPrototype = DataView && DataView.prototype; +var Int8Array = global.Int8Array; +var Int8ArrayPrototype = Int8Array && Int8Array.prototype; +var Uint8ClampedArray = global.Uint8ClampedArray; +var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; +var TypedArray = Int8Array && getPrototypeOf(Int8Array); +var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); +var ObjectPrototype = Object.prototype; +var isPrototypeOf = ObjectPrototype.isPrototypeOf; + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); +var NATIVE_ARRAY_BUFFER = !!(global.ArrayBuffer && DataView); +// Fixing native typed arrays in Opera Presto crashes the browser, see #595 +var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; +var TYPED_ARRAY_TAG_REQIRED = false; +var NAME; + +var TypedArrayConstructorsList = { + Int8Array: 1, + Uint8Array: 1, + Uint8ClampedArray: 1, + Int16Array: 2, + Uint16Array: 2, + Int32Array: 4, + Uint32Array: 4, + Float32Array: 4, + Float64Array: 8 +}; + +var isView = function isView(it) { + var klass = classof(it); + return klass === 'DataView' || has(TypedArrayConstructorsList, klass); +}; + +var isTypedArray = function (it) { + return isObject(it) && has(TypedArrayConstructorsList, classof(it)); +}; + +var aTypedArray = function (it) { + if (isTypedArray(it)) return it; + throw TypeError('Target is not a typed array'); +}; + +var aTypedArrayConstructor = function (C) { + if (setPrototypeOf) { + if (isPrototypeOf.call(TypedArray, C)) return C; + } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) { + return C; + } + } throw TypeError('Target is not a typed array constructor'); +}; + +var exportProto = function (KEY, property, forced) { + if (!DESCRIPTORS) return; + if (forced) for (var ARRAY in TypedArrayConstructorsList) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) { + delete TypedArrayConstructor.prototype[KEY]; + } + } + if (!TypedArrayPrototype[KEY] || forced) { + redefine(TypedArrayPrototype, KEY, forced ? property + : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property); + } +}; + +var exportStatic = function (KEY, property, forced) { + var ARRAY, TypedArrayConstructor; + if (!DESCRIPTORS) return; + if (setPrototypeOf) { + if (forced) for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) { + delete TypedArrayConstructor[KEY]; + } + } + if (!TypedArray[KEY] || forced) { + // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable + try { + return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property); + } catch (error) { /* empty */ } + } else return; + } + for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { + redefine(TypedArrayConstructor, KEY, property); + } + } +}; + +for (NAME in TypedArrayConstructorsList) { + if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false; +} + +// WebKit bug - typed arrays constructors prototype is Object.prototype +if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) { + // eslint-disable-next-line no-shadow + TypedArray = function TypedArray() { + throw TypeError('Incorrect invocation'); + }; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); + } +} + +if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { + TypedArrayPrototype = TypedArray.prototype; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); + } +} + +// WebKit bug - one more object in Uint8ClampedArray prototype chain +if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { + setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); +} + +if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) { + TYPED_ARRAY_TAG_REQIRED = true; + defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () { + return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; + } }); + for (NAME in TypedArrayConstructorsList) if (global[NAME]) { + hide(global[NAME], TYPED_ARRAY_TAG, NAME); + } +} + +// WebKit bug - the same parent prototype for typed arrays and data view +if (NATIVE_ARRAY_BUFFER && setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) { + setPrototypeOf(DataViewPrototype, ObjectPrototype); +} + +module.exports = { + NATIVE_ARRAY_BUFFER: NATIVE_ARRAY_BUFFER, + NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, + aTypedArray: aTypedArray, + aTypedArrayConstructor: aTypedArrayConstructor, + exportProto: exportProto, + exportStatic: exportStatic, + isView: isView, + isTypedArray: isTypedArray, + TypedArray: TypedArray, + TypedArrayPrototype: TypedArrayPrototype +}; diff --git a/core-js/internals/array-buffer.js b/core-js/internals/array-buffer.js new file mode 100644 index 0000000000..731c55addf --- /dev/null +++ b/core-js/internals/array-buffer.js @@ -0,0 +1,293 @@ +'use strict'; +var global = require('../internals/global'); +var DESCRIPTORS = require('../internals/descriptors'); +var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER; +var hide = require('../internals/hide'); +var redefineAll = require('../internals/redefine-all'); +var fails = require('../internals/fails'); +var anInstance = require('../internals/an-instance'); +var toInteger = require('../internals/to-integer'); +var toLength = require('../internals/to-length'); +var toIndex = require('../internals/to-index'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var defineProperty = require('../internals/object-define-property').f; +var arrayFill = require('../internals/array-fill'); +var setToStringTag = require('../internals/set-to-string-tag'); +var InternalStateModule = require('../internals/internal-state'); + +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length'; +var WRONG_INDEX = 'Wrong index'; +var NativeArrayBuffer = global[ARRAY_BUFFER]; +var $ArrayBuffer = NativeArrayBuffer; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = 1 / 0; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +var packIEEE754 = function (number, mantissaLength, bytes) { + var buffer = new Array(bytes); + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; + var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; + var index = 0; + var exponent, mantissa, c; + number = abs(number); + // eslint-disable-next-line no-self-compare + if (number != number || number === Infinity) { + // eslint-disable-next-line no-self-compare + mantissa = number != number ? 1 : 0; + exponent = eMax; + } else { + exponent = floor(log(number) / LN2); + if (number * (c = pow(2, -exponent)) < 1) { + exponent--; + c *= 2; + } + if (exponent + eBias >= 1) { + number += rt / c; + } else { + number += rt * pow(2, 1 - eBias); + } + if (number * c >= 2) { + exponent++; + c /= 2; + } + if (exponent + eBias >= eMax) { + mantissa = 0; + exponent = eMax; + } else if (exponent + eBias >= 1) { + mantissa = (number * c - 1) * pow(2, mantissaLength); + exponent = exponent + eBias; + } else { + mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); + exponent = 0; + } + } + for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8); + exponent = exponent << mantissaLength | mantissa; + exponentLength += mantissaLength; + for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8); + buffer[--index] |= sign * 128; + return buffer; +}; + +var unpackIEEE754 = function (buffer, mantissaLength) { + var bytes = buffer.length; + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var nBits = exponentLength - 7; + var index = bytes - 1; + var sign = buffer[index--]; + var exponent = sign & 127; + var mantissa; + sign >>= 7; + for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8); + mantissa = exponent & (1 << -nBits) - 1; + exponent >>= -nBits; + nBits += mantissaLength; + for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8); + if (exponent === 0) { + exponent = 1 - eBias; + } else if (exponent === eMax) { + return mantissa ? NaN : sign ? -Infinity : Infinity; + } else { + mantissa = mantissa + pow(2, mantissaLength); + exponent = exponent - eBias; + } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); +}; + +var unpackInt32 = function (buffer) { + return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; +}; + +var packInt8 = function (number) { + return [number & 0xFF]; +}; + +var packInt16 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF]; +}; + +var packInt32 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; +}; + +var packFloat32 = function (number) { + return packIEEE754(number, 23, 4); +}; + +var packFloat64 = function (number) { + return packIEEE754(number, 52, 8); +}; + +var addGetter = function (Constructor, key) { + defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } }); +}; + +var get = function (view, count, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = bytes.slice(start, start + count); + return isLittleEndian ? pack : pack.reverse(); +}; + +var set = function (view, count, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = conversion(+value); + for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; +}; + +if (!NATIVE_ARRAY_BUFFER) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + setInternalState(this, { + bytes: arrayFill.call(new Array(byteLength), 0), + byteLength: byteLength + }); + if (!DESCRIPTORS) this.byteLength = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = getInternalState(buffer).byteLength; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + setInternalState(this, { + buffer: buffer, + byteLength: byteLength, + byteOffset: offset + }); + if (!DESCRIPTORS) { + this.buffer = buffer; + this.byteLength = byteLength; + this.byteOffset = offset; + } + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, 'byteLength'); + addGetter($DataView, 'buffer'); + addGetter($DataView, 'byteLength'); + addGetter($DataView, 'byteOffset'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); + } + }); +} else { + if (!fails(function () { + NativeArrayBuffer(1); + }) || !fails(function () { + new NativeArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new NativeArrayBuffer(); // eslint-disable-line no-new + new NativeArrayBuffer(1.5); // eslint-disable-line no-new + new NativeArrayBuffer(NaN); // eslint-disable-line no-new + return NativeArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new NativeArrayBuffer(toIndex(length)); + }; + var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE]; + for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, NativeArrayBuffer[key]); + } + ArrayBufferPrototype.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var testView = new $DataView(new $ArrayBuffer(2)); + var nativeSetInt8 = $DataView[PROTOTYPE].setInt8; + testView.setInt8(0, 2147483648); + testView.setInt8(1, 2147483649); + if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, value << 24 >> 24); + } + }, { unsafe: true }); +} + +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; diff --git a/core-js/internals/array-copy-within.js b/core-js/internals/array-copy-within.js new file mode 100644 index 0000000000..70c8edbf92 --- /dev/null +++ b/core-js/internals/array-copy-within.js @@ -0,0 +1,29 @@ +'use strict'; +var toObject = require('../internals/to-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toLength = require('../internals/to-length'); + +var min = Math.min; + +// `Array.prototype.copyWithin` method implementation +// https://tc39.github.io/ecma262/#sec-array.prototype.copywithin +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; diff --git a/core-js/internals/array-fill.js b/core-js/internals/array-fill.js new file mode 100644 index 0000000000..7c15a04f10 --- /dev/null +++ b/core-js/internals/array-fill.js @@ -0,0 +1,17 @@ +'use strict'; +var toObject = require('../internals/to-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toLength = require('../internals/to-length'); + +// `Array.prototype.fill` method implementation +// https://tc39.github.io/ecma262/#sec-array.prototype.fill +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; diff --git a/core-js/internals/array-for-each.js b/core-js/internals/array-for-each.js new file mode 100644 index 0000000000..b666e31540 --- /dev/null +++ b/core-js/internals/array-for-each.js @@ -0,0 +1,9 @@ +'use strict'; +var $forEach = require('../internals/array-iteration').forEach; +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +// `Array.prototype.forEach` method implementation +// https://tc39.github.io/ecma262/#sec-array.prototype.foreach +module.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); +} : [].forEach; diff --git a/core-js/internals/array-from.js b/core-js/internals/array-from.js new file mode 100644 index 0000000000..9a689463a0 --- /dev/null +++ b/core-js/internals/array-from.js @@ -0,0 +1,41 @@ +'use strict'; +var bind = require('../internals/bind-context'); +var toObject = require('../internals/to-object'); +var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var toLength = require('../internals/to-length'); +var createProperty = require('../internals/create-property'); +var getIteratorMethod = require('../internals/get-iterator-method'); + +// `Array.from` method implementation +// https://tc39.github.io/ecma262/#sec-array.from +module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iteratorMethod = getIteratorMethod(O); + var length, result, step, iterator; + if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); + // if the target is not iterable or it's an array with the default iterator - use a simple case + if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = iteratorMethod.call(O); + result = new C(); + for (;!(step = iterator.next()).done; index++) { + createProperty(result, index, mapping + ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) + : step.value + ); + } + } else { + length = toLength(O.length); + result = new C(length); + for (;length > index; index++) { + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; +}; diff --git a/core-js/internals/array-includes.js b/core-js/internals/array-includes.js new file mode 100644 index 0000000000..a4161204b3 --- /dev/null +++ b/core-js/internals/array-includes.js @@ -0,0 +1,32 @@ +var toIndexedObject = require('../internals/to-indexed-object'); +var toLength = require('../internals/to-length'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); + +// `Array.prototype.{ indexOf, includes }` methods implementation +var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +module.exports = { + // `Array.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) +}; diff --git a/core-js/internals/array-iteration.js b/core-js/internals/array-iteration.js new file mode 100644 index 0000000000..eab3f5bf8b --- /dev/null +++ b/core-js/internals/array-iteration.js @@ -0,0 +1,65 @@ +var bind = require('../internals/bind-context'); +var IndexedObject = require('../internals/indexed-object'); +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var arraySpeciesCreate = require('../internals/array-species-create'); + +var push = [].push; + +// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation +var createMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = IndexedObject(O); + var boundFunction = bind(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var value, result; + for (;length > index; index++) if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) switch (TYPE) { + case 3: return true; // some + case 5: return value; // find + case 6: return index; // findIndex + case 2: push.call(target, value); // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; + }; +}; + +module.exports = { + // `Array.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + forEach: createMethod(0), + // `Array.prototype.map` method + // https://tc39.github.io/ecma262/#sec-array.prototype.map + map: createMethod(1), + // `Array.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-array.prototype.filter + filter: createMethod(2), + // `Array.prototype.some` method + // https://tc39.github.io/ecma262/#sec-array.prototype.some + some: createMethod(3), + // `Array.prototype.every` method + // https://tc39.github.io/ecma262/#sec-array.prototype.every + every: createMethod(4), + // `Array.prototype.find` method + // https://tc39.github.io/ecma262/#sec-array.prototype.find + find: createMethod(5), + // `Array.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod(6) +}; diff --git a/core-js/internals/array-last-index-of.js b/core-js/internals/array-last-index-of.js new file mode 100644 index 0000000000..3401db3fce --- /dev/null +++ b/core-js/internals/array-last-index-of.js @@ -0,0 +1,24 @@ +'use strict'; +var toIndexedObject = require('../internals/to-indexed-object'); +var toInteger = require('../internals/to-integer'); +var toLength = require('../internals/to-length'); +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +var min = Math.min; +var nativeLastIndexOf = [].lastIndexOf; +var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; +var SLOPPY_METHOD = sloppyArrayMethod('lastIndexOf'); + +// `Array.prototype.lastIndexOf` method implementation +// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof +module.exports = (NEGATIVE_ZERO || SLOPPY_METHOD) ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0; + var O = toIndexedObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; + return -1; +} : nativeLastIndexOf; diff --git a/core-js/internals/array-method-has-species-support.js b/core-js/internals/array-method-has-species-support.js new file mode 100644 index 0000000000..c93ed5c487 --- /dev/null +++ b/core-js/internals/array-method-has-species-support.js @@ -0,0 +1,15 @@ +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (METHOD_NAME) { + return !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; diff --git a/core-js/internals/array-reduce.js b/core-js/internals/array-reduce.js new file mode 100644 index 0000000000..3f170377de --- /dev/null +++ b/core-js/internals/array-reduce.js @@ -0,0 +1,40 @@ +var aFunction = require('../internals/a-function'); +var toObject = require('../internals/to-object'); +var IndexedObject = require('../internals/indexed-object'); +var toLength = require('../internals/to-length'); + +// `Array.prototype.{ reduce, reduceRight }` methods implementation +var createMethod = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aFunction(callbackfn); + var O = toObject(that); + var self = IndexedObject(O); + var length = toLength(O.length); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; +}; + +module.exports = { + // `Array.prototype.reduce` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduce + left: createMethod(false), + // `Array.prototype.reduceRight` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright + right: createMethod(true) +}; diff --git a/core-js/internals/array-species-create.js b/core-js/internals/array-species-create.js new file mode 100644 index 0000000000..5c6eaabe14 --- /dev/null +++ b/core-js/internals/array-species-create.js @@ -0,0 +1,20 @@ +var isObject = require('../internals/is-object'); +var isArray = require('../internals/is-array'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); + +// `ArraySpeciesCreate` abstract operation +// https://tc39.github.io/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); +}; diff --git a/core-js/internals/bind-context.js b/core-js/internals/bind-context.js new file mode 100644 index 0000000000..96a7f49c41 --- /dev/null +++ b/core-js/internals/bind-context.js @@ -0,0 +1,24 @@ +var aFunction = require('../internals/a-function'); + +// optional / simple context binding +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 0: return function () { + return fn.call(that); + }; + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; diff --git a/core-js/internals/call-with-safe-iteration-closing.js b/core-js/internals/call-with-safe-iteration-closing.js new file mode 100644 index 0000000000..7503656557 --- /dev/null +++ b/core-js/internals/call-with-safe-iteration-closing.js @@ -0,0 +1,13 @@ +var anObject = require('../internals/an-object'); + +// call something on iterator step with safe closing on error +module.exports = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (error) { + var returnMethod = iterator['return']; + if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); + throw error; + } +}; diff --git a/core-js/internals/check-correctness-of-iteration.js b/core-js/internals/check-correctness-of-iteration.js new file mode 100644 index 0000000000..b33ec63e8f --- /dev/null +++ b/core-js/internals/check-correctness-of-iteration.js @@ -0,0 +1,38 @@ +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); +var SAFE_CLOSING = false; + +try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { done: !!called++ }; + }, + 'return': function () { + SAFE_CLOSING = true; + } + }; + iteratorWithReturn[ITERATOR] = function () { + return this; + }; + // eslint-disable-next-line no-throw-literal + Array.from(iteratorWithReturn, function () { throw 2; }); +} catch (error) { /* empty */ } + +module.exports = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + var ITERATION_SUPPORT = false; + try { + var object = {}; + object[ITERATOR] = function () { + return { + next: function () { + return { done: ITERATION_SUPPORT = true }; + } + }; + }; + exec(object); + } catch (error) { /* empty */ } + return ITERATION_SUPPORT; +}; diff --git a/core-js/internals/classof-raw.js b/core-js/internals/classof-raw.js new file mode 100644 index 0000000000..332c0bc0b9 --- /dev/null +++ b/core-js/internals/classof-raw.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; diff --git a/core-js/internals/classof.js b/core-js/internals/classof.js new file mode 100644 index 0000000000..5dedaceb6d --- /dev/null +++ b/core-js/internals/classof.js @@ -0,0 +1,25 @@ +var classofRaw = require('../internals/classof-raw'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +// ES3 wrong here +var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { /* empty */ } +}; + +// getting tag from ES6+ `Object.prototype.toString` +module.exports = function (it) { + var O, tag, result; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag + // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) + // ES3 arguments fallback + : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; +}; diff --git a/core-js/internals/collection-add-all.js b/core-js/internals/collection-add-all.js new file mode 100644 index 0000000000..86d1a78a36 --- /dev/null +++ b/core-js/internals/collection-add-all.js @@ -0,0 +1,13 @@ +'use strict'; +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); + +// https://github.com/tc39/collection-methods +module.exports = function (/* ...elements */) { + var set = anObject(this); + var adder = aFunction(set.add); + for (var k = 0, len = arguments.length; k < len; k++) { + adder.call(set, arguments[k]); + } + return set; +}; diff --git a/core-js/internals/collection-delete-all.js b/core-js/internals/collection-delete-all.js new file mode 100644 index 0000000000..37b4d48375 --- /dev/null +++ b/core-js/internals/collection-delete-all.js @@ -0,0 +1,16 @@ +'use strict'; +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); + +// https://github.com/tc39/collection-methods +module.exports = function (/* ...elements */) { + var collection = anObject(this); + var remover = aFunction(collection['delete']); + var allDeleted = true; + var wasDeleted; + for (var k = 0, len = arguments.length; k < len; k++) { + wasDeleted = remover.call(collection, arguments[k]); + allDeleted = allDeleted && wasDeleted; + } + return !!allDeleted; +}; diff --git a/core-js/internals/collection-from.js b/core-js/internals/collection-from.js new file mode 100644 index 0000000000..fcdd078c63 --- /dev/null +++ b/core-js/internals/collection-from.js @@ -0,0 +1,26 @@ +'use strict'; +// https://tc39.github.io/proposal-setmap-offrom/ +var aFunction = require('../internals/a-function'); +var bind = require('../internals/bind-context'); +var iterate = require('../internals/iterate'); + +module.exports = function from(source /* , mapFn, thisArg */) { + var length = arguments.length; + var mapFn = length > 1 ? arguments[1] : undefined; + var mapping, A, n, boundFunction; + aFunction(this); + mapping = mapFn !== undefined; + if (mapping) aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined, 2); + iterate(source, function (nextItem) { + A.push(boundFunction(nextItem, n++)); + }); + } else { + iterate(source, A.push, A); + } + return new this(A); +}; diff --git a/core-js/internals/collection-of.js b/core-js/internals/collection-of.js new file mode 100644 index 0000000000..e68a10743b --- /dev/null +++ b/core-js/internals/collection-of.js @@ -0,0 +1,8 @@ +'use strict'; +// https://tc39.github.io/proposal-setmap-offrom/ +module.exports = function of() { + var length = arguments.length; + var A = new Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); +}; diff --git a/core-js/internals/collection-strong.js b/core-js/internals/collection-strong.js new file mode 100644 index 0000000000..14f6f0ec13 --- /dev/null +++ b/core-js/internals/collection-strong.js @@ -0,0 +1,186 @@ +'use strict'; +var defineProperty = require('../internals/object-define-property').f; +var create = require('../internals/object-create'); +var redefineAll = require('../internals/redefine-all'); +var bind = require('../internals/bind-context'); +var anInstance = require('../internals/an-instance'); +var iterate = require('../internals/iterate'); +var defineIterator = require('../internals/define-iterator'); +var setSpecies = require('../internals/set-species'); +var DESCRIPTORS = require('../internals/descriptors'); +var fastKey = require('../internals/internal-metadata').fastKey; +var InternalStateModule = require('../internals/internal-state'); + +var setInternalState = InternalStateModule.set; +var internalStateGetterFor = InternalStateModule.getterFor; + +module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + index: create(null), + first: undefined, + last: undefined, + size: 0 + }); + if (!DESCRIPTORS) that.size = 0; + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + }); + + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + + var define = function (that, key, value) { + var state = getInternalState(that); + var entry = getEntry(that, key); + var previous, index; + // change existing entry + if (entry) { + entry.value = value; + // create new entry + } else { + state.last = entry = { + index: index = fastKey(key, true), + key: key, + value: value, + previous: previous = state.last, + next: undefined, + removed: false + }; + if (!state.first) state.first = entry; + if (previous) previous.next = entry; + if (DESCRIPTORS) state.size++; + else that.size++; + // add to index + if (index !== 'F') state.index[index] = entry; + } return that; + }; + + var getEntry = function (that, key) { + var state = getInternalState(that); + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return state.index[index]; + // frozen object case + for (entry = state.first; entry; entry = entry.next) { + if (entry.key == key) return entry; + } + }; + + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + var that = this; + var state = getInternalState(that); + var data = state.index; + var entry = state.first; + while (entry) { + entry.removed = true; + if (entry.previous) entry.previous = entry.previous.next = undefined; + delete data[entry.index]; + entry = entry.next; + } + state.first = state.last = undefined; + if (DESCRIPTORS) state.size = 0; + else that.size = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = this; + var state = getInternalState(that); + var entry = getEntry(that, key); + if (entry) { + var next = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) prev.next = next; + if (next) next.previous = prev; + if (state.first == entry) state.first = next; + if (state.last == entry) state.last = prev; + if (DESCRIPTORS) state.size--; + else that.size--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + var state = getInternalState(this); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.next : state.first) { + boundFunction(entry.value, entry.key, this); + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(this, key); + } + }); + + redefineAll(C.prototype, IS_MAP ? { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + } + } : { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return define(this, value = value === 0 ? 0 : value, value); + } + }); + if (DESCRIPTORS) defineProperty(C.prototype, 'size', { + get: function () { + return getInternalState(this).size; + } + }); + return C; + }, + setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; + var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); + var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) { + setInternalState(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: undefined + }); + }, function () { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + // get next entry + if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { + // or finish the iteration + state.target = undefined; + return { value: undefined, done: true }; + } + // return step by kind + if (kind == 'keys') return { value: entry.key, done: false }; + if (kind == 'values') return { value: entry.value, done: false }; + return { value: [entry.key, entry.value], done: false }; + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(CONSTRUCTOR_NAME); + } +}; diff --git a/core-js/internals/collection-weak.js b/core-js/internals/collection-weak.js new file mode 100644 index 0000000000..ac8a413a31 --- /dev/null +++ b/core-js/internals/collection-weak.js @@ -0,0 +1,121 @@ +'use strict'; +var redefineAll = require('../internals/redefine-all'); +var getWeakData = require('../internals/internal-metadata').getWeakData; +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var anInstance = require('../internals/an-instance'); +var iterate = require('../internals/iterate'); +var ArrayIterationModule = require('../internals/array-iteration'); +var $has = require('../internals/has'); +var InternalStateModule = require('../internals/internal-state'); + +var setInternalState = InternalStateModule.set; +var internalStateGetterFor = InternalStateModule.getterFor; +var find = ArrayIterationModule.find; +var findIndex = ArrayIterationModule.findIndex; +var id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function (store) { + return store.frozen || (store.frozen = new UncaughtFrozenStore()); +}; + +var UncaughtFrozenStore = function () { + this.entries = []; +}; + +var findUncaughtFrozen = function (store, key) { + return find(store.entries, function (it) { + return it[0] === key; + }); +}; + +UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.entries.push([key, value]); + }, + 'delete': function (key) { + var index = findIndex(this.entries, function (it) { + return it[0] === key; + }); + if (~index) this.entries.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + id: id++, + frozen: undefined + }); + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + }); + + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + + var define = function (that, key, value) { + var state = getInternalState(that); + var data = getWeakData(anObject(key), true); + if (data === true) uncaughtFrozenStore(state).set(key, value); + else data[state.id] = value; + return that; + }; + + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state)['delete'](key); + return data && $has(data, state.id) && delete data[state.id]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state).has(key); + return data && $has(data, state.id); + } + }); + + redefineAll(C.prototype, IS_MAP ? { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + var state = getInternalState(this); + if (isObject(key)) { + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state).get(key); + return data ? data[state.id] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return define(this, key, value); + } + } : { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return define(this, value, true); + } + }); + + return C; + } +}; diff --git a/core-js/internals/collection.js b/core-js/internals/collection.js new file mode 100644 index 0000000000..776c6d3ade --- /dev/null +++ b/core-js/internals/collection.js @@ -0,0 +1,97 @@ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var isForced = require('../internals/is-forced'); +var redefine = require('../internals/redefine'); +var InternalMetadataModule = require('../internals/internal-metadata'); +var iterate = require('../internals/iterate'); +var anInstance = require('../internals/an-instance'); +var isObject = require('../internals/is-object'); +var fails = require('../internals/fails'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var setToStringTag = require('../internals/set-to-string-tag'); +var inheritIfRequired = require('../internals/inherit-if-required'); + +module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) { + var NativeConstructor = global[CONSTRUCTOR_NAME]; + var NativePrototype = NativeConstructor && NativeConstructor.prototype; + var Constructor = NativeConstructor; + var ADDER = IS_MAP ? 'set' : 'add'; + var exported = {}; + + var fixMethod = function (KEY) { + var nativeMethod = NativePrototype[KEY]; + redefine(NativePrototype, KEY, + KEY == 'add' ? function add(value) { + nativeMethod.call(this, value === 0 ? 0 : value); + return this; + } : KEY == 'delete' ? function (key) { + return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); + } : KEY == 'get' ? function get(key) { + return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key); + } : KEY == 'has' ? function has(key) { + return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); + } : function set(key, value) { + nativeMethod.call(this, key === 0 ? 0 : key, value); + return this; + } + ); + }; + + // eslint-disable-next-line max-len + if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { + new NativeConstructor().entries().next(); + })))) { + // create collection constructor + Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); + InternalMetadataModule.REQUIRED = true; + } else if (isForced(CONSTRUCTOR_NAME, true)) { + var instance = new Constructor(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + // eslint-disable-next-line no-new + var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new NativeConstructor(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + + if (!ACCEPT_ITERABLES) { + Constructor = wrapper(function (dummy, iterable) { + anInstance(dummy, Constructor, CONSTRUCTOR_NAME); + var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + return that; + }); + Constructor.prototype = NativePrototype; + NativePrototype.constructor = Constructor; + } + + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + + // weak collections should not contains .clear method + if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; + } + + exported[CONSTRUCTOR_NAME] = Constructor; + $({ global: true, forced: Constructor != NativeConstructor }, exported); + + setToStringTag(Constructor, CONSTRUCTOR_NAME); + + if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); + + return Constructor; +}; diff --git a/core-js/internals/composite-key.js b/core-js/internals/composite-key.js new file mode 100644 index 0000000000..68a38c9610 --- /dev/null +++ b/core-js/internals/composite-key.js @@ -0,0 +1,43 @@ +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` +var Map = require('../modules/es.map'); +var WeakMap = require('../modules/es.weak-map'); +var create = require('../internals/object-create'); +var isObject = require('../internals/is-object'); + +var Node = function () { + // keys + this.object = null; + this.symbol = null; + // child nodes + this.primitives = null; + this.objectsByIndex = create(null); +}; + +Node.prototype.get = function (key, initializer) { + return this[key] || (this[key] = initializer()); +}; + +Node.prototype.next = function (i, it, IS_OBJECT) { + var store = IS_OBJECT + ? this.objectsByIndex[i] || (this.objectsByIndex[i] = new WeakMap()) + : this.primitives || (this.primitives = new Map()); + var entry = store.get(it); + if (!entry) store.set(it, entry = new Node()); + return entry; +}; + +var root = new Node(); + +module.exports = function () { + var active = root; + var length = arguments.length; + var i, it; + // for prevent leaking, start from objects + for (i = 0; i < length; i++) { + if (isObject(it = arguments[i])) active = active.next(i, it, true); + } + if (this === Object && active === root) throw TypeError('Composite keys must contain a non-primitive component'); + for (i = 0; i < length; i++) { + if (!isObject(it = arguments[i])) active = active.next(i, it, false); + } return active; +}; diff --git a/core-js/internals/copy-constructor-properties.js b/core-js/internals/copy-constructor-properties.js new file mode 100644 index 0000000000..214a819dd1 --- /dev/null +++ b/core-js/internals/copy-constructor-properties.js @@ -0,0 +1,14 @@ +var has = require('../internals/has'); +var ownKeys = require('../internals/own-keys'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var definePropertyModule = require('../internals/object-define-property'); + +module.exports = function (target, source) { + var keys = ownKeys(source); + var defineProperty = definePropertyModule.f; + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); + } +}; diff --git a/core-js/internals/correct-is-regexp-logic.js b/core-js/internals/correct-is-regexp-logic.js new file mode 100644 index 0000000000..f0d753fdc6 --- /dev/null +++ b/core-js/internals/correct-is-regexp-logic.js @@ -0,0 +1,15 @@ +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var MATCH = wellKnownSymbol('match'); + +module.exports = function (METHOD_NAME) { + var regexp = /./; + try { + '/./'[METHOD_NAME](regexp); + } catch (e) { + try { + regexp[MATCH] = false; + return '/./'[METHOD_NAME](regexp); + } catch (f) { /* empty */ } + } return false; +}; diff --git a/core-js/internals/correct-prototype-getter.js b/core-js/internals/correct-prototype-getter.js new file mode 100644 index 0000000000..6cd8f404a4 --- /dev/null +++ b/core-js/internals/correct-prototype-getter.js @@ -0,0 +1,7 @@ +var fails = require('../internals/fails'); + +module.exports = !fails(function () { + function F() { /* empty */ } + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; +}); diff --git a/core-js/internals/create-html.js b/core-js/internals/create-html.js new file mode 100644 index 0000000000..57e560c300 --- /dev/null +++ b/core-js/internals/create-html.js @@ -0,0 +1,12 @@ +var requireObjectCoercible = require('../internals/require-object-coercible'); + +var quot = /"/g; + +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +// https://tc39.github.io/ecma262/#sec-createhtml +module.exports = function (string, tag, attribute, value) { + var S = String(requireObjectCoercible(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; diff --git a/core-js/internals/create-iterator-constructor.js b/core-js/internals/create-iterator-constructor.js new file mode 100644 index 0000000000..f9dbdb789c --- /dev/null +++ b/core-js/internals/create-iterator-constructor.js @@ -0,0 +1,16 @@ +'use strict'; +var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; +var create = require('../internals/object-create'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var setToStringTag = require('../internals/set-to-string-tag'); +var Iterators = require('../internals/iterators'); + +var returnThis = function () { return this; }; + +module.exports = function (IteratorConstructor, NAME, next) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + Iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; +}; diff --git a/core-js/internals/create-property-descriptor.js b/core-js/internals/create-property-descriptor.js new file mode 100644 index 0000000000..090593405f --- /dev/null +++ b/core-js/internals/create-property-descriptor.js @@ -0,0 +1,8 @@ +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; diff --git a/core-js/internals/create-property.js b/core-js/internals/create-property.js new file mode 100644 index 0000000000..c27151a934 --- /dev/null +++ b/core-js/internals/create-property.js @@ -0,0 +1,10 @@ +'use strict'; +var toPrimitive = require('../internals/to-primitive'); +var definePropertyModule = require('../internals/object-define-property'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); + +module.exports = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; +}; diff --git a/core-js/internals/date-to-iso-string.js b/core-js/internals/date-to-iso-string.js new file mode 100644 index 0000000000..f22503a3a7 --- /dev/null +++ b/core-js/internals/date-to-iso-string.js @@ -0,0 +1,31 @@ +'use strict'; +var fails = require('../internals/fails'); +var padStart = require('../internals/string-pad').start; + +var abs = Math.abs; +var DatePrototype = Date.prototype; +var getTime = DatePrototype.getTime; +var nativeDateToISOString = DatePrototype.toISOString; + +// `Date.prototype.toISOString` method implementation +// https://tc39.github.io/ecma262/#sec-date.prototype.toisostring +// PhantomJS / old WebKit fails here: +module.exports = (fails(function () { + return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + nativeDateToISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var date = this; + var year = date.getUTCFullYear(); + var milliseconds = date.getUTCMilliseconds(); + var sign = year < 0 ? '-' : year > 9999 ? '+' : ''; + return sign + padStart(abs(year), sign ? 6 : 4, 0) + + '-' + padStart(date.getUTCMonth() + 1, 2, 0) + + '-' + padStart(date.getUTCDate(), 2, 0) + + 'T' + padStart(date.getUTCHours(), 2, 0) + + ':' + padStart(date.getUTCMinutes(), 2, 0) + + ':' + padStart(date.getUTCSeconds(), 2, 0) + + '.' + padStart(milliseconds, 3, 0) + + 'Z'; +} : nativeDateToISOString; diff --git a/core-js/internals/date-to-primitive.js b/core-js/internals/date-to-primitive.js new file mode 100644 index 0000000000..fc334f1356 --- /dev/null +++ b/core-js/internals/date-to-primitive.js @@ -0,0 +1,9 @@ +'use strict'; +var anObject = require('../internals/an-object'); +var toPrimitive = require('../internals/to-primitive'); + +module.exports = function (hint) { + if (hint !== 'string' && hint !== 'number' && hint !== 'default') { + throw TypeError('Incorrect hint'); + } return toPrimitive(anObject(this), hint !== 'number'); +}; diff --git a/core-js/internals/define-iterator.js b/core-js/internals/define-iterator.js new file mode 100644 index 0000000000..f5acd4f0f1 --- /dev/null +++ b/core-js/internals/define-iterator.js @@ -0,0 +1,90 @@ +'use strict'; +var $ = require('../internals/export'); +var createIteratorConstructor = require('../internals/create-iterator-constructor'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var setToStringTag = require('../internals/set-to-string-tag'); +var hide = require('../internals/hide'); +var redefine = require('../internals/redefine'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_PURE = require('../internals/is-pure'); +var Iterators = require('../internals/iterators'); +var IteratorsCore = require('../internals/iterators-core'); + +var IteratorPrototype = IteratorsCore.IteratorPrototype; +var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; +var ITERATOR = wellKnownSymbol('iterator'); +var KEYS = 'keys'; +var VALUES = 'values'; +var ENTRIES = 'entries'; + +var returnThis = function () { return this; }; + +module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; + switch (KIND) { + case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; + case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; + case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; + } return function () { return new IteratorConstructor(this); }; + }; + + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR] + || IterablePrototype['@@iterator'] + || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; + + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); + if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { + if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { + if (setPrototypeOf) { + setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); + } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { + hide(CurrentIteratorPrototype, ITERATOR, returnThis); + } + } + // Set @@toStringTag to native iterators + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); + if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; + } + } + + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { return nativeIterator.call(this); }; + } + + // define iterator + if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { + hide(IterablePrototype, ITERATOR, defaultIterator); + } + Iterators[NAME] = defaultIterator; + + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + redefine(IterablePrototype, KEY, methods[KEY]); + } + } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } + + return methods; +}; diff --git a/core-js/internals/define-well-known-symbol.js b/core-js/internals/define-well-known-symbol.js new file mode 100644 index 0000000000..d383029176 --- /dev/null +++ b/core-js/internals/define-well-known-symbol.js @@ -0,0 +1,11 @@ +var path = require('../internals/path'); +var has = require('../internals/has'); +var wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol'); +var defineProperty = require('../internals/object-define-property').f; + +module.exports = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME) + }); +}; diff --git a/core-js/internals/descriptors.js b/core-js/internals/descriptors.js new file mode 100644 index 0000000000..cae051891d --- /dev/null +++ b/core-js/internals/descriptors.js @@ -0,0 +1,6 @@ +var fails = require('../internals/fails'); + +// Thank's IE8 for his funny defineProperty +module.exports = !fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); diff --git a/core-js/internals/document-create-element.js b/core-js/internals/document-create-element.js new file mode 100644 index 0000000000..cc6abae0d8 --- /dev/null +++ b/core-js/internals/document-create-element.js @@ -0,0 +1,10 @@ +var global = require('../internals/global'); +var isObject = require('../internals/is-object'); + +var document = global.document; +// typeof document.createElement is 'object' in old IE +var EXISTS = isObject(document) && isObject(document.createElement); + +module.exports = function (it) { + return EXISTS ? document.createElement(it) : {}; +}; diff --git a/core-js/internals/dom-iterables.js b/core-js/internals/dom-iterables.js new file mode 100644 index 0000000000..b04e872907 --- /dev/null +++ b/core-js/internals/dom-iterables.js @@ -0,0 +1,35 @@ +// iterable DOM collections +// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods +module.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0 +}; diff --git a/core-js/internals/entry-unbind.js b/core-js/internals/entry-unbind.js new file mode 100644 index 0000000000..4707c9c42a --- /dev/null +++ b/core-js/internals/entry-unbind.js @@ -0,0 +1,8 @@ +var global = require('../internals/global'); +var bind = require('../internals/bind-context'); + +var call = Function.call; + +module.exports = function (CONSTRUCTOR, METHOD, length) { + return bind(call, global[CONSTRUCTOR].prototype[METHOD], length); +}; diff --git a/core-js/internals/entry-virtual.js b/core-js/internals/entry-virtual.js new file mode 100644 index 0000000000..42d08dc022 --- /dev/null +++ b/core-js/internals/entry-virtual.js @@ -0,0 +1,5 @@ +var global = require('../internals/global'); + +module.exports = function (CONSTRUCTOR) { + return global[CONSTRUCTOR].prototype; +}; diff --git a/core-js/internals/enum-bug-keys.js b/core-js/internals/enum-bug-keys.js new file mode 100644 index 0000000000..2ca413b13a --- /dev/null +++ b/core-js/internals/enum-bug-keys.js @@ -0,0 +1,10 @@ +// IE8- don't enum bug keys +module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' +]; diff --git a/core-js/internals/export.js b/core-js/internals/export.js new file mode 100644 index 0000000000..324e804133 --- /dev/null +++ b/core-js/internals/export.js @@ -0,0 +1,54 @@ +var global = require('../internals/global'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var hide = require('../internals/hide'); +var redefine = require('../internals/redefine'); +var setGlobal = require('../internals/set-global'); +var copyConstructorProperties = require('../internals/copy-constructor-properties'); +var isForced = require('../internals/is-forced'); + +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ +module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || setGlobal(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty === typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } + // add a flag to not completely full polyfills + if (options.sham || (targetProperty && targetProperty.sham)) { + hide(sourceProperty, 'sham', true); + } + // extend global + redefine(target, key, sourceProperty, options); + } +}; diff --git a/core-js/internals/fails.js b/core-js/internals/fails.js new file mode 100644 index 0000000000..f398e2da8e --- /dev/null +++ b/core-js/internals/fails.js @@ -0,0 +1,7 @@ +module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } +}; diff --git a/core-js/internals/fix-regexp-well-known-symbol-logic.js b/core-js/internals/fix-regexp-well-known-symbol-logic.js new file mode 100644 index 0000000000..563baa3c2e --- /dev/null +++ b/core-js/internals/fix-regexp-well-known-symbol-logic.js @@ -0,0 +1,93 @@ +'use strict'; +var hide = require('../internals/hide'); +var redefine = require('../internals/redefine'); +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var regexpExec = require('../internals/regexp-exec'); + +var SPECIES = wellKnownSymbol('species'); + +var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + return ''.replace(re, '$') !== '7'; +}); + +// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec +// Weex JS has frozen built-in prototypes, so use try / catch wrapper +var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; +}); + +module.exports = function (KEY, length, exec, sham) { + var SYMBOL = wellKnownSymbol(KEY); + + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + }); + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + re.exec = function () { execCalled = true; return null; }; + + if (KEY === 'split') { + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { return re; }; + } + + re[SYMBOL](''); + return !execCalled; + }); + + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || + (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) + ) { + var nativeRegExpMethod = /./[SYMBOL]; + var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; + } + return { done: true, value: nativeMethod.call(str, regexp, arg2) }; + } + return { done: false }; + }); + var stringMethod = methods[0]; + var regexMethod = methods[1]; + + redefine(String.prototype, KEY, stringMethod); + redefine(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return regexMethod.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return regexMethod.call(string, this); } + ); + if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true); + } +}; diff --git a/core-js/internals/flatten-into-array.js b/core-js/internals/flatten-into-array.js new file mode 100644 index 0000000000..e218b1dcb8 --- /dev/null +++ b/core-js/internals/flatten-into-array.js @@ -0,0 +1,32 @@ +'use strict'; +var isArray = require('../internals/is-array'); +var toLength = require('../internals/to-length'); +var bind = require('../internals/bind-context'); + +// `FlattenIntoArray` abstract operation +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? bind(mapper, thisArg, 3) : false; + var element; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + if (depth > 0 && isArray(element)) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length'); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +}; + +module.exports = flattenIntoArray; diff --git a/core-js/internals/forced-object-prototype-accessors-methods.js b/core-js/internals/forced-object-prototype-accessors-methods.js new file mode 100644 index 0000000000..98cb8ba041 --- /dev/null +++ b/core-js/internals/forced-object-prototype-accessors-methods.js @@ -0,0 +1,13 @@ +'use strict'; +var IS_PURE = require('../internals/is-pure'); +var global = require('../internals/global'); +var fails = require('../internals/fails'); + +// Forced replacement object prototype accessors methods +module.exports = IS_PURE || !fails(function () { + var key = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, key, function () { /* empty */ }); + delete global[key]; +}); diff --git a/core-js/internals/forced-string-html-method.js b/core-js/internals/forced-string-html-method.js new file mode 100644 index 0000000000..d3c884f5e5 --- /dev/null +++ b/core-js/internals/forced-string-html-method.js @@ -0,0 +1,10 @@ +var fails = require('../internals/fails'); + +// check the existence of a method, lowercase +// of a tag and escaping quotes in arguments +module.exports = function (METHOD_NAME) { + return fails(function () { + var test = ''[METHOD_NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }); +}; diff --git a/core-js/internals/forced-string-trim-method.js b/core-js/internals/forced-string-trim-method.js new file mode 100644 index 0000000000..1b169ad902 --- /dev/null +++ b/core-js/internals/forced-string-trim-method.js @@ -0,0 +1,12 @@ +var fails = require('../internals/fails'); +var whitespaces = require('../internals/whitespaces'); + +var non = '\u200B\u0085\u180E'; + +// check that a method works with the correct list +// of whitespaces and has a correct name +module.exports = function (METHOD_NAME) { + return fails(function () { + return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME; + }); +}; diff --git a/core-js/internals/freezing.js b/core-js/internals/freezing.js new file mode 100644 index 0000000000..0ac9fbfb53 --- /dev/null +++ b/core-js/internals/freezing.js @@ -0,0 +1,5 @@ +var fails = require('../internals/fails'); + +module.exports = !fails(function () { + return Object.isExtensible(Object.preventExtensions({})); +}); diff --git a/core-js/internals/function-bind.js b/core-js/internals/function-bind.js new file mode 100644 index 0000000000..6e1e81dd3a --- /dev/null +++ b/core-js/internals/function-bind.js @@ -0,0 +1,27 @@ +'use strict'; +var aFunction = require('../internals/a-function'); +var isObject = require('../internals/is-object'); + +var slice = [].slice; +var factories = {}; + +var construct = function (C, argsLength, args) { + if (!(argsLength in factories)) { + for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); + } return factories[argsLength](C, args); +}; + +// `Function.prototype.bind` method implementation +// https://tc39.github.io/ecma262/#sec-function.prototype.bind +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = slice.call(arguments, 1); + var boundFunction = function bound(/* args... */) { + var args = partArgs.concat(slice.call(arguments)); + return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); + }; + if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype; + return boundFunction; +}; diff --git a/core-js/internals/function-to-string.js b/core-js/internals/function-to-string.js new file mode 100644 index 0000000000..6f7e88f3c8 --- /dev/null +++ b/core-js/internals/function-to-string.js @@ -0,0 +1,3 @@ +var shared = require('../internals/shared'); + +module.exports = shared('native-function-to-string', Function.toString); diff --git a/core-js/internals/get-built-in.js b/core-js/internals/get-built-in.js new file mode 100644 index 0000000000..8fcff2678a --- /dev/null +++ b/core-js/internals/get-built-in.js @@ -0,0 +1,11 @@ +var path = require('../internals/path'); +var global = require('../internals/global'); + +var aFunction = function (variable) { + return typeof variable == 'function' ? variable : undefined; +}; + +module.exports = function (namespace, method) { + return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) + : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; +}; diff --git a/core-js/internals/get-iterator-method.js b/core-js/internals/get-iterator-method.js new file mode 100644 index 0000000000..cfac310104 --- /dev/null +++ b/core-js/internals/get-iterator-method.js @@ -0,0 +1,11 @@ +var classof = require('../internals/classof'); +var Iterators = require('../internals/iterators'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); + +module.exports = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; diff --git a/core-js/internals/get-iterator.js b/core-js/internals/get-iterator.js new file mode 100644 index 0000000000..f7f7f8ef3b --- /dev/null +++ b/core-js/internals/get-iterator.js @@ -0,0 +1,9 @@ +var anObject = require('../internals/an-object'); +var getIteratorMethod = require('../internals/get-iterator-method'); + +module.exports = function (it) { + var iteratorMethod = getIteratorMethod(it); + if (typeof iteratorMethod != 'function') { + throw TypeError(String(it) + ' is not iterable'); + } return anObject(iteratorMethod.call(it)); +}; diff --git a/core-js/internals/get-map-iterator.js b/core-js/internals/get-map-iterator.js new file mode 100644 index 0000000000..1c608f379c --- /dev/null +++ b/core-js/internals/get-map-iterator.js @@ -0,0 +1,7 @@ +var IS_PURE = require('../internals/is-pure'); +var getIterator = require('../internals/get-iterator'); + +module.exports = IS_PURE ? getIterator : function (it) { + // eslint-disable-next-line no-undef + return Map.prototype.entries.call(it); +}; diff --git a/core-js/internals/get-set-iterator.js b/core-js/internals/get-set-iterator.js new file mode 100644 index 0000000000..4560c2e82c --- /dev/null +++ b/core-js/internals/get-set-iterator.js @@ -0,0 +1,7 @@ +var IS_PURE = require('../internals/is-pure'); +var getIterator = require('../internals/get-iterator'); + +module.exports = IS_PURE ? getIterator : function (it) { + // eslint-disable-next-line no-undef + return Set.prototype.values.call(it); +}; diff --git a/core-js/internals/global.js b/core-js/internals/global.js new file mode 100644 index 0000000000..bb744f126f --- /dev/null +++ b/core-js/internals/global.js @@ -0,0 +1,14 @@ +var O = 'object'; +var check = function (it) { + return it && it.Math == Math && it; +}; + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +module.exports = + // eslint-disable-next-line no-undef + check(typeof globalThis == O && globalThis) || + check(typeof window == O && window) || + check(typeof self == O && self) || + check(typeof global == O && global) || + // eslint-disable-next-line no-new-func + Function('return this')(); diff --git a/core-js/internals/has.js b/core-js/internals/has.js new file mode 100644 index 0000000000..0925c41e6c --- /dev/null +++ b/core-js/internals/has.js @@ -0,0 +1,5 @@ +var hasOwnProperty = {}.hasOwnProperty; + +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; diff --git a/core-js/internals/hidden-keys.js b/core-js/internals/hidden-keys.js new file mode 100644 index 0000000000..f053ebf797 --- /dev/null +++ b/core-js/internals/hidden-keys.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/core-js/internals/hide.js b/core-js/internals/hide.js new file mode 100644 index 0000000000..bdaad25055 --- /dev/null +++ b/core-js/internals/hide.js @@ -0,0 +1,10 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var definePropertyModule = require('../internals/object-define-property'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); + +module.exports = DESCRIPTORS ? function (object, key, value) { + return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; diff --git a/core-js/internals/host-report-errors.js b/core-js/internals/host-report-errors.js new file mode 100644 index 0000000000..dc84a6c26b --- /dev/null +++ b/core-js/internals/host-report-errors.js @@ -0,0 +1,8 @@ +var global = require('../internals/global'); + +module.exports = function (a, b) { + var console = global.console; + if (console && console.error) { + arguments.length === 1 ? console.error(a) : console.error(a, b); + } +}; diff --git a/core-js/internals/html.js b/core-js/internals/html.js new file mode 100644 index 0000000000..23defa66b2 --- /dev/null +++ b/core-js/internals/html.js @@ -0,0 +1,3 @@ +var getBuiltIn = require('../internals/get-built-in'); + +module.exports = getBuiltIn('document', 'documentElement'); diff --git a/core-js/internals/ie8-dom-define.js b/core-js/internals/ie8-dom-define.js new file mode 100644 index 0000000000..6696ff9dd5 --- /dev/null +++ b/core-js/internals/ie8-dom-define.js @@ -0,0 +1,10 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); +var createElement = require('../internals/document-create-element'); + +// Thank's IE8 for his funny defineProperty +module.exports = !DESCRIPTORS && !fails(function () { + return Object.defineProperty(createElement('div'), 'a', { + get: function () { return 7; } + }).a != 7; +}); diff --git a/core-js/internals/indexed-object.js b/core-js/internals/indexed-object.js new file mode 100644 index 0000000000..2aa25b5efb --- /dev/null +++ b/core-js/internals/indexed-object.js @@ -0,0 +1,13 @@ +var fails = require('../internals/fails'); +var classof = require('../internals/classof-raw'); + +var split = ''.split; + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins + return !Object('z').propertyIsEnumerable(0); +}) ? function (it) { + return classof(it) == 'String' ? split.call(it, '') : Object(it); +} : Object; diff --git a/core-js/internals/inherit-if-required.js b/core-js/internals/inherit-if-required.js new file mode 100644 index 0000000000..a033b0c6a9 --- /dev/null +++ b/core-js/internals/inherit-if-required.js @@ -0,0 +1,17 @@ +var isObject = require('../internals/is-object'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); + +// makes subclassing work correct for wrapped built-ins +module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + typeof (NewTarget = dummy.constructor) == 'function' && + NewTarget !== Wrapper && + isObject(NewTargetPrototype = NewTarget.prototype) && + NewTargetPrototype !== Wrapper.prototype + ) setPrototypeOf($this, NewTargetPrototype); + return $this; +}; diff --git a/core-js/internals/internal-metadata.js b/core-js/internals/internal-metadata.js new file mode 100644 index 0000000000..d70c48c3b0 --- /dev/null +++ b/core-js/internals/internal-metadata.js @@ -0,0 +1,61 @@ +var hiddenKeys = require('../internals/hidden-keys'); +var isObject = require('../internals/is-object'); +var has = require('../internals/has'); +var defineProperty = require('../internals/object-define-property').f; +var uid = require('../internals/uid'); +var FREEZING = require('../internals/freezing'); + +var METADATA = uid('meta'); +var id = 0; + +var isExtensible = Object.isExtensible || function () { + return true; +}; + +var setMetadata = function (it) { + defineProperty(it, METADATA, { value: { + objectID: 'O' + ++id, // object ID + weakData: {} // weak collections IDs + } }); +}; + +var fastKey = function (it, create) { + // return a primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMetadata(it); + // return object ID + } return it[METADATA].objectID; +}; + +var getWeakData = function (it, create) { + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMetadata(it); + // return the store of weak collections IDs + } return it[METADATA].weakData; +}; + +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); + return it; +}; + +var meta = module.exports = { + REQUIRED: false, + fastKey: fastKey, + getWeakData: getWeakData, + onFreeze: onFreeze +}; + +hiddenKeys[METADATA] = true; diff --git a/core-js/internals/internal-state.js b/core-js/internals/internal-state.js new file mode 100644 index 0000000000..9a401750b9 --- /dev/null +++ b/core-js/internals/internal-state.js @@ -0,0 +1,61 @@ +var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); +var global = require('../internals/global'); +var isObject = require('../internals/is-object'); +var hide = require('../internals/hide'); +var objectHas = require('../internals/has'); +var sharedKey = require('../internals/shared-key'); +var hiddenKeys = require('../internals/hidden-keys'); + +var WeakMap = global.WeakMap; +var set, get, has; + +var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); +}; + +var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } return state; + }; +}; + +if (NATIVE_WEAK_MAP) { + var store = new WeakMap(); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + set = function (it, metadata) { + wmset.call(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget.call(store, it) || {}; + }; + has = function (it) { + return wmhas.call(store, it); + }; +} else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + hide(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return objectHas(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return objectHas(it, STATE); + }; +} + +module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor +}; diff --git a/core-js/internals/is-array-iterator-method.js b/core-js/internals/is-array-iterator-method.js new file mode 100644 index 0000000000..ab0ebe1ebf --- /dev/null +++ b/core-js/internals/is-array-iterator-method.js @@ -0,0 +1,10 @@ +var wellKnownSymbol = require('../internals/well-known-symbol'); +var Iterators = require('../internals/iterators'); + +var ITERATOR = wellKnownSymbol('iterator'); +var ArrayPrototype = Array.prototype; + +// check on default Array iterator +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); +}; diff --git a/core-js/internals/is-array.js b/core-js/internals/is-array.js new file mode 100644 index 0000000000..757515da50 --- /dev/null +++ b/core-js/internals/is-array.js @@ -0,0 +1,7 @@ +var classof = require('../internals/classof-raw'); + +// `IsArray` abstract operation +// https://tc39.github.io/ecma262/#sec-isarray +module.exports = Array.isArray || function isArray(arg) { + return classof(arg) == 'Array'; +}; diff --git a/core-js/internals/is-forced.js b/core-js/internals/is-forced.js new file mode 100644 index 0000000000..cae014febe --- /dev/null +++ b/core-js/internals/is-forced.js @@ -0,0 +1,21 @@ +var fails = require('../internals/fails'); + +var replacement = /#|\.prototype\./; + +var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value == POLYFILL ? true + : value == NATIVE ? false + : typeof detection == 'function' ? fails(detection) + : !!detection; +}; + +var normalize = isForced.normalize = function (string) { + return String(string).replace(replacement, '.').toLowerCase(); +}; + +var data = isForced.data = {}; +var NATIVE = isForced.NATIVE = 'N'; +var POLYFILL = isForced.POLYFILL = 'P'; + +module.exports = isForced; diff --git a/core-js/internals/is-integer.js b/core-js/internals/is-integer.js new file mode 100644 index 0000000000..df16086443 --- /dev/null +++ b/core-js/internals/is-integer.js @@ -0,0 +1,9 @@ +var isObject = require('../internals/is-object'); + +var floor = Math.floor; + +// `Number.isInteger` method implementation +// https://tc39.github.io/ecma262/#sec-number.isinteger +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; diff --git a/core-js/internals/is-iterable.js b/core-js/internals/is-iterable.js new file mode 100644 index 0000000000..f33bb2df3f --- /dev/null +++ b/core-js/internals/is-iterable.js @@ -0,0 +1,13 @@ +var classof = require('../internals/classof'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var Iterators = require('../internals/iterators'); + +var ITERATOR = wellKnownSymbol('iterator'); + +module.exports = function (it) { + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + // eslint-disable-next-line no-prototype-builtins + || Iterators.hasOwnProperty(classof(O)); +}; diff --git a/core-js/internals/is-object.js b/core-js/internals/is-object.js new file mode 100644 index 0000000000..dda6e04d27 --- /dev/null +++ b/core-js/internals/is-object.js @@ -0,0 +1,3 @@ +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; diff --git a/core-js/internals/is-pure.js b/core-js/internals/is-pure.js new file mode 100644 index 0000000000..a5d30209bd --- /dev/null +++ b/core-js/internals/is-pure.js @@ -0,0 +1 @@ +module.exports = false; diff --git a/core-js/internals/is-regexp.js b/core-js/internals/is-regexp.js new file mode 100644 index 0000000000..e2c7247e04 --- /dev/null +++ b/core-js/internals/is-regexp.js @@ -0,0 +1,12 @@ +var isObject = require('../internals/is-object'); +var classof = require('../internals/classof-raw'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var MATCH = wellKnownSymbol('match'); + +// `IsRegExp` abstract operation +// https://tc39.github.io/ecma262/#sec-isregexp +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); +}; diff --git a/core-js/internals/iterate.js b/core-js/internals/iterate.js new file mode 100644 index 0000000000..49ec4cb7db --- /dev/null +++ b/core-js/internals/iterate.js @@ -0,0 +1,42 @@ +var anObject = require('../internals/an-object'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var toLength = require('../internals/to-length'); +var bind = require('../internals/bind-context'); +var getIteratorMethod = require('../internals/get-iterator-method'); +var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); + +var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; +}; + +var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) { + var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1); + var iterator, iterFn, index, length, result, step; + + if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); + // optimisation for array iterators + if (isArrayIteratorMethod(iterFn)) { + for (index = 0, length = toLength(iterable.length); length > index; index++) { + result = AS_ENTRIES + ? boundFunction(anObject(step = iterable[index])[0], step[1]) + : boundFunction(iterable[index]); + if (result && result instanceof Result) return result; + } return new Result(false); + } + iterator = iterFn.call(iterable); + } + + while (!(step = iterator.next()).done) { + result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES); + if (result && result instanceof Result) return result; + } return new Result(false); +}; + +iterate.stop = function (result) { + return new Result(true, result); +}; diff --git a/core-js/internals/iterators-core.js b/core-js/internals/iterators-core.js new file mode 100644 index 0000000000..bdc5e53e1e --- /dev/null +++ b/core-js/internals/iterators-core.js @@ -0,0 +1,35 @@ +'use strict'; +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var hide = require('../internals/hide'); +var has = require('../internals/has'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_PURE = require('../internals/is-pure'); + +var ITERATOR = wellKnownSymbol('iterator'); +var BUGGY_SAFARI_ITERATORS = false; + +var returnThis = function () { return this; }; + +// `%IteratorPrototype%` object +// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object +var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; + +if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } +} + +if (IteratorPrototype == undefined) IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); + +module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS +}; diff --git a/core-js/internals/iterators.js b/core-js/internals/iterators.js new file mode 100644 index 0000000000..f053ebf797 --- /dev/null +++ b/core-js/internals/iterators.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/core-js/internals/math-expm1.js b/core-js/internals/math-expm1.js new file mode 100644 index 0000000000..3a14c07311 --- /dev/null +++ b/core-js/internals/math-expm1.js @@ -0,0 +1,13 @@ +var nativeExpm1 = Math.expm1; +var exp = Math.exp; + +// `Math.expm1` method implementation +// https://tc39.github.io/ecma262/#sec-math.expm1 +module.exports = (!nativeExpm1 + // Old FF bug + || nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168 + // Tor Browser bug + || nativeExpm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1; +} : nativeExpm1; diff --git a/core-js/internals/math-fround.js b/core-js/internals/math-fround.js new file mode 100644 index 0000000000..0642e3121c --- /dev/null +++ b/core-js/internals/math-fround.js @@ -0,0 +1,26 @@ +var sign = require('../internals/math-sign'); + +var abs = Math.abs; +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +// `Math.fround` method implementation +// https://tc39.github.io/ecma262/#sec-math.fround +module.exports = Math.fround || function fround(x) { + var $abs = abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; diff --git a/core-js/internals/math-log1p.js b/core-js/internals/math-log1p.js new file mode 100644 index 0000000000..3d2545c6c4 --- /dev/null +++ b/core-js/internals/math-log1p.js @@ -0,0 +1,7 @@ +var log = Math.log; + +// `Math.log1p` method implementation +// https://tc39.github.io/ecma262/#sec-math.log1p +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x); +}; diff --git a/core-js/internals/math-scale.js b/core-js/internals/math-scale.js new file mode 100644 index 0000000000..59288629e4 --- /dev/null +++ b/core-js/internals/math-scale.js @@ -0,0 +1,16 @@ +// `Math.scale` method implementation +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + /* eslint-disable no-self-compare */ + || x != x + || inLow != inLow + || inHigh != inHigh + || outLow != outLow + || outHigh != outHigh + /* eslint-enable no-self-compare */ + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; diff --git a/core-js/internals/math-sign.js b/core-js/internals/math-sign.js new file mode 100644 index 0000000000..9260696338 --- /dev/null +++ b/core-js/internals/math-sign.js @@ -0,0 +1,6 @@ +// `Math.sign` method implementation +// https://tc39.github.io/ecma262/#sec-math.sign +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; diff --git a/core-js/internals/microtask.js b/core-js/internals/microtask.js new file mode 100644 index 0000000000..849fb952a0 --- /dev/null +++ b/core-js/internals/microtask.js @@ -0,0 +1,78 @@ +var global = require('../internals/global'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var classof = require('../internals/classof-raw'); +var macrotask = require('../internals/task').set; +var userAgent = require('../internals/user-agent'); + +var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var IS_NODE = classof(process) == 'process'; +// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` +var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); +var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; + +var flush, head, last, notify, toggle, node, promise, then; + +// modern engines have queueMicrotask method +if (!queueMicrotask) { + flush = function () { + var parent, fn; + if (IS_NODE && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (error) { + if (head) notify(); + else last = undefined; + throw error; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (IS_NODE) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 + } else if (MutationObserver && !/(iphone|ipod|ipad).*applewebkit/i.test(userAgent)) { + toggle = true; + node = document.createTextNode(''); + new MutationObserver(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + promise = Promise.resolve(undefined); + then = promise.then; + notify = function () { + then.call(promise, flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } +} + +module.exports = queueMicrotask || function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; +}; diff --git a/core-js/internals/native-promise-constructor.js b/core-js/internals/native-promise-constructor.js new file mode 100644 index 0000000000..dae3822430 --- /dev/null +++ b/core-js/internals/native-promise-constructor.js @@ -0,0 +1,3 @@ +var global = require('../internals/global'); + +module.exports = global.Promise; diff --git a/core-js/internals/native-symbol.js b/core-js/internals/native-symbol.js new file mode 100644 index 0000000000..bb22d6cfcc --- /dev/null +++ b/core-js/internals/native-symbol.js @@ -0,0 +1,7 @@ +var fails = require('../internals/fails'); + +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + // Chrome 38 Symbol has incorrect toString conversion + // eslint-disable-next-line no-undef + return !String(Symbol()); +}); diff --git a/core-js/internals/native-url.js b/core-js/internals/native-url.js new file mode 100644 index 0000000000..ce353aa726 --- /dev/null +++ b/core-js/internals/native-url.js @@ -0,0 +1,24 @@ +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_PURE = require('../internals/is-pure'); + +var ITERATOR = wellKnownSymbol('iterator'); + +module.exports = !fails(function () { + var url = new URL('b?e=1', 'http://a'); + var searchParams = url.searchParams; + url.pathname = 'c%20d'; + return (IS_PURE && !url.toJSON) + || !searchParams.sort + || url.href !== 'http://a/c%20d?e=1' + || searchParams.get('e') !== '1' + || String(new URLSearchParams('?a=1')) !== 'a=1' + || !searchParams[ITERATOR] + // throws in Edge + || new URL('https://a@b').username !== 'a' + || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' + // not punycoded in Edge + || new URL('http://тест').host !== 'xn--e1aybc' + // not escaped in Chrome 62- + || new URL('http://a#б').hash !== '#%D0%B1'; +}); diff --git a/core-js/internals/native-weak-map.js b/core-js/internals/native-weak-map.js new file mode 100644 index 0000000000..bc7af5f002 --- /dev/null +++ b/core-js/internals/native-weak-map.js @@ -0,0 +1,6 @@ +var global = require('../internals/global'); +var nativeFunctionToString = require('../internals/function-to-string'); + +var WeakMap = global.WeakMap; + +module.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap)); diff --git a/core-js/internals/new-promise-capability.js b/core-js/internals/new-promise-capability.js new file mode 100644 index 0000000000..394edc9780 --- /dev/null +++ b/core-js/internals/new-promise-capability.js @@ -0,0 +1,18 @@ +'use strict'; +var aFunction = require('../internals/a-function'); + +var PromiseCapability = function (C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; + +// 25.4.1.5 NewPromiseCapability(C) +module.exports.f = function (C) { + return new PromiseCapability(C); +}; diff --git a/core-js/internals/not-a-regexp.js b/core-js/internals/not-a-regexp.js new file mode 100644 index 0000000000..7bb4e9c7aa --- /dev/null +++ b/core-js/internals/not-a-regexp.js @@ -0,0 +1,7 @@ +var isRegExp = require('../internals/is-regexp'); + +module.exports = function (it) { + if (isRegExp(it)) { + throw TypeError("The method doesn't accept regular expressions"); + } return it; +}; diff --git a/core-js/internals/number-is-finite.js b/core-js/internals/number-is-finite.js new file mode 100644 index 0000000000..4b26c4a8c7 --- /dev/null +++ b/core-js/internals/number-is-finite.js @@ -0,0 +1,9 @@ +var global = require('../internals/global'); + +var globalIsFinite = global.isFinite; + +// `Number.isFinite` method +// https://tc39.github.io/ecma262/#sec-number.isfinite +module.exports = Number.isFinite || function isFinite(it) { + return typeof it == 'number' && globalIsFinite(it); +}; diff --git a/core-js/internals/object-assign.js b/core-js/internals/object-assign.js new file mode 100644 index 0000000000..559fac94d0 --- /dev/null +++ b/core-js/internals/object-assign.js @@ -0,0 +1,41 @@ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); +var objectKeys = require('../internals/object-keys'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var toObject = require('../internals/to-object'); +var IndexedObject = require('../internals/indexed-object'); + +var nativeAssign = Object.assign; + +// `Object.assign` method +// https://tc39.github.io/ecma262/#sec-object.assign +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !nativeAssign || fails(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var symbol = Symbol(); + var alphabet = 'abcdefghijklmnopqrst'; + A[symbol] = 7; + alphabet.split('').forEach(function (chr) { B[chr] = chr; }); + return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + var propertyIsEnumerable = propertyIsEnumerableModule.f; + while (argumentsLength > index) { + var S = IndexedObject(arguments[index++]); + var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; + } + } return T; +} : nativeAssign; diff --git a/core-js/internals/object-create.js b/core-js/internals/object-create.js new file mode 100644 index 0000000000..fff1c22470 --- /dev/null +++ b/core-js/internals/object-create.js @@ -0,0 +1,49 @@ +var anObject = require('../internals/an-object'); +var defineProperties = require('../internals/object-define-properties'); +var enumBugKeys = require('../internals/enum-bug-keys'); +var hiddenKeys = require('../internals/hidden-keys'); +var html = require('../internals/html'); +var documentCreateElement = require('../internals/document-create-element'); +var sharedKey = require('../internals/shared-key'); +var IE_PROTO = sharedKey('IE_PROTO'); + +var PROTOTYPE = 'prototype'; +var Empty = function () { /* empty */ }; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var length = enumBugKeys.length; + var lt = '<'; + var script = 'script'; + var gt = '>'; + var js = 'java' + script + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + iframe.src = String(js); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]]; + return createDict(); +}; + +// `Object.create` method +// https://tc39.github.io/ecma262/#sec-object.create +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : defineProperties(result, Properties); +}; + +hiddenKeys[IE_PROTO] = true; diff --git a/core-js/internals/object-define-properties.js b/core-js/internals/object-define-properties.js new file mode 100644 index 0000000000..c2b53399d9 --- /dev/null +++ b/core-js/internals/object-define-properties.js @@ -0,0 +1,16 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var definePropertyModule = require('../internals/object-define-property'); +var anObject = require('../internals/an-object'); +var objectKeys = require('../internals/object-keys'); + +// `Object.defineProperties` method +// https://tc39.github.io/ecma262/#sec-object.defineproperties +module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); + return O; +}; diff --git a/core-js/internals/object-define-property.js b/core-js/internals/object-define-property.js new file mode 100644 index 0000000000..375f20fb48 --- /dev/null +++ b/core-js/internals/object-define-property.js @@ -0,0 +1,20 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); +var anObject = require('../internals/an-object'); +var toPrimitive = require('../internals/to-primitive'); + +var nativeDefineProperty = Object.defineProperty; + +// `Object.defineProperty` method +// https://tc39.github.io/ecma262/#sec-object.defineproperty +exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return nativeDefineProperty(O, P, Attributes); + } catch (error) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; diff --git a/core-js/internals/object-get-own-property-descriptor.js b/core-js/internals/object-get-own-property-descriptor.js new file mode 100644 index 0000000000..acdae01787 --- /dev/null +++ b/core-js/internals/object-get-own-property-descriptor.js @@ -0,0 +1,20 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toPrimitive = require('../internals/to-primitive'); +var has = require('../internals/has'); +var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); + +var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor +exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ } + if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); +}; diff --git a/core-js/internals/object-get-own-property-names-external.js b/core-js/internals/object-get-own-property-names-external.js new file mode 100644 index 0000000000..dfd94f1b67 --- /dev/null +++ b/core-js/internals/object-get-own-property-names-external.js @@ -0,0 +1,22 @@ +var toIndexedObject = require('../internals/to-indexed-object'); +var nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names').f; + +var toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return nativeGetOwnPropertyNames(it); + } catch (error) { + return windowNames.slice(); + } +}; + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' + ? getWindowNames(it) + : nativeGetOwnPropertyNames(toIndexedObject(it)); +}; diff --git a/core-js/internals/object-get-own-property-names.js b/core-js/internals/object-get-own-property-names.js new file mode 100644 index 0000000000..f1b1be6ce6 --- /dev/null +++ b/core-js/internals/object-get-own-property-names.js @@ -0,0 +1,10 @@ +var internalObjectKeys = require('../internals/object-keys-internal'); +var enumBugKeys = require('../internals/enum-bug-keys'); + +var hiddenKeys = enumBugKeys.concat('length', 'prototype'); + +// `Object.getOwnPropertyNames` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertynames +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); +}; diff --git a/core-js/internals/object-get-own-property-symbols.js b/core-js/internals/object-get-own-property-symbols.js new file mode 100644 index 0000000000..bc06729056 --- /dev/null +++ b/core-js/internals/object-get-own-property-symbols.js @@ -0,0 +1 @@ +exports.f = Object.getOwnPropertySymbols; diff --git a/core-js/internals/object-get-prototype-of.js b/core-js/internals/object-get-prototype-of.js new file mode 100644 index 0000000000..c0bb726b80 --- /dev/null +++ b/core-js/internals/object-get-prototype-of.js @@ -0,0 +1,17 @@ +var has = require('../internals/has'); +var toObject = require('../internals/to-object'); +var sharedKey = require('../internals/shared-key'); +var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); + +var IE_PROTO = sharedKey('IE_PROTO'); +var ObjectPrototype = Object.prototype; + +// `Object.getPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.getprototypeof +module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectPrototype : null; +}; diff --git a/core-js/internals/object-keys-internal.js b/core-js/internals/object-keys-internal.js new file mode 100644 index 0000000000..40b4c987b4 --- /dev/null +++ b/core-js/internals/object-keys-internal.js @@ -0,0 +1,17 @@ +var has = require('../internals/has'); +var toIndexedObject = require('../internals/to-indexed-object'); +var indexOf = require('../internals/array-includes').indexOf; +var hiddenKeys = require('../internals/hidden-keys'); + +module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~indexOf(result, key) || result.push(key); + } + return result; +}; diff --git a/core-js/internals/object-keys.js b/core-js/internals/object-keys.js new file mode 100644 index 0000000000..7188505dc5 --- /dev/null +++ b/core-js/internals/object-keys.js @@ -0,0 +1,8 @@ +var internalObjectKeys = require('../internals/object-keys-internal'); +var enumBugKeys = require('../internals/enum-bug-keys'); + +// `Object.keys` method +// https://tc39.github.io/ecma262/#sec-object.keys +module.exports = Object.keys || function keys(O) { + return internalObjectKeys(O, enumBugKeys); +}; diff --git a/core-js/internals/object-property-is-enumerable.js b/core-js/internals/object-property-is-enumerable.js new file mode 100644 index 0000000000..9ff2209679 --- /dev/null +++ b/core-js/internals/object-property-is-enumerable.js @@ -0,0 +1,13 @@ +'use strict'; +var nativePropertyIsEnumerable = {}.propertyIsEnumerable; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// Nashorn ~ JDK8 bug +var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); + +// `Object.prototype.propertyIsEnumerable` method implementation +// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable +exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; +} : nativePropertyIsEnumerable; diff --git a/core-js/internals/object-set-prototype-of.js b/core-js/internals/object-set-prototype-of.js new file mode 100644 index 0000000000..ce7e97ccf7 --- /dev/null +++ b/core-js/internals/object-set-prototype-of.js @@ -0,0 +1,24 @@ +var anObject = require('../internals/an-object'); +var aPossiblePrototype = require('../internals/a-possible-prototype'); + +// `Object.setPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.setprototypeof +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + try { + setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; + setter.call(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { /* empty */ } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter.call(O, proto); + else O.__proto__ = proto; + return O; + }; +}() : undefined); diff --git a/core-js/internals/object-to-array.js b/core-js/internals/object-to-array.js new file mode 100644 index 0000000000..8e2409df79 --- /dev/null +++ b/core-js/internals/object-to-array.js @@ -0,0 +1,32 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var objectKeys = require('../internals/object-keys'); +var toIndexedObject = require('../internals/to-indexed-object'); +var propertyIsEnumerable = require('../internals/object-property-is-enumerable').f; + +// `Object.{ entries, values }` methods implementation +var createMethod = function (TO_ENTRIES) { + return function (it) { + var O = toIndexedObject(it); + var keys = objectKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) { + result.push(TO_ENTRIES ? [key, O[key]] : O[key]); + } + } + return result; + }; +}; + +module.exports = { + // `Object.entries` method + // https://tc39.github.io/ecma262/#sec-object.entries + entries: createMethod(true), + // `Object.values` method + // https://tc39.github.io/ecma262/#sec-object.values + values: createMethod(false) +}; diff --git a/core-js/internals/object-to-string.js b/core-js/internals/object-to-string.js new file mode 100644 index 0000000000..a08766c771 --- /dev/null +++ b/core-js/internals/object-to-string.js @@ -0,0 +1,14 @@ +'use strict'; +var classof = require('../internals/classof'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var test = {}; + +test[TO_STRING_TAG] = 'z'; + +// `Object.prototype.toString` method implementation +// https://tc39.github.io/ecma262/#sec-object.prototype.tostring +module.exports = String(test) !== '[object z]' ? function toString() { + return '[object ' + classof(this) + ']'; +} : test.toString; diff --git a/core-js/internals/own-keys.js b/core-js/internals/own-keys.js new file mode 100644 index 0000000000..4c3d8b5fdb --- /dev/null +++ b/core-js/internals/own-keys.js @@ -0,0 +1,11 @@ +var getBuiltIn = require('../internals/get-built-in'); +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var anObject = require('../internals/an-object'); + +// all object keys, includes non-enumerable and symbols +module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; +}; diff --git a/core-js/internals/parse-float.js b/core-js/internals/parse-float.js new file mode 100644 index 0000000000..1242a674fa --- /dev/null +++ b/core-js/internals/parse-float.js @@ -0,0 +1,14 @@ +var global = require('../internals/global'); +var trim = require('../internals/string-trim').trim; +var whitespaces = require('../internals/whitespaces'); + +var nativeParseFloat = global.parseFloat; +var FORCED = 1 / nativeParseFloat(whitespaces + '-0') !== -Infinity; + +// `parseFloat` method +// https://tc39.github.io/ecma262/#sec-parsefloat-string +module.exports = FORCED ? function parseFloat(string) { + var trimmedString = trim(String(string)); + var result = nativeParseFloat(trimmedString); + return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result; +} : nativeParseFloat; diff --git a/core-js/internals/parse-int.js b/core-js/internals/parse-int.js new file mode 100644 index 0000000000..a068efab87 --- /dev/null +++ b/core-js/internals/parse-int.js @@ -0,0 +1,14 @@ +var global = require('../internals/global'); +var trim = require('../internals/string-trim').trim; +var whitespaces = require('../internals/whitespaces'); + +var nativeParseInt = global.parseInt; +var hex = /^[+-]?0[Xx]/; +var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22; + +// `parseInt` method +// https://tc39.github.io/ecma262/#sec-parseint-string-radix +module.exports = FORCED ? function parseInt(string, radix) { + var S = trim(String(string)); + return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10)); +} : nativeParseInt; diff --git a/core-js/internals/path.js b/core-js/internals/path.js new file mode 100644 index 0000000000..21d5120423 --- /dev/null +++ b/core-js/internals/path.js @@ -0,0 +1 @@ +module.exports = require('../internals/global'); diff --git a/core-js/internals/perform.js b/core-js/internals/perform.js new file mode 100644 index 0000000000..3cd8eef9c0 --- /dev/null +++ b/core-js/internals/perform.js @@ -0,0 +1,7 @@ +module.exports = function (exec) { + try { + return { error: false, value: exec() }; + } catch (error) { + return { error: true, value: error }; + } +}; diff --git a/core-js/internals/promise-resolve.js b/core-js/internals/promise-resolve.js new file mode 100644 index 0000000000..18e73e1c78 --- /dev/null +++ b/core-js/internals/promise-resolve.js @@ -0,0 +1,12 @@ +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var newPromiseCapability = require('../internals/new-promise-capability'); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; diff --git a/core-js/internals/punycode-to-ascii.js b/core-js/internals/punycode-to-ascii.js new file mode 100644 index 0000000000..436d39fe99 --- /dev/null +++ b/core-js/internals/punycode-to-ascii.js @@ -0,0 +1,168 @@ +'use strict'; +// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' +var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars +var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators +var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + */ +var ucs2decode = function (string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +}; + +/** + * Converts a digit/integer into a basic code point. + */ +var digitToBasic = function (digit) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + */ +var adapt = function (delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + */ +// eslint-disable-next-line max-statements +var encode = function (input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + var i, currentValue; + + // Handle the basic code points. + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + var basicLength = output.length; // number of basic code points. + var handledCPCount = basicLength; // number of code points that have been handled; + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + // All non-basic code points < n have been handled already. Find the next larger one: + var m = maxInt; + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , but guard against overflow. + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + throw RangeError(OVERFLOW_ERROR); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < n && ++delta > maxInt) { + throw RangeError(OVERFLOW_ERROR); + } + if (currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base; /* no condition */; k += base) { + var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) break; + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +module.exports = function (input) { + var encoded = []; + var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.'); + var i, label; + for (i = 0; i < labels.length; i++) { + label = labels[i]; + encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label); + } + return encoded.join('.'); +}; diff --git a/core-js/internals/redefine-all.js b/core-js/internals/redefine-all.js new file mode 100644 index 0000000000..3dc4477f65 --- /dev/null +++ b/core-js/internals/redefine-all.js @@ -0,0 +1,6 @@ +var redefine = require('../internals/redefine'); + +module.exports = function (target, src, options) { + for (var key in src) redefine(target, key, src[key], options); + return target; +}; diff --git a/core-js/internals/redefine.js b/core-js/internals/redefine.js new file mode 100644 index 0000000000..62f842a5e4 --- /dev/null +++ b/core-js/internals/redefine.js @@ -0,0 +1,39 @@ +var global = require('../internals/global'); +var shared = require('../internals/shared'); +var hide = require('../internals/hide'); +var has = require('../internals/has'); +var setGlobal = require('../internals/set-global'); +var nativeFunctionToString = require('../internals/function-to-string'); +var InternalStateModule = require('../internals/internal-state'); + +var getInternalState = InternalStateModule.get; +var enforceInternalState = InternalStateModule.enforce; +var TEMPLATE = String(nativeFunctionToString).split('toString'); + +shared('inspectSource', function (it) { + return nativeFunctionToString.call(it); +}); + +(module.exports = function (O, key, value, options) { + var unsafe = options ? !!options.unsafe : false; + var simple = options ? !!options.enumerable : false; + var noTargetGet = options ? !!options.noTargetGet : false; + if (typeof value == 'function') { + if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key); + enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); + } + if (O === global) { + if (simple) O[key] = value; + else setGlobal(key, value); + return; + } else if (!unsafe) { + delete O[key]; + } else if (!noTargetGet && O[key]) { + simple = true; + } + if (simple) O[key] = value; + else hide(O, key, value); +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, 'toString', function toString() { + return typeof this == 'function' && getInternalState(this).source || nativeFunctionToString.call(this); +}); diff --git a/core-js/internals/reflect-metadata.js b/core-js/internals/reflect-metadata.js new file mode 100644 index 0000000000..a8cd82f3b8 --- /dev/null +++ b/core-js/internals/reflect-metadata.js @@ -0,0 +1,55 @@ +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` +var Map = require('../modules/es.map'); +var WeakMap = require('../modules/es.weak-map'); +var shared = require('../internals/shared'); + +var metadata = shared('metadata'); +var store = metadata.store || (metadata.store = new WeakMap()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; + +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; + +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; + +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; + +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; + +var toMetadataKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; + +module.exports = { + store: store, + getMap: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + toKey: toMetadataKey +}; diff --git a/core-js/internals/regexp-exec-abstract.js b/core-js/internals/regexp-exec-abstract.js new file mode 100644 index 0000000000..496225f14a --- /dev/null +++ b/core-js/internals/regexp-exec-abstract.js @@ -0,0 +1,22 @@ +var classof = require('./classof-raw'); +var regexpExec = require('./regexp-exec'); + +// `RegExpExec` abstract operation +// https://tc39.github.io/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + + if (classof(R) !== 'RegExp') { + throw TypeError('RegExp#exec called on incompatible receiver'); + } + + return regexpExec.call(R, S); +}; + diff --git a/core-js/internals/regexp-exec.js b/core-js/internals/regexp-exec.js new file mode 100644 index 0000000000..7b9aa24daf --- /dev/null +++ b/core-js/internals/regexp-exec.js @@ -0,0 +1,54 @@ +'use strict'; +var regexpFlags = require('./regexp-flags'); + +var nativeExec = RegExp.prototype.exec; +// This always refers to the native implementation, because the +// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, +// which loads this file before patching the method. +var nativeReplace = String.prototype.replace; + +var patchedExec = nativeExec; + +var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/; + var re2 = /b*/g; + nativeExec.call(re1, 'a'); + nativeExec.call(re2, 'a'); + return re1.lastIndex !== 0 || re2.lastIndex !== 0; +})(); + +// nonparticipating capturing group, copied from es5-shim's String#split patch. +var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; + +var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; + +if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, reCopy, match, i; + + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; + + match = nativeExec.call(re, str); + + if (UPDATES_LAST_INDEX_WRONG && match) { + re.lastIndex = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + + return match; + }; +} + +module.exports = patchedExec; diff --git a/core-js/internals/regexp-flags.js b/core-js/internals/regexp-flags.js new file mode 100644 index 0000000000..c77927b023 --- /dev/null +++ b/core-js/internals/regexp-flags.js @@ -0,0 +1,16 @@ +'use strict'; +var anObject = require('../internals/an-object'); + +// `RegExp.prototype.flags` getter implementation +// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.dotAll) result += 's'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; diff --git a/core-js/internals/require-object-coercible.js b/core-js/internals/require-object-coercible.js new file mode 100644 index 0000000000..f7b2662731 --- /dev/null +++ b/core-js/internals/require-object-coercible.js @@ -0,0 +1,6 @@ +// `RequireObjectCoercible` abstract operation +// https://tc39.github.io/ecma262/#sec-requireobjectcoercible +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; diff --git a/core-js/internals/same-value-zero.js b/core-js/internals/same-value-zero.js new file mode 100644 index 0000000000..452f23083c --- /dev/null +++ b/core-js/internals/same-value-zero.js @@ -0,0 +1,6 @@ +// `SameValueZero` abstract operation +// https://tc39.github.io/ecma262/#sec-samevaluezero +module.exports = function (x, y) { + // eslint-disable-next-line no-self-compare + return x === y || x != x && y != y; +}; diff --git a/core-js/internals/same-value.js b/core-js/internals/same-value.js new file mode 100644 index 0000000000..4661f85a29 --- /dev/null +++ b/core-js/internals/same-value.js @@ -0,0 +1,6 @@ +// `SameValue` abstract operation +// https://tc39.github.io/ecma262/#sec-samevalue +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; diff --git a/core-js/internals/set-global.js b/core-js/internals/set-global.js new file mode 100644 index 0000000000..6ebbe5db60 --- /dev/null +++ b/core-js/internals/set-global.js @@ -0,0 +1,10 @@ +var global = require('../internals/global'); +var hide = require('../internals/hide'); + +module.exports = function (key, value) { + try { + hide(global, key, value); + } catch (error) { + global[key] = value; + } return value; +}; diff --git a/core-js/internals/set-species.js b/core-js/internals/set-species.js new file mode 100644 index 0000000000..6be87f7280 --- /dev/null +++ b/core-js/internals/set-species.js @@ -0,0 +1,19 @@ +'use strict'; +var getBuiltIn = require('../internals/get-built-in'); +var definePropertyModule = require('../internals/object-define-property'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var DESCRIPTORS = require('../internals/descriptors'); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = definePropertyModule.f; + + if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { + defineProperty(Constructor, SPECIES, { + configurable: true, + get: function () { return this; } + }); + } +}; diff --git a/core-js/internals/set-to-string-tag.js b/core-js/internals/set-to-string-tag.js new file mode 100644 index 0000000000..4f497664ae --- /dev/null +++ b/core-js/internals/set-to-string-tag.js @@ -0,0 +1,11 @@ +var defineProperty = require('../internals/object-define-property').f; +var has = require('../internals/has'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + +module.exports = function (it, TAG, STATIC) { + if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { + defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); + } +}; diff --git a/core-js/internals/shared-key.js b/core-js/internals/shared-key.js new file mode 100644 index 0000000000..35bc403d29 --- /dev/null +++ b/core-js/internals/shared-key.js @@ -0,0 +1,8 @@ +var shared = require('../internals/shared'); +var uid = require('../internals/uid'); + +var keys = shared('keys'); + +module.exports = function (key) { + return keys[key] || (keys[key] = uid(key)); +}; diff --git a/core-js/internals/shared.js b/core-js/internals/shared.js new file mode 100644 index 0000000000..2417549c3d --- /dev/null +++ b/core-js/internals/shared.js @@ -0,0 +1,14 @@ +var global = require('../internals/global'); +var setGlobal = require('../internals/set-global'); +var IS_PURE = require('../internals/is-pure'); + +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || setGlobal(SHARED, {}); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: '3.2.1', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' +}); diff --git a/core-js/internals/sloppy-array-method.js b/core-js/internals/sloppy-array-method.js new file mode 100644 index 0000000000..8ec998384a --- /dev/null +++ b/core-js/internals/sloppy-array-method.js @@ -0,0 +1,10 @@ +'use strict'; +var fails = require('../internals/fails'); + +module.exports = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return !method || !fails(function () { + // eslint-disable-next-line no-useless-call,no-throw-literal + method.call(null, argument || function () { throw 1; }, 1); + }); +}; diff --git a/core-js/internals/species-constructor.js b/core-js/internals/species-constructor.js new file mode 100644 index 0000000000..4d8f565746 --- /dev/null +++ b/core-js/internals/species-constructor.js @@ -0,0 +1,13 @@ +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); + +// `SpeciesConstructor` abstract operation +// https://tc39.github.io/ecma262/#sec-speciesconstructor +module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S); +}; diff --git a/core-js/internals/string-multibyte.js b/core-js/internals/string-multibyte.js new file mode 100644 index 0000000000..c0cf086294 --- /dev/null +++ b/core-js/internals/string-multibyte.js @@ -0,0 +1,27 @@ +var toInteger = require('../internals/to-integer'); +var requireObjectCoercible = require('../internals/require-object-coercible'); + +// `String.prototype.{ codePointAt, at }` methods implementation +var createMethod = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = String(requireObjectCoercible($this)); + var position = toInteger(pos); + var size = S.length; + var first, second; + if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; + first = S.charCodeAt(position); + return first < 0xD800 || first > 0xDBFF || position + 1 === size + || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF + ? CONVERT_TO_STRING ? S.charAt(position) : first + : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; + }; +}; + +module.exports = { + // `String.prototype.codePointAt` method + // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod(true) +}; diff --git a/core-js/internals/string-pad.js b/core-js/internals/string-pad.js new file mode 100644 index 0000000000..c03090e08b --- /dev/null +++ b/core-js/internals/string-pad.js @@ -0,0 +1,31 @@ +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = require('../internals/to-length'); +var repeat = require('../internals/string-repeat'); +var requireObjectCoercible = require('../internals/require-object-coercible'); + +var ceil = Math.ceil; + +// `String.prototype.{ padStart, padEnd }` methods implementation +var createMethod = function (IS_END) { + return function ($this, maxLength, fillString) { + var S = String(requireObjectCoercible($this)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + var fillLen, stringFiller; + if (intMaxLength <= stringLength || fillStr == '') return S; + fillLen = intMaxLength - stringLength; + stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return IS_END ? S + stringFiller : stringFiller + S; + }; +}; + +module.exports = { + // `String.prototype.padStart` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padstart + start: createMethod(false), + // `String.prototype.padEnd` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padend + end: createMethod(true) +}; diff --git a/core-js/internals/string-repeat.js b/core-js/internals/string-repeat.js new file mode 100644 index 0000000000..ab872b2fee --- /dev/null +++ b/core-js/internals/string-repeat.js @@ -0,0 +1,14 @@ +'use strict'; +var toInteger = require('../internals/to-integer'); +var requireObjectCoercible = require('../internals/require-object-coercible'); + +// `String.prototype.repeat` method implementation +// https://tc39.github.io/ecma262/#sec-string.prototype.repeat +module.exports = ''.repeat || function repeat(count) { + var str = String(requireObjectCoercible(this)); + var result = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions'); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; + return result; +}; diff --git a/core-js/internals/string-trim.js b/core-js/internals/string-trim.js new file mode 100644 index 0000000000..294a32c8f4 --- /dev/null +++ b/core-js/internals/string-trim.js @@ -0,0 +1,28 @@ +var requireObjectCoercible = require('../internals/require-object-coercible'); +var whitespaces = require('../internals/whitespaces'); + +var whitespace = '[' + whitespaces + ']'; +var ltrim = RegExp('^' + whitespace + whitespace + '*'); +var rtrim = RegExp(whitespace + whitespace + '*$'); + +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation +var createMethod = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; + }; +}; + +module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.github.io/ecma262/#sec-string.prototype.trim + trim: createMethod(3) +}; diff --git a/core-js/internals/task.js b/core-js/internals/task.js new file mode 100644 index 0000000000..7ea4fc4a7b --- /dev/null +++ b/core-js/internals/task.js @@ -0,0 +1,99 @@ +var global = require('../internals/global'); +var fails = require('../internals/fails'); +var classof = require('../internals/classof-raw'); +var bind = require('../internals/bind-context'); +var html = require('../internals/html'); +var createElement = require('../internals/document-create-element'); + +var location = global.location; +var set = global.setImmediate; +var clear = global.clearImmediate; +var process = global.process; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; + +var run = function (id) { + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; + +var runner = function (id) { + return function () { + run(id); + }; +}; + +var listener = function (event) { + run(event.data); +}; + +var post = function (id) { + // old engines have not location.origin + global.postMessage(id + '', location.protocol + '//' + location.host); +}; + +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!set || !clear) { + set = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args); + }; + defer(counter); + return counter; + }; + clear = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (classof(process) == 'process') { + defer = function (id) { + process.nextTick(runner(id)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(runner(id)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = bind(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post)) { + defer = post; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in createElement('script')) { + defer = function (id) { + html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(runner(id), 0); + }; + } +} + +module.exports = { + set: set, + clear: clear +}; diff --git a/core-js/internals/this-number-value.js b/core-js/internals/this-number-value.js new file mode 100644 index 0000000000..7734b329e0 --- /dev/null +++ b/core-js/internals/this-number-value.js @@ -0,0 +1,10 @@ +var classof = require('../internals/classof-raw'); + +// `thisNumberValue` abstract operation +// https://tc39.github.io/ecma262/#sec-thisnumbervalue +module.exports = function (value) { + if (typeof value != 'number' && classof(value) != 'Number') { + throw TypeError('Incorrect invocation'); + } + return +value; +}; diff --git a/core-js/internals/to-absolute-index.js b/core-js/internals/to-absolute-index.js new file mode 100644 index 0000000000..34c837cd4b --- /dev/null +++ b/core-js/internals/to-absolute-index.js @@ -0,0 +1,12 @@ +var toInteger = require('../internals/to-integer'); + +var max = Math.max; +var min = Math.min; + +// Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(length, length). +module.exports = function (index, length) { + var integer = toInteger(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); +}; diff --git a/core-js/internals/to-index.js b/core-js/internals/to-index.js new file mode 100644 index 0000000000..004a3a22eb --- /dev/null +++ b/core-js/internals/to-index.js @@ -0,0 +1,12 @@ +var toInteger = require('../internals/to-integer'); +var toLength = require('../internals/to-length'); + +// `ToIndex` abstract operation +// https://tc39.github.io/ecma262/#sec-toindex +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length or index'); + return length; +}; diff --git a/core-js/internals/to-indexed-object.js b/core-js/internals/to-indexed-object.js new file mode 100644 index 0000000000..98f0799255 --- /dev/null +++ b/core-js/internals/to-indexed-object.js @@ -0,0 +1,7 @@ +// toObject with fallback for non-array-like ES3 strings +var IndexedObject = require('../internals/indexed-object'); +var requireObjectCoercible = require('../internals/require-object-coercible'); + +module.exports = function (it) { + return IndexedObject(requireObjectCoercible(it)); +}; diff --git a/core-js/internals/to-integer.js b/core-js/internals/to-integer.js new file mode 100644 index 0000000000..f7c63906f8 --- /dev/null +++ b/core-js/internals/to-integer.js @@ -0,0 +1,8 @@ +var ceil = Math.ceil; +var floor = Math.floor; + +// `ToInteger` abstract operation +// https://tc39.github.io/ecma262/#sec-tointeger +module.exports = function (argument) { + return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); +}; diff --git a/core-js/internals/to-length.js b/core-js/internals/to-length.js new file mode 100644 index 0000000000..fbc2a49ea6 --- /dev/null +++ b/core-js/internals/to-length.js @@ -0,0 +1,9 @@ +var toInteger = require('../internals/to-integer'); + +var min = Math.min; + +// `ToLength` abstract operation +// https://tc39.github.io/ecma262/#sec-tolength +module.exports = function (argument) { + return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 +}; diff --git a/core-js/internals/to-object.js b/core-js/internals/to-object.js new file mode 100644 index 0000000000..fd635e2568 --- /dev/null +++ b/core-js/internals/to-object.js @@ -0,0 +1,7 @@ +var requireObjectCoercible = require('../internals/require-object-coercible'); + +// `ToObject` abstract operation +// https://tc39.github.io/ecma262/#sec-toobject +module.exports = function (argument) { + return Object(requireObjectCoercible(argument)); +}; diff --git a/core-js/internals/to-offset.js b/core-js/internals/to-offset.js new file mode 100644 index 0000000000..9f3e5f23ab --- /dev/null +++ b/core-js/internals/to-offset.js @@ -0,0 +1,7 @@ +var toInteger = require('../internals/to-integer'); + +module.exports = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset'); + return offset; +}; diff --git a/core-js/internals/to-primitive.js b/core-js/internals/to-primitive.js new file mode 100644 index 0000000000..00a4031417 --- /dev/null +++ b/core-js/internals/to-primitive.js @@ -0,0 +1,14 @@ +var isObject = require('../internals/is-object'); + +// `ToPrimitive` abstract operation +// https://tc39.github.io/ecma262/#sec-toprimitive +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (input, PREFERRED_STRING) { + if (!isObject(input)) return input; + var fn, val; + if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; + if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + throw TypeError("Can't convert object to primitive value"); +}; diff --git a/core-js/internals/typed-array-constructor.js b/core-js/internals/typed-array-constructor.js new file mode 100644 index 0000000000..82c3f9d525 --- /dev/null +++ b/core-js/internals/typed-array-constructor.js @@ -0,0 +1,223 @@ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var DESCRIPTORS = require('../internals/descriptors'); +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-arrays-constructors-requires-wrappers'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var ArrayBufferModule = require('../internals/array-buffer'); +var anInstance = require('../internals/an-instance'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var hide = require('../internals/hide'); +var toLength = require('../internals/to-length'); +var toIndex = require('../internals/to-index'); +var toOffset = require('../internals/to-offset'); +var toPrimitive = require('../internals/to-primitive'); +var has = require('../internals/has'); +var classof = require('../internals/classof'); +var isObject = require('../internals/is-object'); +var create = require('../internals/object-create'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var typedArrayFrom = require('../internals/typed-array-from'); +var forEach = require('../internals/array-iteration').forEach; +var setSpecies = require('../internals/set-species'); +var definePropertyModule = require('../internals/object-define-property'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var InternalStateModule = require('../internals/internal-state'); + +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; +var nativeDefineProperty = definePropertyModule.f; +var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; +var round = Math.round; +var RangeError = global.RangeError; +var ArrayBuffer = ArrayBufferModule.ArrayBuffer; +var DataView = ArrayBufferModule.DataView; +var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; +var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; +var TypedArray = ArrayBufferViewCore.TypedArray; +var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; +var isTypedArray = ArrayBufferViewCore.isTypedArray; +var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; +var WRONG_LENGTH = 'Wrong length'; + +var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; +}; + +var addGetter = function (it, key) { + nativeDefineProperty(it, key, { get: function () { + return getInternalState(this)[key]; + } }); +}; + +var isArrayBuffer = function (it) { + var klass; + return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; +}; + +var isTypedArrayIndex = function (target, key) { + return isTypedArray(target) + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); +}; + +var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { + return isTypedArrayIndex(target, key = toPrimitive(key, true)) + ? createPropertyDescriptor(2, target[key]) + : nativeGetOwnPropertyDescriptor(target, key); +}; + +var wrappedDefineProperty = function defineProperty(target, key, descriptor) { + if (isTypedArrayIndex(target, key = toPrimitive(key, true)) + && isObject(descriptor) + && has(descriptor, 'value') + && !has(descriptor, 'get') + && !has(descriptor, 'set') + // TODO: add validation descriptor w/o calling accessors + && !descriptor.configurable + && (!has(descriptor, 'writable') || descriptor.writable) + && (!has(descriptor, 'enumerable') || descriptor.enumerable) + ) { + target[key] = descriptor.value; + return target; + } return nativeDefineProperty(target, key, descriptor); +}; + +if (DESCRIPTORS) { + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; + definePropertyModule.f = wrappedDefineProperty; + addGetter(TypedArrayPrototype, 'buffer'); + addGetter(TypedArrayPrototype, 'byteOffset'); + addGetter(TypedArrayPrototype, 'byteLength'); + addGetter(TypedArrayPrototype, 'length'); + } + + $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { + getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, + defineProperty: wrappedDefineProperty + }); + + // eslint-disable-next-line max-statements + module.exports = function (TYPE, BYTES, wrapper, CLAMPED) { + var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + TYPE; + var SETTER = 'set' + TYPE; + var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; + var TypedArrayConstructor = NativeTypedArrayConstructor; + var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; + var exported = {}; + + var getter = function (that, index) { + var data = getInternalState(that); + return data.view[GETTER](index * BYTES + data.byteOffset, true); + }; + + var setter = function (that, index, value) { + var data = getInternalState(that); + if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; + data.view[SETTER](index * BYTES + data.byteOffset, value, true); + }; + + var addElement = function (that, index) { + nativeDefineProperty(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + TypedArrayConstructor = wrapper(function (that, data, offset, $length) { + anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME); + var index = 0; + var byteOffset = 0; + var buffer, byteLength, length; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new ArrayBuffer(byteLength); + } else if (isArrayBuffer(data)) { + buffer = data; + byteOffset = toOffset(offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - byteOffset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (isTypedArray(data)) { + return fromList(TypedArrayConstructor, data); + } else { + return typedArrayFrom.call(TypedArrayConstructor, data); + } + setInternalState(that, { + buffer: buffer, + byteOffset: byteOffset, + byteLength: byteLength, + length: length, + view: new DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype); + } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { + TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { + anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); + if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)); + if (isArrayBuffer(data)) return $length !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) + : typedArrayOffset !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) + : new NativeTypedArrayConstructor(data); + if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); + return typedArrayFrom.call(TypedArrayConstructor, data); + }); + + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { + if (!(key in TypedArrayConstructor)) hide(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); + }); + TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; + } + + if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { + hide(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); + } + + if (TYPED_ARRAY_TAG) hide(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); + + exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; + + $({ + global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS + }, exported); + + if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { + hide(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); + } + + if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { + hide(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); + } + + setSpecies(CONSTRUCTOR_NAME); + }; +} else module.exports = function () { /* empty */ }; diff --git a/core-js/internals/typed-array-from.js b/core-js/internals/typed-array-from.js new file mode 100644 index 0000000000..28d6e3456e --- /dev/null +++ b/core-js/internals/typed-array-from.js @@ -0,0 +1,31 @@ +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var getIteratorMethod = require('../internals/get-iterator-method'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var bind = require('../internals/bind-context'); +var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor; + +module.exports = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var i, length, result, step, iterator; + if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) { + iterator = iteratorMethod.call(O); + O = []; + while (!(step = iterator.next()).done) { + O.push(step.value); + } + } + if (mapping && argumentsLength > 2) { + mapfn = bind(mapfn, arguments[2], 2); + } + length = toLength(O.length); + result = new (aTypedArrayConstructor(this))(length); + for (i = 0; length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; +}; diff --git a/core-js/internals/typed-arrays-constructors-requires-wrappers.js b/core-js/internals/typed-arrays-constructors-requires-wrappers.js new file mode 100644 index 0000000000..675466f063 --- /dev/null +++ b/core-js/internals/typed-arrays-constructors-requires-wrappers.js @@ -0,0 +1,22 @@ +/* eslint-disable no-new */ +var global = require('../internals/global'); +var fails = require('../internals/fails'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS; + +var ArrayBuffer = global.ArrayBuffer; +var Int8Array = global.Int8Array; + +module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { + Int8Array(1); +}) || !fails(function () { + new Int8Array(-1); +}) || !checkCorrectnessOfIteration(function (iterable) { + new Int8Array(); + new Int8Array(null); + new Int8Array(1.5); + new Int8Array(iterable); +}, true) || fails(function () { + // Safari 11 bug + return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; +}); diff --git a/core-js/internals/uid.js b/core-js/internals/uid.js new file mode 100644 index 0000000000..384c124ef5 --- /dev/null +++ b/core-js/internals/uid.js @@ -0,0 +1,6 @@ +var id = 0; +var postfix = Math.random(); + +module.exports = function (key) { + return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); +}; diff --git a/core-js/internals/user-agent.js b/core-js/internals/user-agent.js new file mode 100644 index 0000000000..30dfa9d7f3 --- /dev/null +++ b/core-js/internals/user-agent.js @@ -0,0 +1,3 @@ +var getBuiltIn = require('../internals/get-built-in'); + +module.exports = getBuiltIn('navigator', 'userAgent') || ''; diff --git a/core-js/internals/webkit-string-pad-bug.js b/core-js/internals/webkit-string-pad-bug.js new file mode 100644 index 0000000000..31ab9fc222 --- /dev/null +++ b/core-js/internals/webkit-string-pad-bug.js @@ -0,0 +1,5 @@ +// https://github.com/zloirock/core-js/issues/280 +var userAgent = require('../internals/user-agent'); + +// eslint-disable-next-line unicorn/no-unsafe-regex +module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); diff --git a/core-js/internals/well-known-symbol.js b/core-js/internals/well-known-symbol.js new file mode 100644 index 0000000000..9f9fed1b7a --- /dev/null +++ b/core-js/internals/well-known-symbol.js @@ -0,0 +1,12 @@ +var global = require('../internals/global'); +var shared = require('../internals/shared'); +var uid = require('../internals/uid'); +var NATIVE_SYMBOL = require('../internals/native-symbol'); + +var Symbol = global.Symbol; +var store = shared('wks'); + +module.exports = function (name) { + return store[name] || (store[name] = NATIVE_SYMBOL && Symbol[name] + || (NATIVE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; diff --git a/core-js/internals/whitespaces.js b/core-js/internals/whitespaces.js new file mode 100644 index 0000000000..0924bab146 --- /dev/null +++ b/core-js/internals/whitespaces.js @@ -0,0 +1,3 @@ +// a string of all valid unicode whitespaces +// eslint-disable-next-line max-len +module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; diff --git a/core-js/internals/wrapped-well-known-symbol.js b/core-js/internals/wrapped-well-known-symbol.js new file mode 100644 index 0000000000..101822f666 --- /dev/null +++ b/core-js/internals/wrapped-well-known-symbol.js @@ -0,0 +1 @@ +exports.f = require('../internals/well-known-symbol'); diff --git a/core-js/modules/README.md b/core-js/modules/README.md new file mode 100644 index 0000000000..0d6b3cb0e7 --- /dev/null +++ b/core-js/modules/README.md @@ -0,0 +1 @@ +This folder contains implementations of polyfills. It's not recommended to include in your projects directly if you don't completely understand what are you doing. diff --git a/core-js/modules/es.array-buffer.constructor.js b/core-js/modules/es.array-buffer.constructor.js new file mode 100644 index 0000000000..b4e4df4581 --- /dev/null +++ b/core-js/modules/es.array-buffer.constructor.js @@ -0,0 +1,17 @@ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var arrayBufferModule = require('../internals/array-buffer'); +var setSpecies = require('../internals/set-species'); + +var ARRAY_BUFFER = 'ArrayBuffer'; +var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; +var NativeArrayBuffer = global[ARRAY_BUFFER]; + +// `ArrayBuffer` constructor +// https://tc39.github.io/ecma262/#sec-arraybuffer-constructor +$({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, { + ArrayBuffer: ArrayBuffer +}); + +setSpecies(ARRAY_BUFFER); diff --git a/core-js/modules/es.array-buffer.is-view.js b/core-js/modules/es.array-buffer.is-view.js new file mode 100644 index 0000000000..0b23d5c321 --- /dev/null +++ b/core-js/modules/es.array-buffer.is-view.js @@ -0,0 +1,10 @@ +var $ = require('../internals/export'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); + +var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; + +// `ArrayBuffer.isView` method +// https://tc39.github.io/ecma262/#sec-arraybuffer.isview +$({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { + isView: ArrayBufferViewCore.isView +}); diff --git a/core-js/modules/es.array-buffer.slice.js b/core-js/modules/es.array-buffer.slice.js new file mode 100644 index 0000000000..c1375434f6 --- /dev/null +++ b/core-js/modules/es.array-buffer.slice.js @@ -0,0 +1,36 @@ +'use strict'; +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var ArrayBufferModule = require('../internals/array-buffer'); +var anObject = require('../internals/an-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toLength = require('../internals/to-length'); +var speciesConstructor = require('../internals/species-constructor'); + +var ArrayBuffer = ArrayBufferModule.ArrayBuffer; +var DataView = ArrayBufferModule.DataView; +var nativeArrayBufferSlice = ArrayBuffer.prototype.slice; + +var INCORRECT_SLICE = fails(function () { + return !new ArrayBuffer(2).slice(1, undefined).byteLength; +}); + +// `ArrayBuffer.prototype.slice` method +// https://tc39.github.io/ecma262/#sec-arraybuffer.prototype.slice +$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { + slice: function slice(start, end) { + if (nativeArrayBufferSlice !== undefined && end === undefined) { + return nativeArrayBufferSlice.call(anObject(this), start); // FF fix + } + var length = anObject(this).byteLength; + var first = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first)); + var viewSource = new DataView(this); + var viewTarget = new DataView(result); + var index = 0; + while (first < fin) { + viewTarget.setUint8(index++, viewSource.getUint8(first++)); + } return result; + } +}); diff --git a/core-js/modules/es.array.concat.js b/core-js/modules/es.array.concat.js new file mode 100644 index 0000000000..c819dd58ed --- /dev/null +++ b/core-js/modules/es.array.concat.js @@ -0,0 +1,56 @@ +'use strict'; +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var isArray = require('../internals/is-array'); +var isObject = require('../internals/is-object'); +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var createProperty = require('../internals/create-property'); +var arraySpeciesCreate = require('../internals/array-species-create'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); +var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; +var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; + +var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; +}); + +var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); + +var isConcatSpreadable = function (O) { + if (!isObject(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); +}; + +var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; + +// `Array.prototype.concat` method +// https://tc39.github.io/ecma262/#sec-array.prototype.concat +// with adding support of @@isConcatSpreadable and @@species +$({ target: 'Array', proto: true, forced: FORCED }, { + concat: function concat(arg) { // eslint-disable-line no-unused-vars + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments[i]; + if (isConcatSpreadable(E)) { + len = toLength(E.length); + if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); + } else { + if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + createProperty(A, n++, E); + } + } + A.length = n; + return A; + } +}); diff --git a/core-js/modules/es.array.copy-within.js b/core-js/modules/es.array.copy-within.js new file mode 100644 index 0000000000..1fb0dda49e --- /dev/null +++ b/core-js/modules/es.array.copy-within.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); +var copyWithin = require('../internals/array-copy-within'); +var addToUnscopables = require('../internals/add-to-unscopables'); + +// `Array.prototype.copyWithin` method +// https://tc39.github.io/ecma262/#sec-array.prototype.copywithin +$({ target: 'Array', proto: true }, { + copyWithin: copyWithin +}); + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('copyWithin'); diff --git a/core-js/modules/es.array.every.js b/core-js/modules/es.array.every.js new file mode 100644 index 0000000000..da54b92533 --- /dev/null +++ b/core-js/modules/es.array.every.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var $every = require('../internals/array-iteration').every; +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +// `Array.prototype.every` method +// https://tc39.github.io/ecma262/#sec-array.prototype.every +$({ target: 'Array', proto: true, forced: sloppyArrayMethod('every') }, { + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.array.fill.js b/core-js/modules/es.array.fill.js new file mode 100644 index 0000000000..ba9f4b46f3 --- /dev/null +++ b/core-js/modules/es.array.fill.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); +var fill = require('../internals/array-fill'); +var addToUnscopables = require('../internals/add-to-unscopables'); + +// `Array.prototype.fill` method +// https://tc39.github.io/ecma262/#sec-array.prototype.fill +$({ target: 'Array', proto: true }, { + fill: fill +}); + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('fill'); diff --git a/core-js/modules/es.array.filter.js b/core-js/modules/es.array.filter.js new file mode 100644 index 0000000000..54561a908e --- /dev/null +++ b/core-js/modules/es.array.filter.js @@ -0,0 +1,13 @@ +'use strict'; +var $ = require('../internals/export'); +var $filter = require('../internals/array-iteration').filter; +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); + +// `Array.prototype.filter` method +// https://tc39.github.io/ecma262/#sec-array.prototype.filter +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.array.find-index.js b/core-js/modules/es.array.find-index.js new file mode 100644 index 0000000000..6a13c7b27b --- /dev/null +++ b/core-js/modules/es.array.find-index.js @@ -0,0 +1,21 @@ +'use strict'; +var $ = require('../internals/export'); +var $findIndex = require('../internals/array-iteration').findIndex; +var addToUnscopables = require('../internals/add-to-unscopables'); + +var FIND_INDEX = 'findIndex'; +var SKIPS_HOLES = true; + +// Shouldn't skip holes +if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; }); + +// `Array.prototype.findIndex` method +// https://tc39.github.io/ecma262/#sec-array.prototype.findindex +$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables(FIND_INDEX); diff --git a/core-js/modules/es.array.find.js b/core-js/modules/es.array.find.js new file mode 100644 index 0000000000..961f804bf2 --- /dev/null +++ b/core-js/modules/es.array.find.js @@ -0,0 +1,21 @@ +'use strict'; +var $ = require('../internals/export'); +var $find = require('../internals/array-iteration').find; +var addToUnscopables = require('../internals/add-to-unscopables'); + +var FIND = 'find'; +var SKIPS_HOLES = true; + +// Shouldn't skip holes +if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); + +// `Array.prototype.find` method +// https://tc39.github.io/ecma262/#sec-array.prototype.find +$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables(FIND); diff --git a/core-js/modules/es.array.flat-map.js b/core-js/modules/es.array.flat-map.js new file mode 100644 index 0000000000..5469beef3e --- /dev/null +++ b/core-js/modules/es.array.flat-map.js @@ -0,0 +1,21 @@ +'use strict'; +var $ = require('../internals/export'); +var flattenIntoArray = require('../internals/flatten-into-array'); +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var aFunction = require('../internals/a-function'); +var arraySpeciesCreate = require('../internals/array-species-create'); + +// `Array.prototype.flatMap` method +// https://github.com/tc39/proposal-flatMap +$({ target: 'Array', proto: true }, { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen = toLength(O.length); + var A; + aFunction(callbackfn); + A = arraySpeciesCreate(O, 0); + A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return A; + } +}); diff --git a/core-js/modules/es.array.flat.js b/core-js/modules/es.array.flat.js new file mode 100644 index 0000000000..cb2c9d7535 --- /dev/null +++ b/core-js/modules/es.array.flat.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var flattenIntoArray = require('../internals/flatten-into-array'); +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var toInteger = require('../internals/to-integer'); +var arraySpeciesCreate = require('../internals/array-species-create'); + +// `Array.prototype.flat` method +// https://github.com/tc39/proposal-flatMap +$({ target: 'Array', proto: true }, { + flat: function flat(/* depthArg = 1 */) { + var depthArg = arguments.length ? arguments[0] : undefined; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); diff --git a/core-js/modules/es.array.for-each.js b/core-js/modules/es.array.for-each.js new file mode 100644 index 0000000000..4fb29d0730 --- /dev/null +++ b/core-js/modules/es.array.for-each.js @@ -0,0 +1,9 @@ +'use strict'; +var $ = require('../internals/export'); +var forEach = require('../internals/array-for-each'); + +// `Array.prototype.forEach` method +// https://tc39.github.io/ecma262/#sec-array.prototype.foreach +$({ target: 'Array', proto: true, forced: [].forEach != forEach }, { + forEach: forEach +}); diff --git a/core-js/modules/es.array.from.js b/core-js/modules/es.array.from.js new file mode 100644 index 0000000000..5c21cbca97 --- /dev/null +++ b/core-js/modules/es.array.from.js @@ -0,0 +1,13 @@ +var $ = require('../internals/export'); +var from = require('../internals/array-from'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); + +var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { + Array.from(iterable); +}); + +// `Array.from` method +// https://tc39.github.io/ecma262/#sec-array.from +$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { + from: from +}); diff --git a/core-js/modules/es.array.includes.js b/core-js/modules/es.array.includes.js new file mode 100644 index 0000000000..a374c0faae --- /dev/null +++ b/core-js/modules/es.array.includes.js @@ -0,0 +1,15 @@ +'use strict'; +var $ = require('../internals/export'); +var $includes = require('../internals/array-includes').includes; +var addToUnscopables = require('../internals/add-to-unscopables'); + +// `Array.prototype.includes` method +// https://tc39.github.io/ecma262/#sec-array.prototype.includes +$({ target: 'Array', proto: true }, { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('includes'); diff --git a/core-js/modules/es.array.index-of.js b/core-js/modules/es.array.index-of.js new file mode 100644 index 0000000000..004399dff9 --- /dev/null +++ b/core-js/modules/es.array.index-of.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var $indexOf = require('../internals/array-includes').indexOf; +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +var nativeIndexOf = [].indexOf; + +var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; +var SLOPPY_METHOD = sloppyArrayMethod('indexOf'); + +// `Array.prototype.indexOf` method +// https://tc39.github.io/ecma262/#sec-array.prototype.indexof +$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, { + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? nativeIndexOf.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.array.is-array.js b/core-js/modules/es.array.is-array.js new file mode 100644 index 0000000000..b77fad6a0d --- /dev/null +++ b/core-js/modules/es.array.is-array.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var isArray = require('../internals/is-array'); + +// `Array.isArray` method +// https://tc39.github.io/ecma262/#sec-array.isarray +$({ target: 'Array', stat: true }, { + isArray: isArray +}); diff --git a/core-js/modules/es.array.iterator.js b/core-js/modules/es.array.iterator.js new file mode 100644 index 0000000000..5e64422699 --- /dev/null +++ b/core-js/modules/es.array.iterator.js @@ -0,0 +1,53 @@ +'use strict'; +var toIndexedObject = require('../internals/to-indexed-object'); +var addToUnscopables = require('../internals/add-to-unscopables'); +var Iterators = require('../internals/iterators'); +var InternalStateModule = require('../internals/internal-state'); +var defineIterator = require('../internals/define-iterator'); + +var ARRAY_ITERATOR = 'Array Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); + +// `Array.prototype.entries` method +// https://tc39.github.io/ecma262/#sec-array.prototype.entries +// `Array.prototype.keys` method +// https://tc39.github.io/ecma262/#sec-array.prototype.keys +// `Array.prototype.values` method +// https://tc39.github.io/ecma262/#sec-array.prototype.values +// `Array.prototype[@@iterator]` method +// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator +// `CreateArrayIterator` internal method +// https://tc39.github.io/ecma262/#sec-createarrayiterator +module.exports = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), // target + index: 0, // next index + kind: kind // kind + }); +// `%ArrayIteratorPrototype%.next` method +// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next +}, function () { + var state = getInternalState(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return { value: undefined, done: true }; + } + if (kind == 'keys') return { value: index, done: false }; + if (kind == 'values') return { value: target[index], done: false }; + return { value: [index, target[index]], done: false }; +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% +// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject +// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject +Iterators.Arguments = Iterators.Array; + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); diff --git a/core-js/modules/es.array.join.js b/core-js/modules/es.array.join.js new file mode 100644 index 0000000000..c733598b40 --- /dev/null +++ b/core-js/modules/es.array.join.js @@ -0,0 +1,18 @@ +'use strict'; +var $ = require('../internals/export'); +var IndexedObject = require('../internals/indexed-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +var nativeJoin = [].join; + +var ES3_STRINGS = IndexedObject != Object; +var SLOPPY_METHOD = sloppyArrayMethod('join', ','); + +// `Array.prototype.join` method +// https://tc39.github.io/ecma262/#sec-array.prototype.join +$({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, { + join: function join(separator) { + return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); + } +}); diff --git a/core-js/modules/es.array.last-index-of.js b/core-js/modules/es.array.last-index-of.js new file mode 100644 index 0000000000..d2090551b1 --- /dev/null +++ b/core-js/modules/es.array.last-index-of.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var lastIndexOf = require('../internals/array-last-index-of'); + +// `Array.prototype.lastIndexOf` method +// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof +$({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, { + lastIndexOf: lastIndexOf +}); diff --git a/core-js/modules/es.array.map.js b/core-js/modules/es.array.map.js new file mode 100644 index 0000000000..ef71387677 --- /dev/null +++ b/core-js/modules/es.array.map.js @@ -0,0 +1,13 @@ +'use strict'; +var $ = require('../internals/export'); +var $map = require('../internals/array-iteration').map; +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); + +// `Array.prototype.map` method +// https://tc39.github.io/ecma262/#sec-array.prototype.map +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, { + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.array.of.js b/core-js/modules/es.array.of.js new file mode 100644 index 0000000000..2788091b3c --- /dev/null +++ b/core-js/modules/es.array.of.js @@ -0,0 +1,23 @@ +'use strict'; +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var createProperty = require('../internals/create-property'); + +var ISNT_GENERIC = fails(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}); + +// `Array.of` method +// https://tc39.github.io/ecma262/#sec-array.of +// WebKit Array.of isn't generic +$({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { + of: function of(/* ...args */) { + var index = 0; + var argumentsLength = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(argumentsLength); + while (argumentsLength > index) createProperty(result, index, arguments[index++]); + result.length = argumentsLength; + return result; + } +}); diff --git a/core-js/modules/es.array.reduce-right.js b/core-js/modules/es.array.reduce-right.js new file mode 100644 index 0000000000..292f9d84f8 --- /dev/null +++ b/core-js/modules/es.array.reduce-right.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var $reduceRight = require('../internals/array-reduce').right; +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +// `Array.prototype.reduceRight` method +// https://tc39.github.io/ecma262/#sec-array.prototype.reduceright +$({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduceRight') }, { + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.array.reduce.js b/core-js/modules/es.array.reduce.js new file mode 100644 index 0000000000..a776812697 --- /dev/null +++ b/core-js/modules/es.array.reduce.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var $reduce = require('../internals/array-reduce').left; +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +// `Array.prototype.reduce` method +// https://tc39.github.io/ecma262/#sec-array.prototype.reduce +$({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, { + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.array.reverse.js b/core-js/modules/es.array.reverse.js new file mode 100644 index 0000000000..16ea40e91c --- /dev/null +++ b/core-js/modules/es.array.reverse.js @@ -0,0 +1,17 @@ +'use strict'; +var $ = require('../internals/export'); +var isArray = require('../internals/is-array'); + +var nativeReverse = [].reverse; +var test = [1, 2]; + +// `Array.prototype.reverse` method +// https://tc39.github.io/ecma262/#sec-array.prototype.reverse +// fix for Safari 12.0 bug +// https://bugs.webkit.org/show_bug.cgi?id=188794 +$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, { + reverse: function reverse() { + if (isArray(this)) this.length = this.length; + return nativeReverse.call(this); + } +}); diff --git a/core-js/modules/es.array.slice.js b/core-js/modules/es.array.slice.js new file mode 100644 index 0000000000..ac71ebf78a --- /dev/null +++ b/core-js/modules/es.array.slice.js @@ -0,0 +1,45 @@ +'use strict'; +var $ = require('../internals/export'); +var isObject = require('../internals/is-object'); +var isArray = require('../internals/is-array'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toLength = require('../internals/to-length'); +var toIndexedObject = require('../internals/to-indexed-object'); +var createProperty = require('../internals/create-property'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); +var nativeSlice = [].slice; +var max = Math.max; + +// `Array.prototype.slice` method +// https://tc39.github.io/ecma262/#sec-array.prototype.slice +// fallback for not array-like ES3 strings and DOM objects +$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = toLength(O.length); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, result, n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES]; + if (Constructor === null) Constructor = undefined; + } + if (Constructor === Array || Constructor === undefined) { + return nativeSlice.call(O, k, fin); + } + } + result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0)); + for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); + result.length = n; + return result; + } +}); diff --git a/core-js/modules/es.array.some.js b/core-js/modules/es.array.some.js new file mode 100644 index 0000000000..60e77ed6dc --- /dev/null +++ b/core-js/modules/es.array.some.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var $some = require('../internals/array-iteration').some; +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +// `Array.prototype.some` method +// https://tc39.github.io/ecma262/#sec-array.prototype.some +$({ target: 'Array', proto: true, forced: sloppyArrayMethod('some') }, { + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.array.sort.js b/core-js/modules/es.array.sort.js new file mode 100644 index 0000000000..b9d70dc916 --- /dev/null +++ b/core-js/modules/es.array.sort.js @@ -0,0 +1,32 @@ +'use strict'; +var $ = require('../internals/export'); +var aFunction = require('../internals/a-function'); +var toObject = require('../internals/to-object'); +var fails = require('../internals/fails'); +var sloppyArrayMethod = require('../internals/sloppy-array-method'); + +var nativeSort = [].sort; +var test = [1, 2, 3]; + +// IE8- +var FAILS_ON_UNDEFINED = fails(function () { + test.sort(undefined); +}); +// V8 bug +var FAILS_ON_NULL = fails(function () { + test.sort(null); +}); +// Old WebKit +var SLOPPY_METHOD = sloppyArrayMethod('sort'); + +var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD; + +// `Array.prototype.sort` method +// https://tc39.github.io/ecma262/#sec-array.prototype.sort +$({ target: 'Array', proto: true, forced: FORCED }, { + sort: function sort(comparefn) { + return comparefn === undefined + ? nativeSort.call(toObject(this)) + : nativeSort.call(toObject(this), aFunction(comparefn)); + } +}); diff --git a/core-js/modules/es.array.species.js b/core-js/modules/es.array.species.js new file mode 100644 index 0000000000..a0e78299f7 --- /dev/null +++ b/core-js/modules/es.array.species.js @@ -0,0 +1,5 @@ +var setSpecies = require('../internals/set-species'); + +// `Array[@@species]` getter +// https://tc39.github.io/ecma262/#sec-get-array-@@species +setSpecies('Array'); diff --git a/core-js/modules/es.array.splice.js b/core-js/modules/es.array.splice.js new file mode 100644 index 0000000000..aa17d55551 --- /dev/null +++ b/core-js/modules/es.array.splice.js @@ -0,0 +1,66 @@ +'use strict'; +var $ = require('../internals/export'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toInteger = require('../internals/to-integer'); +var toLength = require('../internals/to-length'); +var toObject = require('../internals/to-object'); +var arraySpeciesCreate = require('../internals/array-species-create'); +var createProperty = require('../internals/create-property'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); + +var max = Math.max; +var min = Math.min; +var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; +var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; + +// `Array.prototype.splice` method +// https://tc39.github.io/ecma262/#sec-array.prototype.splice +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, { + splice: function splice(start, deleteCount /* , ...items */) { + var O = toObject(this); + var len = toLength(O.length); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, actualDeleteCount, A, k, from, to; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart); + } + if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { + throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); + } + A = arraySpeciesCreate(O, actualDeleteCount); + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) createProperty(A, k, O[from]); + } + A.length = actualDeleteCount; + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + } + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments[k + 2]; + } + O.length = len - actualDeleteCount + insertCount; + return A; + } +}); diff --git a/core-js/modules/es.array.unscopables.flat-map.js b/core-js/modules/es.array.unscopables.flat-map.js new file mode 100644 index 0000000000..593cf055cf --- /dev/null +++ b/core-js/modules/es.array.unscopables.flat-map.js @@ -0,0 +1,5 @@ +// this method was added to unscopables after implementation +// in popular engines, so it's moved to a separate module +var addToUnscopables = require('../internals/add-to-unscopables'); + +addToUnscopables('flatMap'); diff --git a/core-js/modules/es.array.unscopables.flat.js b/core-js/modules/es.array.unscopables.flat.js new file mode 100644 index 0000000000..ce6656c312 --- /dev/null +++ b/core-js/modules/es.array.unscopables.flat.js @@ -0,0 +1,5 @@ +// this method was added to unscopables after implementation +// in popular engines, so it's moved to a separate module +var addToUnscopables = require('../internals/add-to-unscopables'); + +addToUnscopables('flat'); diff --git a/core-js/modules/es.data-view.js b/core-js/modules/es.data-view.js new file mode 100644 index 0000000000..c369dd3c89 --- /dev/null +++ b/core-js/modules/es.data-view.js @@ -0,0 +1,9 @@ +var $ = require('../internals/export'); +var ArrayBufferModule = require('../internals/array-buffer'); +var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER; + +// `DataView` constructor +// https://tc39.github.io/ecma262/#sec-dataview-constructor +$({ global: true, forced: !NATIVE_ARRAY_BUFFER }, { + DataView: ArrayBufferModule.DataView +}); diff --git a/core-js/modules/es.date.now.js b/core-js/modules/es.date.now.js new file mode 100644 index 0000000000..c4dc75b09e --- /dev/null +++ b/core-js/modules/es.date.now.js @@ -0,0 +1,9 @@ +var $ = require('../internals/export'); + +// `Date.now` method +// https://tc39.github.io/ecma262/#sec-date.now +$({ target: 'Date', stat: true }, { + now: function now() { + return new Date().getTime(); + } +}); diff --git a/core-js/modules/es.date.to-iso-string.js b/core-js/modules/es.date.to-iso-string.js new file mode 100644 index 0000000000..14f8ae0b76 --- /dev/null +++ b/core-js/modules/es.date.to-iso-string.js @@ -0,0 +1,9 @@ +var $ = require('../internals/export'); +var toISOString = require('../internals/date-to-iso-string'); + +// `Date.prototype.toISOString` method +// https://tc39.github.io/ecma262/#sec-date.prototype.toisostring +// PhantomJS / old WebKit has a broken implementations +$({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, { + toISOString: toISOString +}); diff --git a/core-js/modules/es.date.to-json.js b/core-js/modules/es.date.to-json.js new file mode 100644 index 0000000000..bcf45175f5 --- /dev/null +++ b/core-js/modules/es.date.to-json.js @@ -0,0 +1,21 @@ +'use strict'; +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var toObject = require('../internals/to-object'); +var toPrimitive = require('../internals/to-primitive'); + +var FORCED = fails(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}); + +// `Date.prototype.toJSON` method +// https://tc39.github.io/ecma262/#sec-date.prototype.tojson +$({ target: 'Date', proto: true, forced: FORCED }, { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); diff --git a/core-js/modules/es.date.to-primitive.js b/core-js/modules/es.date.to-primitive.js new file mode 100644 index 0000000000..7a308279ac --- /dev/null +++ b/core-js/modules/es.date.to-primitive.js @@ -0,0 +1,10 @@ +var hide = require('../internals/hide'); +var dateToPrimitive = require('../internals/date-to-primitive'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); +var DatePrototype = Date.prototype; + +// `Date.prototype[@@toPrimitive]` method +// https://tc39.github.io/ecma262/#sec-date.prototype-@@toprimitive +if (!(TO_PRIMITIVE in DatePrototype)) hide(DatePrototype, TO_PRIMITIVE, dateToPrimitive); diff --git a/core-js/modules/es.date.to-string.js b/core-js/modules/es.date.to-string.js new file mode 100644 index 0000000000..dc28f0ad93 --- /dev/null +++ b/core-js/modules/es.date.to-string.js @@ -0,0 +1,17 @@ +var redefine = require('../internals/redefine'); + +var DatePrototype = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var nativeDateToString = DatePrototype[TO_STRING]; +var getTime = DatePrototype.getTime; + +// `Date.prototype.toString` method +// https://tc39.github.io/ecma262/#sec-date.prototype.tostring +if (new Date(NaN) + '' != INVALID_DATE) { + redefine(DatePrototype, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? nativeDateToString.call(this) : INVALID_DATE; + }); +} diff --git a/core-js/modules/es.function.bind.js b/core-js/modules/es.function.bind.js new file mode 100644 index 0000000000..fb33e969f1 --- /dev/null +++ b/core-js/modules/es.function.bind.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var bind = require('../internals/function-bind'); + +// `Function.prototype.bind` method +// https://tc39.github.io/ecma262/#sec-function.prototype.bind +$({ target: 'Function', proto: true }, { + bind: bind +}); diff --git a/core-js/modules/es.function.has-instance.js b/core-js/modules/es.function.has-instance.js new file mode 100644 index 0000000000..01383bd9e7 --- /dev/null +++ b/core-js/modules/es.function.has-instance.js @@ -0,0 +1,20 @@ +'use strict'; +var isObject = require('../internals/is-object'); +var definePropertyModule = require('../internals/object-define-property'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var HAS_INSTANCE = wellKnownSymbol('hasInstance'); +var FunctionPrototype = Function.prototype; + +// `Function.prototype[@@hasInstance]` method +// https://tc39.github.io/ecma262/#sec-function.prototype-@@hasinstance +if (!(HAS_INSTANCE in FunctionPrototype)) { + definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; + } }); +} diff --git a/core-js/modules/es.function.name.js b/core-js/modules/es.function.name.js new file mode 100644 index 0000000000..2312d91ddd --- /dev/null +++ b/core-js/modules/es.function.name.js @@ -0,0 +1,22 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var defineProperty = require('../internals/object-define-property').f; + +var FunctionPrototype = Function.prototype; +var FunctionPrototypeToString = FunctionPrototype.toString; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; + +// Function instances `.name` property +// https://tc39.github.io/ecma262/#sec-function-instances-name +if (DESCRIPTORS && !(NAME in FunctionPrototype)) { + defineProperty(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return FunctionPrototypeToString.call(this).match(nameRE)[1]; + } catch (error) { + return ''; + } + } + }); +} diff --git a/core-js/modules/es.json.to-string-tag.js b/core-js/modules/es.json.to-string-tag.js new file mode 100644 index 0000000000..bdfa0cd810 --- /dev/null +++ b/core-js/modules/es.json.to-string-tag.js @@ -0,0 +1,6 @@ +var global = require('../internals/global'); +var setToStringTag = require('../internals/set-to-string-tag'); + +// JSON[@@toStringTag] property +// https://tc39.github.io/ecma262/#sec-json-@@tostringtag +setToStringTag(global.JSON, 'JSON', true); diff --git a/core-js/modules/es.map.js b/core-js/modules/es.map.js new file mode 100644 index 0000000000..ea5f598d8c --- /dev/null +++ b/core-js/modules/es.map.js @@ -0,0 +1,9 @@ +'use strict'; +var collection = require('../internals/collection'); +var collectionStrong = require('../internals/collection-strong'); + +// `Map` constructor +// https://tc39.github.io/ecma262/#sec-map-objects +module.exports = collection('Map', function (get) { + return function Map() { return get(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong, true); diff --git a/core-js/modules/es.math.acosh.js b/core-js/modules/es.math.acosh.js new file mode 100644 index 0000000000..62c85a4c33 --- /dev/null +++ b/core-js/modules/es.math.acosh.js @@ -0,0 +1,23 @@ +var $ = require('../internals/export'); +var log1p = require('../internals/math-log1p'); + +var nativeAcosh = Math.acosh; +var log = Math.log; +var sqrt = Math.sqrt; +var LN2 = Math.LN2; + +var FORCED = !nativeAcosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + || Math.floor(nativeAcosh(Number.MAX_VALUE)) != 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + || nativeAcosh(Infinity) != Infinity; + +// `Math.acosh` method +// https://tc39.github.io/ecma262/#sec-math.acosh +$({ target: 'Math', stat: true, forced: FORCED }, { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? log(x) + LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); diff --git a/core-js/modules/es.math.asinh.js b/core-js/modules/es.math.asinh.js new file mode 100644 index 0000000000..9308e2186d --- /dev/null +++ b/core-js/modules/es.math.asinh.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); + +var nativeAsinh = Math.asinh; +var log = Math.log; +var sqrt = Math.sqrt; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1)); +} + +// `Math.asinh` method +// https://tc39.github.io/ecma262/#sec-math.asinh +// Tor Browser bug: Math.asinh(0) -> -0 +$({ target: 'Math', stat: true, forced: !(nativeAsinh && 1 / nativeAsinh(0) > 0) }, { + asinh: asinh +}); diff --git a/core-js/modules/es.math.atanh.js b/core-js/modules/es.math.atanh.js new file mode 100644 index 0000000000..9116f8e483 --- /dev/null +++ b/core-js/modules/es.math.atanh.js @@ -0,0 +1,13 @@ +var $ = require('../internals/export'); + +var nativeAtanh = Math.atanh; +var log = Math.log; + +// `Math.atanh` method +// https://tc39.github.io/ecma262/#sec-math.atanh +// Tor Browser bug: Math.atanh(-0) -> 0 +$({ target: 'Math', stat: true, forced: !(nativeAtanh && 1 / nativeAtanh(-0) < 0) }, { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2; + } +}); diff --git a/core-js/modules/es.math.cbrt.js b/core-js/modules/es.math.cbrt.js new file mode 100644 index 0000000000..b93416f9cc --- /dev/null +++ b/core-js/modules/es.math.cbrt.js @@ -0,0 +1,13 @@ +var $ = require('../internals/export'); +var sign = require('../internals/math-sign'); + +var abs = Math.abs; +var pow = Math.pow; + +// `Math.cbrt` method +// https://tc39.github.io/ecma262/#sec-math.cbrt +$({ target: 'Math', stat: true }, { + cbrt: function cbrt(x) { + return sign(x = +x) * pow(abs(x), 1 / 3); + } +}); diff --git a/core-js/modules/es.math.clz32.js b/core-js/modules/es.math.clz32.js new file mode 100644 index 0000000000..7a18e64af6 --- /dev/null +++ b/core-js/modules/es.math.clz32.js @@ -0,0 +1,13 @@ +var $ = require('../internals/export'); + +var floor = Math.floor; +var log = Math.log; +var LOG2E = Math.LOG2E; + +// `Math.clz32` method +// https://tc39.github.io/ecma262/#sec-math.clz32 +$({ target: 'Math', stat: true }, { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - floor(log(x + 0.5) * LOG2E) : 32; + } +}); diff --git a/core-js/modules/es.math.cosh.js b/core-js/modules/es.math.cosh.js new file mode 100644 index 0000000000..0c7322a2f8 --- /dev/null +++ b/core-js/modules/es.math.cosh.js @@ -0,0 +1,15 @@ +var $ = require('../internals/export'); +var expm1 = require('../internals/math-expm1'); + +var nativeCosh = Math.cosh; +var abs = Math.abs; +var E = Math.E; + +// `Math.cosh` method +// https://tc39.github.io/ecma262/#sec-math.cosh +$({ target: 'Math', stat: true, forced: !nativeCosh || nativeCosh(710) === Infinity }, { + cosh: function cosh(x) { + var t = expm1(abs(x) - 1) + 1; + return (t + 1 / (t * E * E)) * (E / 2); + } +}); diff --git a/core-js/modules/es.math.expm1.js b/core-js/modules/es.math.expm1.js new file mode 100644 index 0000000000..956eb6f129 --- /dev/null +++ b/core-js/modules/es.math.expm1.js @@ -0,0 +1,6 @@ +var $ = require('../internals/export'); +var expm1 = require('../internals/math-expm1'); + +// `Math.expm1` method +// https://tc39.github.io/ecma262/#sec-math.expm1 +$({ target: 'Math', stat: true, forced: expm1 != Math.expm1 }, { expm1: expm1 }); diff --git a/core-js/modules/es.math.fround.js b/core-js/modules/es.math.fround.js new file mode 100644 index 0000000000..5df62db8b0 --- /dev/null +++ b/core-js/modules/es.math.fround.js @@ -0,0 +1,6 @@ +var $ = require('../internals/export'); +var fround = require('../internals/math-fround'); + +// `Math.fround` method +// https://tc39.github.io/ecma262/#sec-math.fround +$({ target: 'Math', stat: true }, { fround: fround }); diff --git a/core-js/modules/es.math.hypot.js b/core-js/modules/es.math.hypot.js new file mode 100644 index 0000000000..0e8d17b46d --- /dev/null +++ b/core-js/modules/es.math.hypot.js @@ -0,0 +1,33 @@ +var $ = require('../internals/export'); + +var $hypot = Math.hypot; +var abs = Math.abs; +var sqrt = Math.sqrt; + +// Chrome 77 bug +// https://bugs.chromium.org/p/v8/issues/detail?id=9546 +var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; + +// `Math.hypot` method +// https://tc39.github.io/ecma262/#sec-math.hypot +$({ target: 'Math', stat: true, forced: BUGGY }, { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * sqrt(sum); + } +}); diff --git a/core-js/modules/es.math.imul.js b/core-js/modules/es.math.imul.js new file mode 100644 index 0000000000..3882a3e3a2 --- /dev/null +++ b/core-js/modules/es.math.imul.js @@ -0,0 +1,22 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); + +var nativeImul = Math.imul; + +var FORCED = fails(function () { + return nativeImul(0xFFFFFFFF, 5) != -5 || nativeImul.length != 2; +}); + +// `Math.imul` method +// https://tc39.github.io/ecma262/#sec-math.imul +// some WebKit versions fails with big numbers, some has wrong arity +$({ target: 'Math', stat: true, forced: FORCED }, { + imul: function imul(x, y) { + var UINT16 = 0xFFFF; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); diff --git a/core-js/modules/es.math.log10.js b/core-js/modules/es.math.log10.js new file mode 100644 index 0000000000..86ba3db424 --- /dev/null +++ b/core-js/modules/es.math.log10.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +var log = Math.log; +var LOG10E = Math.LOG10E; + +// `Math.log10` method +// https://tc39.github.io/ecma262/#sec-math.log10 +$({ target: 'Math', stat: true }, { + log10: function log10(x) { + return log(x) * LOG10E; + } +}); diff --git a/core-js/modules/es.math.log1p.js b/core-js/modules/es.math.log1p.js new file mode 100644 index 0000000000..0327661844 --- /dev/null +++ b/core-js/modules/es.math.log1p.js @@ -0,0 +1,6 @@ +var $ = require('../internals/export'); +var log1p = require('../internals/math-log1p'); + +// `Math.log1p` method +// https://tc39.github.io/ecma262/#sec-math.log1p +$({ target: 'Math', stat: true }, { log1p: log1p }); diff --git a/core-js/modules/es.math.log2.js b/core-js/modules/es.math.log2.js new file mode 100644 index 0000000000..22fcedf4f1 --- /dev/null +++ b/core-js/modules/es.math.log2.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +var log = Math.log; +var LN2 = Math.LN2; + +// `Math.log2` method +// https://tc39.github.io/ecma262/#sec-math.log2 +$({ target: 'Math', stat: true }, { + log2: function log2(x) { + return log(x) / LN2; + } +}); diff --git a/core-js/modules/es.math.sign.js b/core-js/modules/es.math.sign.js new file mode 100644 index 0000000000..19e3a782d3 --- /dev/null +++ b/core-js/modules/es.math.sign.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var sign = require('../internals/math-sign'); + +// `Math.sign` method +// https://tc39.github.io/ecma262/#sec-math.sign +$({ target: 'Math', stat: true }, { + sign: sign +}); diff --git a/core-js/modules/es.math.sinh.js b/core-js/modules/es.math.sinh.js new file mode 100644 index 0000000000..11ba610675 --- /dev/null +++ b/core-js/modules/es.math.sinh.js @@ -0,0 +1,20 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var expm1 = require('../internals/math-expm1'); + +var abs = Math.abs; +var exp = Math.exp; +var E = Math.E; + +var FORCED = fails(function () { + return Math.sinh(-2e-17) != -2e-17; +}); + +// `Math.sinh` method +// https://tc39.github.io/ecma262/#sec-math.sinh +// V8 near Chromium 38 has a problem with very small numbers +$({ target: 'Math', stat: true, forced: FORCED }, { + sinh: function sinh(x) { + return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2); + } +}); diff --git a/core-js/modules/es.math.tanh.js b/core-js/modules/es.math.tanh.js new file mode 100644 index 0000000000..3b574020ba --- /dev/null +++ b/core-js/modules/es.math.tanh.js @@ -0,0 +1,14 @@ +var $ = require('../internals/export'); +var expm1 = require('../internals/math-expm1'); + +var exp = Math.exp; + +// `Math.tanh` method +// https://tc39.github.io/ecma262/#sec-math.tanh +$({ target: 'Math', stat: true }, { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); diff --git a/core-js/modules/es.math.to-string-tag.js b/core-js/modules/es.math.to-string-tag.js new file mode 100644 index 0000000000..4ab08116d6 --- /dev/null +++ b/core-js/modules/es.math.to-string-tag.js @@ -0,0 +1,5 @@ +var setToStringTag = require('../internals/set-to-string-tag'); + +// Math[@@toStringTag] property +// https://tc39.github.io/ecma262/#sec-math-@@tostringtag +setToStringTag(Math, 'Math', true); diff --git a/core-js/modules/es.math.trunc.js b/core-js/modules/es.math.trunc.js new file mode 100644 index 0000000000..0e8351d914 --- /dev/null +++ b/core-js/modules/es.math.trunc.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +var ceil = Math.ceil; +var floor = Math.floor; + +// `Math.trunc` method +// https://tc39.github.io/ecma262/#sec-math.trunc +$({ target: 'Math', stat: true }, { + trunc: function trunc(it) { + return (it > 0 ? floor : ceil)(it); + } +}); diff --git a/core-js/modules/es.number.constructor.js b/core-js/modules/es.number.constructor.js new file mode 100644 index 0000000000..f906f8b3cc --- /dev/null +++ b/core-js/modules/es.number.constructor.js @@ -0,0 +1,78 @@ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var isForced = require('../internals/is-forced'); +var redefine = require('../internals/redefine'); +var has = require('../internals/has'); +var classof = require('../internals/classof-raw'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var toPrimitive = require('../internals/to-primitive'); +var fails = require('../internals/fails'); +var create = require('../internals/object-create'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var defineProperty = require('../internals/object-define-property').f; +var trim = require('../internals/string-trim').trim; + +var NUMBER = 'Number'; +var NativeNumber = global[NUMBER]; +var NumberPrototype = NativeNumber.prototype; + +// Opera ~12 has broken Object#toString +var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; + +// `ToNumber` abstract operation +// https://tc39.github.io/ecma262/#sec-tonumber +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + var first, third, radix, maxCode, digits, length, index, code; + if (typeof it == 'string' && it.length > 2) { + it = trim(it); + first = it.charCodeAt(0); + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i + default: return +it; + } + digits = it.slice(2); + length = digits.length; + for (index = 0; index < length; index++) { + code = digits.charCodeAt(index); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +// `Number` constructor +// https://tc39.github.io/ecma262/#sec-number-constructor +if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { + var NumberWrapper = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var dummy = this; + return dummy instanceof NumberWrapper + // check on 1..constructor(foo) case + && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER) + ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it); + }; + for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES2015 (in case, if modules with ES2015 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) { + defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)); + } + } + NumberWrapper.prototype = NumberPrototype; + NumberPrototype.constructor = NumberWrapper; + redefine(global, NUMBER, NumberWrapper); +} diff --git a/core-js/modules/es.number.epsilon.js b/core-js/modules/es.number.epsilon.js new file mode 100644 index 0000000000..b60272493f --- /dev/null +++ b/core-js/modules/es.number.epsilon.js @@ -0,0 +1,7 @@ +var $ = require('../internals/export'); + +// `Number.EPSILON` constant +// https://tc39.github.io/ecma262/#sec-number.epsilon +$({ target: 'Number', stat: true }, { + EPSILON: Math.pow(2, -52) +}); diff --git a/core-js/modules/es.number.is-finite.js b/core-js/modules/es.number.is-finite.js new file mode 100644 index 0000000000..6308eb4d99 --- /dev/null +++ b/core-js/modules/es.number.is-finite.js @@ -0,0 +1,6 @@ +var $ = require('../internals/export'); +var numberIsFinite = require('../internals/number-is-finite'); + +// `Number.isFinite` method +// https://tc39.github.io/ecma262/#sec-number.isfinite +$({ target: 'Number', stat: true }, { isFinite: numberIsFinite }); diff --git a/core-js/modules/es.number.is-integer.js b/core-js/modules/es.number.is-integer.js new file mode 100644 index 0000000000..b15b7393de --- /dev/null +++ b/core-js/modules/es.number.is-integer.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var isInteger = require('../internals/is-integer'); + +// `Number.isInteger` method +// https://tc39.github.io/ecma262/#sec-number.isinteger +$({ target: 'Number', stat: true }, { + isInteger: isInteger +}); diff --git a/core-js/modules/es.number.is-nan.js b/core-js/modules/es.number.is-nan.js new file mode 100644 index 0000000000..f384acc678 --- /dev/null +++ b/core-js/modules/es.number.is-nan.js @@ -0,0 +1,10 @@ +var $ = require('../internals/export'); + +// `Number.isNaN` method +// https://tc39.github.io/ecma262/#sec-number.isnan +$({ target: 'Number', stat: true }, { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); diff --git a/core-js/modules/es.number.is-safe-integer.js b/core-js/modules/es.number.is-safe-integer.js new file mode 100644 index 0000000000..cea6704a18 --- /dev/null +++ b/core-js/modules/es.number.is-safe-integer.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); +var isInteger = require('../internals/is-integer'); + +var abs = Math.abs; + +// `Number.isSafeInteger` method +// https://tc39.github.io/ecma262/#sec-number.issafeinteger +$({ target: 'Number', stat: true }, { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1FFFFFFFFFFFFF; + } +}); diff --git a/core-js/modules/es.number.max-safe-integer.js b/core-js/modules/es.number.max-safe-integer.js new file mode 100644 index 0000000000..7fc5890262 --- /dev/null +++ b/core-js/modules/es.number.max-safe-integer.js @@ -0,0 +1,7 @@ +var $ = require('../internals/export'); + +// `Number.MAX_SAFE_INTEGER` constant +// https://tc39.github.io/ecma262/#sec-number.max_safe_integer +$({ target: 'Number', stat: true }, { + MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF +}); diff --git a/core-js/modules/es.number.min-safe-integer.js b/core-js/modules/es.number.min-safe-integer.js new file mode 100644 index 0000000000..500a8f678a --- /dev/null +++ b/core-js/modules/es.number.min-safe-integer.js @@ -0,0 +1,7 @@ +var $ = require('../internals/export'); + +// `Number.MIN_SAFE_INTEGER` constant +// https://tc39.github.io/ecma262/#sec-number.min_safe_integer +$({ target: 'Number', stat: true }, { + MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF +}); diff --git a/core-js/modules/es.number.parse-float.js b/core-js/modules/es.number.parse-float.js new file mode 100644 index 0000000000..9d88958026 --- /dev/null +++ b/core-js/modules/es.number.parse-float.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var parseFloat = require('../internals/parse-float'); + +// `Number.parseFloat` method +// https://tc39.github.io/ecma262/#sec-number.parseFloat +$({ target: 'Number', stat: true, forced: Number.parseFloat != parseFloat }, { + parseFloat: parseFloat +}); diff --git a/core-js/modules/es.number.parse-int.js b/core-js/modules/es.number.parse-int.js new file mode 100644 index 0000000000..c8fcc545e3 --- /dev/null +++ b/core-js/modules/es.number.parse-int.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var parseInt = require('../internals/parse-int'); + +// `Number.parseInt` method +// https://tc39.github.io/ecma262/#sec-number.parseint +$({ target: 'Number', stat: true, forced: Number.parseInt != parseInt }, { + parseInt: parseInt +}); diff --git a/core-js/modules/es.number.to-fixed.js b/core-js/modules/es.number.to-fixed.js new file mode 100644 index 0000000000..fa4d3e279d --- /dev/null +++ b/core-js/modules/es.number.to-fixed.js @@ -0,0 +1,126 @@ +'use strict'; +var $ = require('../internals/export'); +var toInteger = require('../internals/to-integer'); +var thisNumberValue = require('../internals/this-number-value'); +var repeat = require('../internals/string-repeat'); +var fails = require('../internals/fails'); + +var nativeToFixed = 1.0.toFixed; +var floor = Math.floor; + +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; + +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +var FORCED = nativeToFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !fails(function () { + // V8 ~ Android 4.3- + nativeToFixed.call({}); +}); + +// `Number.prototype.toFixed` method +// https://tc39.github.io/ecma262/#sec-number.prototype.tofixed +$({ target: 'Number', proto: true, forced: FORCED }, { + // eslint-disable-next-line max-statements + toFixed: function toFixed(fractionDigits) { + var number = thisNumberValue(this); + var fractDigits = toInteger(fractionDigits); + var data = [0, 0, 0, 0, 0, 0]; + var sign = ''; + var result = '0'; + var e, z, j, k; + + var multiply = function (n, c) { + var index = -1; + var c2 = c; + while (++index < 6) { + c2 += n * data[index]; + data[index] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } + }; + + var divide = function (n) { + var index = 6; + var c = 0; + while (--index >= 0) { + c += data[index]; + data[index] = floor(c / n); + c = (c % n) * 1e7; + } + }; + + var dataToString = function () { + var index = 6; + var s = ''; + while (--index >= 0) { + if (s !== '' || index === 0 || data[index] !== 0) { + var t = String(data[index]); + s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t; + } + } return s; + }; + + if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits'); + // eslint-disable-next-line no-self-compare + if (number != number) return 'NaN'; + if (number <= -1e21 || number >= 1e21) return String(number); + if (number < 0) { + sign = '-'; + number = -number; + } + if (number > 1e-21) { + e = log(number * pow(2, 69, 1)) - 69; + z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = fractDigits; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + result = dataToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + result = dataToString() + repeat.call('0', fractDigits); + } + } + if (fractDigits > 0) { + k = result.length; + result = sign + (k <= fractDigits + ? '0.' + repeat.call('0', fractDigits - k) + result + : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits)); + } else { + result = sign + result; + } return result; + } +}); diff --git a/core-js/modules/es.number.to-precision.js b/core-js/modules/es.number.to-precision.js new file mode 100644 index 0000000000..710829680f --- /dev/null +++ b/core-js/modules/es.number.to-precision.js @@ -0,0 +1,24 @@ +'use strict'; +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var thisNumberValue = require('../internals/this-number-value'); + +var nativeToPrecision = 1.0.toPrecision; + +var FORCED = fails(function () { + // IE7- + return nativeToPrecision.call(1, undefined) !== '1'; +}) || !fails(function () { + // V8 ~ Android 4.3- + nativeToPrecision.call({}); +}); + +// `Number.prototype.toPrecision` method +// https://tc39.github.io/ecma262/#sec-number.prototype.toprecision +$({ target: 'Number', proto: true, forced: FORCED }, { + toPrecision: function toPrecision(precision) { + return precision === undefined + ? nativeToPrecision.call(thisNumberValue(this)) + : nativeToPrecision.call(thisNumberValue(this), precision); + } +}); diff --git a/core-js/modules/es.object.assign.js b/core-js/modules/es.object.assign.js new file mode 100644 index 0000000000..5b00e6ae94 --- /dev/null +++ b/core-js/modules/es.object.assign.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var assign = require('../internals/object-assign'); + +// `Object.assign` method +// https://tc39.github.io/ecma262/#sec-object.assign +$({ target: 'Object', stat: true, forced: Object.assign !== assign }, { + assign: assign +}); diff --git a/core-js/modules/es.object.create.js b/core-js/modules/es.object.create.js new file mode 100644 index 0000000000..3c278691f9 --- /dev/null +++ b/core-js/modules/es.object.create.js @@ -0,0 +1,9 @@ +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var create = require('../internals/object-create'); + +// `Object.create` method +// https://tc39.github.io/ecma262/#sec-object.create +$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { + create: create +}); diff --git a/core-js/modules/es.object.define-getter.js b/core-js/modules/es.object.define-getter.js new file mode 100644 index 0000000000..6cf5974998 --- /dev/null +++ b/core-js/modules/es.object.define-getter.js @@ -0,0 +1,17 @@ +'use strict'; +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var FORCED = require('../internals/forced-object-prototype-accessors-methods'); +var toObject = require('../internals/to-object'); +var aFunction = require('../internals/a-function'); +var definePropertyModule = require('../internals/object-define-property'); + +// `Object.prototype.__defineGetter__` method +// https://tc39.github.io/ecma262/#sec-object.prototype.__defineGetter__ +if (DESCRIPTORS) { + $({ target: 'Object', proto: true, forced: FORCED }, { + __defineGetter__: function __defineGetter__(P, getter) { + definePropertyModule.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } + }); +} diff --git a/core-js/modules/es.object.define-properties.js b/core-js/modules/es.object.define-properties.js new file mode 100644 index 0000000000..9400799feb --- /dev/null +++ b/core-js/modules/es.object.define-properties.js @@ -0,0 +1,9 @@ +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var defineProperties = require('../internals/object-define-properties'); + +// `Object.defineProperties` method +// https://tc39.github.io/ecma262/#sec-object.defineproperties +$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, { + defineProperties: defineProperties +}); diff --git a/core-js/modules/es.object.define-property.js b/core-js/modules/es.object.define-property.js new file mode 100644 index 0000000000..19fcf5b379 --- /dev/null +++ b/core-js/modules/es.object.define-property.js @@ -0,0 +1,9 @@ +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var objectDefinePropertyModile = require('../internals/object-define-property'); + +// `Object.defineProperty` method +// https://tc39.github.io/ecma262/#sec-object.defineproperty +$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, { + defineProperty: objectDefinePropertyModile.f +}); diff --git a/core-js/modules/es.object.define-setter.js b/core-js/modules/es.object.define-setter.js new file mode 100644 index 0000000000..c0860d5895 --- /dev/null +++ b/core-js/modules/es.object.define-setter.js @@ -0,0 +1,17 @@ +'use strict'; +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var FORCED = require('../internals/forced-object-prototype-accessors-methods'); +var toObject = require('../internals/to-object'); +var aFunction = require('../internals/a-function'); +var definePropertyModule = require('../internals/object-define-property'); + +// `Object.prototype.__defineSetter__` method +// https://tc39.github.io/ecma262/#sec-object.prototype.__defineSetter__ +if (DESCRIPTORS) { + $({ target: 'Object', proto: true, forced: FORCED }, { + __defineSetter__: function __defineSetter__(P, setter) { + definePropertyModule.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } + }); +} diff --git a/core-js/modules/es.object.entries.js b/core-js/modules/es.object.entries.js new file mode 100644 index 0000000000..a22e693bb7 --- /dev/null +++ b/core-js/modules/es.object.entries.js @@ -0,0 +1,10 @@ +var $ = require('../internals/export'); +var $entries = require('../internals/object-to-array').entries; + +// `Object.entries` method +// https://tc39.github.io/ecma262/#sec-object.entries +$({ target: 'Object', stat: true }, { + entries: function entries(O) { + return $entries(O); + } +}); diff --git a/core-js/modules/es.object.freeze.js b/core-js/modules/es.object.freeze.js new file mode 100644 index 0000000000..0a623bdc69 --- /dev/null +++ b/core-js/modules/es.object.freeze.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var FREEZING = require('../internals/freezing'); +var fails = require('../internals/fails'); +var isObject = require('../internals/is-object'); +var onFreeze = require('../internals/internal-metadata').onFreeze; + +var nativeFreeze = Object.freeze; +var FAILS_ON_PRIMITIVES = fails(function () { nativeFreeze(1); }); + +// `Object.freeze` method +// https://tc39.github.io/ecma262/#sec-object.freeze +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, { + freeze: function freeze(it) { + return nativeFreeze && isObject(it) ? nativeFreeze(onFreeze(it)) : it; + } +}); diff --git a/core-js/modules/es.object.from-entries.js b/core-js/modules/es.object.from-entries.js new file mode 100644 index 0000000000..2886e81f87 --- /dev/null +++ b/core-js/modules/es.object.from-entries.js @@ -0,0 +1,15 @@ +var $ = require('../internals/export'); +var iterate = require('../internals/iterate'); +var createProperty = require('../internals/create-property'); + +// `Object.fromEntries` method +// https://github.com/tc39/proposal-object-from-entries +$({ target: 'Object', stat: true }, { + fromEntries: function fromEntries(iterable) { + var obj = {}; + iterate(iterable, function (k, v) { + createProperty(obj, k, v); + }, undefined, true); + return obj; + } +}); diff --git a/core-js/modules/es.object.get-own-property-descriptor.js b/core-js/modules/es.object.get-own-property-descriptor.js new file mode 100644 index 0000000000..bfeeb888a3 --- /dev/null +++ b/core-js/modules/es.object.get-own-property-descriptor.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var toIndexedObject = require('../internals/to-indexed-object'); +var nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var DESCRIPTORS = require('../internals/descriptors'); + +var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); }); +var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor +$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { + return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); + } +}); diff --git a/core-js/modules/es.object.get-own-property-descriptors.js b/core-js/modules/es.object.get-own-property-descriptors.js new file mode 100644 index 0000000000..e29c917b03 --- /dev/null +++ b/core-js/modules/es.object.get-own-property-descriptors.js @@ -0,0 +1,24 @@ +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var ownKeys = require('../internals/own-keys'); +var toIndexedObject = require('../internals/to-indexed-object'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var createProperty = require('../internals/create-property'); + +// `Object.getOwnPropertyDescriptors` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors +$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIndexedObject(object); + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + var keys = ownKeys(O); + var result = {}; + var index = 0; + var key, descriptor; + while (keys.length > index) { + descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); + if (descriptor !== undefined) createProperty(result, key, descriptor); + } + return result; + } +}); diff --git a/core-js/modules/es.object.get-own-property-names.js b/core-js/modules/es.object.get-own-property-names.js new file mode 100644 index 0000000000..6a52f45915 --- /dev/null +++ b/core-js/modules/es.object.get-own-property-names.js @@ -0,0 +1,11 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names-external').f; + +var FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); }); + +// `Object.getOwnPropertyNames` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertynames +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + getOwnPropertyNames: nativeGetOwnPropertyNames +}); diff --git a/core-js/modules/es.object.get-prototype-of.js b/core-js/modules/es.object.get-prototype-of.js new file mode 100644 index 0000000000..7cbb548e6d --- /dev/null +++ b/core-js/modules/es.object.get-prototype-of.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var toObject = require('../internals/to-object'); +var nativeGetPrototypeOf = require('../internals/object-get-prototype-of'); +var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); + +var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); }); + +// `Object.getPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.getprototypeof +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, { + getPrototypeOf: function getPrototypeOf(it) { + return nativeGetPrototypeOf(toObject(it)); + } +}); + diff --git a/core-js/modules/es.object.is-extensible.js b/core-js/modules/es.object.is-extensible.js new file mode 100644 index 0000000000..556405b18b --- /dev/null +++ b/core-js/modules/es.object.is-extensible.js @@ -0,0 +1,14 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var isObject = require('../internals/is-object'); + +var nativeIsExtensible = Object.isExtensible; +var FAILS_ON_PRIMITIVES = fails(function () { nativeIsExtensible(1); }); + +// `Object.isExtensible` method +// https://tc39.github.io/ecma262/#sec-object.isextensible +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + isExtensible: function isExtensible(it) { + return isObject(it) ? nativeIsExtensible ? nativeIsExtensible(it) : true : false; + } +}); diff --git a/core-js/modules/es.object.is-frozen.js b/core-js/modules/es.object.is-frozen.js new file mode 100644 index 0000000000..060314de3e --- /dev/null +++ b/core-js/modules/es.object.is-frozen.js @@ -0,0 +1,14 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var isObject = require('../internals/is-object'); + +var nativeIsFrozen = Object.isFrozen; +var FAILS_ON_PRIMITIVES = fails(function () { nativeIsFrozen(1); }); + +// `Object.isFrozen` method +// https://tc39.github.io/ecma262/#sec-object.isfrozen +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + isFrozen: function isFrozen(it) { + return isObject(it) ? nativeIsFrozen ? nativeIsFrozen(it) : false : true; + } +}); diff --git a/core-js/modules/es.object.is-sealed.js b/core-js/modules/es.object.is-sealed.js new file mode 100644 index 0000000000..0f8b95f410 --- /dev/null +++ b/core-js/modules/es.object.is-sealed.js @@ -0,0 +1,14 @@ +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var isObject = require('../internals/is-object'); + +var nativeIsSealed = Object.isSealed; +var FAILS_ON_PRIMITIVES = fails(function () { nativeIsSealed(1); }); + +// `Object.isSealed` method +// https://tc39.github.io/ecma262/#sec-object.issealed +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + isSealed: function isSealed(it) { + return isObject(it) ? nativeIsSealed ? nativeIsSealed(it) : false : true; + } +}); diff --git a/core-js/modules/es.object.is.js b/core-js/modules/es.object.is.js new file mode 100644 index 0000000000..9ef6f0af61 --- /dev/null +++ b/core-js/modules/es.object.is.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var is = require('../internals/same-value'); + +// `Object.is` method +// https://tc39.github.io/ecma262/#sec-object.is +$({ target: 'Object', stat: true }, { + is: is +}); diff --git a/core-js/modules/es.object.keys.js b/core-js/modules/es.object.keys.js new file mode 100644 index 0000000000..dc2488402d --- /dev/null +++ b/core-js/modules/es.object.keys.js @@ -0,0 +1,14 @@ +var $ = require('../internals/export'); +var toObject = require('../internals/to-object'); +var nativeKeys = require('../internals/object-keys'); +var fails = require('../internals/fails'); + +var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); + +// `Object.keys` method +// https://tc39.github.io/ecma262/#sec-object.keys +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + keys: function keys(it) { + return nativeKeys(toObject(it)); + } +}); diff --git a/core-js/modules/es.object.lookup-getter.js b/core-js/modules/es.object.lookup-getter.js new file mode 100644 index 0000000000..58743ac3c5 --- /dev/null +++ b/core-js/modules/es.object.lookup-getter.js @@ -0,0 +1,23 @@ +'use strict'; +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var FORCED = require('../internals/forced-object-prototype-accessors-methods'); +var toObject = require('../internals/to-object'); +var toPrimitive = require('../internals/to-primitive'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; + +// `Object.prototype.__lookupGetter__` method +// https://tc39.github.io/ecma262/#sec-object.prototype.__lookupGetter__ +if (DESCRIPTORS) { + $({ target: 'Object', proto: true, forced: FORCED }, { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var key = toPrimitive(P, true); + var desc; + do { + if (desc = getOwnPropertyDescriptor(O, key)) return desc.get; + } while (O = getPrototypeOf(O)); + } + }); +} diff --git a/core-js/modules/es.object.lookup-setter.js b/core-js/modules/es.object.lookup-setter.js new file mode 100644 index 0000000000..e469c45c1d --- /dev/null +++ b/core-js/modules/es.object.lookup-setter.js @@ -0,0 +1,23 @@ +'use strict'; +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var FORCED = require('../internals/forced-object-prototype-accessors-methods'); +var toObject = require('../internals/to-object'); +var toPrimitive = require('../internals/to-primitive'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; + +// `Object.prototype.__lookupSetter__` method +// https://tc39.github.io/ecma262/#sec-object.prototype.__lookupSetter__ +if (DESCRIPTORS) { + $({ target: 'Object', proto: true, forced: FORCED }, { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var key = toPrimitive(P, true); + var desc; + do { + if (desc = getOwnPropertyDescriptor(O, key)) return desc.set; + } while (O = getPrototypeOf(O)); + } + }); +} diff --git a/core-js/modules/es.object.prevent-extensions.js b/core-js/modules/es.object.prevent-extensions.js new file mode 100644 index 0000000000..bb7b268605 --- /dev/null +++ b/core-js/modules/es.object.prevent-extensions.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var isObject = require('../internals/is-object'); +var onFreeze = require('../internals/internal-metadata').onFreeze; +var FREEZING = require('../internals/freezing'); +var fails = require('../internals/fails'); + +var nativePreventExtensions = Object.preventExtensions; +var FAILS_ON_PRIMITIVES = fails(function () { nativePreventExtensions(1); }); + +// `Object.preventExtensions` method +// https://tc39.github.io/ecma262/#sec-object.preventextensions +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, { + preventExtensions: function preventExtensions(it) { + return nativePreventExtensions && isObject(it) ? nativePreventExtensions(onFreeze(it)) : it; + } +}); diff --git a/core-js/modules/es.object.seal.js b/core-js/modules/es.object.seal.js new file mode 100644 index 0000000000..35fae0c5b4 --- /dev/null +++ b/core-js/modules/es.object.seal.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var isObject = require('../internals/is-object'); +var onFreeze = require('../internals/internal-metadata').onFreeze; +var FREEZING = require('../internals/freezing'); +var fails = require('../internals/fails'); + +var nativeSeal = Object.seal; +var FAILS_ON_PRIMITIVES = fails(function () { nativeSeal(1); }); + +// `Object.seal` method +// https://tc39.github.io/ecma262/#sec-object.seal +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, { + seal: function seal(it) { + return nativeSeal && isObject(it) ? nativeSeal(onFreeze(it)) : it; + } +}); diff --git a/core-js/modules/es.object.set-prototype-of.js b/core-js/modules/es.object.set-prototype-of.js new file mode 100644 index 0000000000..cbe0578d7b --- /dev/null +++ b/core-js/modules/es.object.set-prototype-of.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); + +// `Object.setPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.setprototypeof +$({ target: 'Object', stat: true }, { + setPrototypeOf: setPrototypeOf +}); diff --git a/core-js/modules/es.object.to-string.js b/core-js/modules/es.object.to-string.js new file mode 100644 index 0000000000..0799517932 --- /dev/null +++ b/core-js/modules/es.object.to-string.js @@ -0,0 +1,10 @@ +var redefine = require('../internals/redefine'); +var toString = require('../internals/object-to-string'); + +var ObjectPrototype = Object.prototype; + +// `Object.prototype.toString` method +// https://tc39.github.io/ecma262/#sec-object.prototype.tostring +if (toString !== ObjectPrototype.toString) { + redefine(ObjectPrototype, 'toString', toString, { unsafe: true }); +} diff --git a/core-js/modules/es.object.values.js b/core-js/modules/es.object.values.js new file mode 100644 index 0000000000..a3074cf77d --- /dev/null +++ b/core-js/modules/es.object.values.js @@ -0,0 +1,10 @@ +var $ = require('../internals/export'); +var $values = require('../internals/object-to-array').values; + +// `Object.values` method +// https://tc39.github.io/ecma262/#sec-object.values +$({ target: 'Object', stat: true }, { + values: function values(O) { + return $values(O); + } +}); diff --git a/core-js/modules/es.parse-float.js b/core-js/modules/es.parse-float.js new file mode 100644 index 0000000000..48194b01f1 --- /dev/null +++ b/core-js/modules/es.parse-float.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var parseFloatImplementation = require('../internals/parse-float'); + +// `parseFloat` method +// https://tc39.github.io/ecma262/#sec-parsefloat-string +$({ global: true, forced: parseFloat != parseFloatImplementation }, { + parseFloat: parseFloatImplementation +}); diff --git a/core-js/modules/es.parse-int.js b/core-js/modules/es.parse-int.js new file mode 100644 index 0000000000..9e8051b403 --- /dev/null +++ b/core-js/modules/es.parse-int.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var parseIntImplementation = require('../internals/parse-int'); + +// `parseInt` method +// https://tc39.github.io/ecma262/#sec-parseint-string-radix +$({ global: true, forced: parseInt != parseIntImplementation }, { + parseInt: parseIntImplementation +}); diff --git a/core-js/modules/es.promise.all-settled.js b/core-js/modules/es.promise.all-settled.js new file mode 100644 index 0000000000..887f3a651f --- /dev/null +++ b/core-js/modules/es.promise.all-settled.js @@ -0,0 +1,43 @@ +'use strict'; +var $ = require('../internals/export'); +var aFunction = require('../internals/a-function'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); +var iterate = require('../internals/iterate'); + +// `Promise.allSettled` method +// https://github.com/tc39/proposal-promise-allSettled +$({ target: 'Promise', stat: true }, { + allSettled: function allSettled(iterable) { + var C = this; + var capability = newPromiseCapabilityModule.f(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var promiseResolve = aFunction(C.resolve); + var values = []; + var counter = 0; + var remaining = 1; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + promiseResolve.call(C, promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = { status: 'fulfilled', value: value }; + --remaining || resolve(values); + }, function (e) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = { status: 'rejected', reason: e }; + --remaining || resolve(values); + }); + }); + --remaining || resolve(values); + }); + if (result.error) reject(result.value); + return capability.promise; + } +}); diff --git a/core-js/modules/es.promise.finally.js b/core-js/modules/es.promise.finally.js new file mode 100644 index 0000000000..6c1ec7940a --- /dev/null +++ b/core-js/modules/es.promise.finally.js @@ -0,0 +1,30 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var NativePromise = require('../internals/native-promise-constructor'); +var getBuiltIn = require('../internals/get-built-in'); +var speciesConstructor = require('../internals/species-constructor'); +var promiseResolve = require('../internals/promise-resolve'); +var redefine = require('../internals/redefine'); + +// `Promise.prototype.finally` method +// https://tc39.github.io/ecma262/#sec-promise.prototype.finally +$({ target: 'Promise', proto: true, real: true }, { + 'finally': function (onFinally) { + var C = speciesConstructor(this, getBuiltIn('Promise')); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); + } +}); + +// patch native Promise.prototype for native async functions +if (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) { + redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']); +} diff --git a/core-js/modules/es.promise.js b/core-js/modules/es.promise.js new file mode 100644 index 0000000000..b0d76c63aa --- /dev/null +++ b/core-js/modules/es.promise.js @@ -0,0 +1,371 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var global = require('../internals/global'); +var path = require('../internals/path'); +var NativePromise = require('../internals/native-promise-constructor'); +var redefine = require('../internals/redefine'); +var redefineAll = require('../internals/redefine-all'); +var setToStringTag = require('../internals/set-to-string-tag'); +var setSpecies = require('../internals/set-species'); +var isObject = require('../internals/is-object'); +var aFunction = require('../internals/a-function'); +var anInstance = require('../internals/an-instance'); +var classof = require('../internals/classof-raw'); +var iterate = require('../internals/iterate'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var speciesConstructor = require('../internals/species-constructor'); +var task = require('../internals/task').set; +var microtask = require('../internals/microtask'); +var promiseResolve = require('../internals/promise-resolve'); +var hostReportErrors = require('../internals/host-report-errors'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); +var userAgent = require('../internals/user-agent'); +var InternalStateModule = require('../internals/internal-state'); +var isForced = require('../internals/is-forced'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); +var PROMISE = 'Promise'; +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; +var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); +var PromiseConstructor = NativePromise; +var TypeError = global.TypeError; +var document = global.document; +var process = global.process; +var $fetch = global.fetch; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var newPromiseCapability = newPromiseCapabilityModule.f; +var newGenericPromiseCapability = newPromiseCapability; +var IS_NODE = classof(process) == 'process'; +var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); +var UNHANDLED_REJECTION = 'unhandledrejection'; +var REJECTION_HANDLED = 'rejectionhandled'; +var PENDING = 0; +var FULFILLED = 1; +var REJECTED = 2; +var HANDLED = 1; +var UNHANDLED = 2; +var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; + +var FORCED = isForced(PROMISE, function () { + // correct subclassing with @@species support + var promise = PromiseConstructor.resolve(1); + var empty = function () { /* empty */ }; + var FakePromise = (promise.constructor = {})[SPECIES] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return !((IS_NODE || typeof PromiseRejectionEvent == 'function') + && (!IS_PURE || promise['finally']) + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1); +}); + +var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) { + PromiseConstructor.all(iterable)['catch'](function () { /* empty */ }); +}); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; + +var notify = function (promise, state, isReject) { + if (state.notified) return; + state.notified = true; + var chain = state.reactions; + microtask(function () { + var value = state.value; + var ok = state.state == FULFILLED; + var index = 0; + // variable length - can't use forEach + while (chain.length > index) { + var reaction = chain[index++]; + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state); + state.rejection = HANDLED; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // can throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (error) { + if (domain && !exited) domain.exit(); + reject(error); + } + } + state.reactions = []; + state.notified = false; + if (isReject && !state.rejection) onUnhandled(promise, state); + }); +}; + +var dispatchEvent = function (name, promise, reason) { + var event, handler; + if (DISPATCH_EVENT) { + event = document.createEvent('Event'); + event.promise = promise; + event.reason = reason; + event.initEvent(name, false, true); + global.dispatchEvent(event); + } else event = { promise: promise, reason: reason }; + if (handler = global['on' + name]) handler(event); + else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); +}; + +var onUnhandled = function (promise, state) { + task.call(global, function () { + var value = state.value; + var IS_UNHANDLED = isUnhandled(state); + var result; + if (IS_UNHANDLED) { + result = perform(function () { + if (IS_NODE) { + process.emit('unhandledRejection', value, promise); + } else dispatchEvent(UNHANDLED_REJECTION, promise, value); + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; + if (result.error) throw result.value; + } + }); +}; + +var isUnhandled = function (state) { + return state.rejection !== HANDLED && !state.parent; +}; + +var onHandleUnhandled = function (promise, state) { + task.call(global, function () { + if (IS_NODE) { + process.emit('rejectionHandled', promise); + } else dispatchEvent(REJECTION_HANDLED, promise, state.value); + }); +}; + +var bind = function (fn, promise, state, unwrap) { + return function (value) { + fn(promise, state, value, unwrap); + }; +}; + +var internalReject = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + state.value = value; + state.state = REJECTED; + notify(promise, state, true); +}; + +var internalResolve = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + var then = isThenable(value); + if (then) { + microtask(function () { + var wrapper = { done: false }; + try { + then.call(value, + bind(internalResolve, promise, wrapper, state), + bind(internalReject, promise, wrapper, state) + ); + } catch (error) { + internalReject(promise, wrapper, error, state); + } + }); + } else { + state.value = value; + state.state = FULFILLED; + notify(promise, state, false); + } + } catch (error) { + internalReject(promise, { done: false }, error, state); + } +}; + +// constructor polyfill +if (FORCED) { + // 25.4.3.1 Promise(executor) + PromiseConstructor = function Promise(executor) { + anInstance(this, PromiseConstructor, PROMISE); + aFunction(executor); + Internal.call(this); + var state = getInternalState(this); + try { + executor(bind(internalResolve, this, state), bind(internalReject, this, state)); + } catch (error) { + internalReject(this, state, error); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + setInternalState(this, { + type: PROMISE, + done: false, + notified: false, + parent: false, + reactions: [], + rejection: false, + state: PENDING, + value: undefined + }); + }; + Internal.prototype = redefineAll(PromiseConstructor.prototype, { + // `Promise.prototype.then` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.then + then: function then(onFulfilled, onRejected) { + var state = getInternalPromiseState(this); + var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = IS_NODE ? process.domain : undefined; + state.parent = true; + state.reactions.push(reaction); + if (state.state != PENDING) notify(this, state, false); + return reaction.promise; + }, + // `Promise.prototype.catch` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.catch + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + var state = getInternalState(promise); + this.promise = promise; + this.resolve = bind(internalResolve, promise, state); + this.reject = bind(internalReject, promise, state); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === PromiseConstructor || C === PromiseWrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; + + if (!IS_PURE && typeof NativePromise == 'function') { + nativeThen = NativePromise.prototype.then; + + // wrap native Promise#then for native async functions + redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) { + var that = this; + return new PromiseConstructor(function (resolve, reject) { + nativeThen.call(that, resolve, reject); + }).then(onFulfilled, onRejected); + }); + + // wrap fetch result + if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, { + // eslint-disable-next-line no-unused-vars + fetch: function fetch(input) { + return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments)); + } + }); + } +} + +$({ global: true, wrap: true, forced: FORCED }, { + Promise: PromiseConstructor +}); + +setToStringTag(PromiseConstructor, PROMISE, false, true); +setSpecies(PROMISE); + +PromiseWrapper = path[PROMISE]; + +// statics +$({ target: PROMISE, stat: true, forced: FORCED }, { + // `Promise.reject` method + // https://tc39.github.io/ecma262/#sec-promise.reject + reject: function reject(r) { + var capability = newPromiseCapability(this); + capability.reject.call(undefined, r); + return capability.promise; + } +}); + +$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, { + // `Promise.resolve` method + // https://tc39.github.io/ecma262/#sec-promise.resolve + resolve: function resolve(x) { + return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x); + } +}); + +$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, { + // `Promise.all` method + // https://tc39.github.io/ecma262/#sec-promise.all + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + var values = []; + var counter = 0; + var remaining = 1; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + $promiseResolve.call(C, promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.error) reject(result.value); + return capability.promise; + }, + // `Promise.race` method + // https://tc39.github.io/ecma262/#sec-promise.race + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + iterate(iterable, function (promise) { + $promiseResolve.call(C, promise).then(capability.resolve, reject); + }); + }); + if (result.error) reject(result.value); + return capability.promise; + } +}); diff --git a/core-js/modules/es.reflect.apply.js b/core-js/modules/es.reflect.apply.js new file mode 100644 index 0000000000..634222bb76 --- /dev/null +++ b/core-js/modules/es.reflect.apply.js @@ -0,0 +1,25 @@ +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var aFunction = require('../internals/a-function'); +var anObject = require('../internals/an-object'); +var fails = require('../internals/fails'); + +var nativeApply = getBuiltIn('Reflect', 'apply'); +var functionApply = Function.apply; + +// MS Edge argumentsList argument is optional +var OPTIONAL_ARGUMENTS_LIST = !fails(function () { + nativeApply(function () { /* empty */ }); +}); + +// `Reflect.apply` method +// https://tc39.github.io/ecma262/#sec-reflect.apply +$({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, { + apply: function apply(target, thisArgument, argumentsList) { + aFunction(target); + anObject(argumentsList); + return nativeApply + ? nativeApply(target, thisArgument, argumentsList) + : functionApply.call(target, thisArgument, argumentsList); + } +}); diff --git a/core-js/modules/es.reflect.construct.js b/core-js/modules/es.reflect.construct.js new file mode 100644 index 0000000000..9e678ddb08 --- /dev/null +++ b/core-js/modules/es.reflect.construct.js @@ -0,0 +1,51 @@ +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var aFunction = require('../internals/a-function'); +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var create = require('../internals/object-create'); +var bind = require('../internals/function-bind'); +var fails = require('../internals/fails'); + +var nativeConstruct = getBuiltIn('Reflect', 'construct'); + +// `Reflect.construct` method +// https://tc39.github.io/ecma262/#sec-reflect.construct +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + nativeConstruct(function () { /* empty */ }); +}); +var FORCED = NEW_TARGET_BUG || ARGS_BUG; + +$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); diff --git a/core-js/modules/es.reflect.define-property.js b/core-js/modules/es.reflect.define-property.js new file mode 100644 index 0000000000..44343f799d --- /dev/null +++ b/core-js/modules/es.reflect.define-property.js @@ -0,0 +1,28 @@ +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var anObject = require('../internals/an-object'); +var toPrimitive = require('../internals/to-primitive'); +var definePropertyModule = require('../internals/object-define-property'); +var fails = require('../internals/fails'); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +var ERROR_INSTEAD_OF_FALSE = fails(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 }); +}); + +// `Reflect.defineProperty` method +// https://tc39.github.io/ecma262/#sec-reflect.defineproperty +$({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS }, { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + var key = toPrimitive(propertyKey, true); + anObject(attributes); + try { + definePropertyModule.f(target, key, attributes); + return true; + } catch (error) { + return false; + } + } +}); diff --git a/core-js/modules/es.reflect.delete-property.js b/core-js/modules/es.reflect.delete-property.js new file mode 100644 index 0000000000..8cfb32d138 --- /dev/null +++ b/core-js/modules/es.reflect.delete-property.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); +var anObject = require('../internals/an-object'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; + +// `Reflect.deleteProperty` method +// https://tc39.github.io/ecma262/#sec-reflect.deleteproperty +$({ target: 'Reflect', stat: true }, { + deleteProperty: function deleteProperty(target, propertyKey) { + var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey); + return descriptor && !descriptor.configurable ? false : delete target[propertyKey]; + } +}); diff --git a/core-js/modules/es.reflect.get-own-property-descriptor.js b/core-js/modules/es.reflect.get-own-property-descriptor.js new file mode 100644 index 0000000000..335aac4221 --- /dev/null +++ b/core-js/modules/es.reflect.get-own-property-descriptor.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var anObject = require('../internals/an-object'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); + +// `Reflect.getOwnPropertyDescriptor` method +// https://tc39.github.io/ecma262/#sec-reflect.getownpropertydescriptor +$({ target: 'Reflect', stat: true, sham: !DESCRIPTORS }, { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return getOwnPropertyDescriptorModule.f(anObject(target), propertyKey); + } +}); diff --git a/core-js/modules/es.reflect.get-prototype-of.js b/core-js/modules/es.reflect.get-prototype-of.js new file mode 100644 index 0000000000..97859492bc --- /dev/null +++ b/core-js/modules/es.reflect.get-prototype-of.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); +var anObject = require('../internals/an-object'); +var objectGetPrototypeOf = require('../internals/object-get-prototype-of'); +var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); + +// `Reflect.getPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-reflect.getprototypeof +$({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, { + getPrototypeOf: function getPrototypeOf(target) { + return objectGetPrototypeOf(anObject(target)); + } +}); diff --git a/core-js/modules/es.reflect.get.js b/core-js/modules/es.reflect.get.js new file mode 100644 index 0000000000..10e79628fc --- /dev/null +++ b/core-js/modules/es.reflect.get.js @@ -0,0 +1,24 @@ +var $ = require('../internals/export'); +var isObject = require('../internals/is-object'); +var anObject = require('../internals/an-object'); +var has = require('../internals/has'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); + +// `Reflect.get` method +// https://tc39.github.io/ecma262/#sec-reflect.get +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var descriptor, prototype; + if (anObject(target) === receiver) return target[propertyKey]; + if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value') + ? descriptor.value + : descriptor.get === undefined + ? undefined + : descriptor.get.call(receiver); + if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver); +} + +$({ target: 'Reflect', stat: true }, { + get: get +}); diff --git a/core-js/modules/es.reflect.has.js b/core-js/modules/es.reflect.has.js new file mode 100644 index 0000000000..c6a8ced4da --- /dev/null +++ b/core-js/modules/es.reflect.has.js @@ -0,0 +1,9 @@ +var $ = require('../internals/export'); + +// `Reflect.has` method +// https://tc39.github.io/ecma262/#sec-reflect.has +$({ target: 'Reflect', stat: true }, { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); diff --git a/core-js/modules/es.reflect.is-extensible.js b/core-js/modules/es.reflect.is-extensible.js new file mode 100644 index 0000000000..876eae3642 --- /dev/null +++ b/core-js/modules/es.reflect.is-extensible.js @@ -0,0 +1,13 @@ +var $ = require('../internals/export'); +var anObject = require('../internals/an-object'); + +var objectIsExtensible = Object.isExtensible; + +// `Reflect.isExtensible` method +// https://tc39.github.io/ecma262/#sec-reflect.isextensible +$({ target: 'Reflect', stat: true }, { + isExtensible: function isExtensible(target) { + anObject(target); + return objectIsExtensible ? objectIsExtensible(target) : true; + } +}); diff --git a/core-js/modules/es.reflect.own-keys.js b/core-js/modules/es.reflect.own-keys.js new file mode 100644 index 0000000000..7a8f3f0e7d --- /dev/null +++ b/core-js/modules/es.reflect.own-keys.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var ownKeys = require('../internals/own-keys'); + +// `Reflect.ownKeys` method +// https://tc39.github.io/ecma262/#sec-reflect.ownkeys +$({ target: 'Reflect', stat: true }, { + ownKeys: ownKeys +}); diff --git a/core-js/modules/es.reflect.prevent-extensions.js b/core-js/modules/es.reflect.prevent-extensions.js new file mode 100644 index 0000000000..92d04753cf --- /dev/null +++ b/core-js/modules/es.reflect.prevent-extensions.js @@ -0,0 +1,19 @@ +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var FREEZING = require('../internals/freezing'); + +// `Reflect.preventExtensions` method +// https://tc39.github.io/ecma262/#sec-reflect.preventextensions +$({ target: 'Reflect', stat: true, sham: !FREEZING }, { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions'); + if (objectPreventExtensions) objectPreventExtensions(target); + return true; + } catch (error) { + return false; + } + } +}); diff --git a/core-js/modules/es.reflect.set-prototype-of.js b/core-js/modules/es.reflect.set-prototype-of.js new file mode 100644 index 0000000000..7900440cf0 --- /dev/null +++ b/core-js/modules/es.reflect.set-prototype-of.js @@ -0,0 +1,19 @@ +var $ = require('../internals/export'); +var anObject = require('../internals/an-object'); +var aPossiblePrototype = require('../internals/a-possible-prototype'); +var objectSetPrototypeOf = require('../internals/object-set-prototype-of'); + +// `Reflect.setPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-reflect.setprototypeof +if (objectSetPrototypeOf) $({ target: 'Reflect', stat: true }, { + setPrototypeOf: function setPrototypeOf(target, proto) { + anObject(target); + aPossiblePrototype(proto); + try { + objectSetPrototypeOf(target, proto); + return true; + } catch (error) { + return false; + } + } +}); diff --git a/core-js/modules/es.reflect.set.js b/core-js/modules/es.reflect.set.js new file mode 100644 index 0000000000..29006fd757 --- /dev/null +++ b/core-js/modules/es.reflect.set.js @@ -0,0 +1,36 @@ +var $ = require('../internals/export'); +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var has = require('../internals/has'); +var definePropertyModule = require('../internals/object-define-property'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); + +// `Reflect.set` method +// https://tc39.github.io/ecma262/#sec-reflect.set +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey); + var existingDescriptor, prototype; + if (!ownDescriptor) { + if (isObject(prototype = getPrototypeOf(target))) { + return set(prototype, propertyKey, V, receiver); + } + ownDescriptor = createPropertyDescriptor(0); + } + if (has(ownDescriptor, 'value')) { + if (ownDescriptor.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + definePropertyModule.f(receiver, propertyKey, existingDescriptor); + } else definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V)); + return true; + } + return ownDescriptor.set === undefined ? false : (ownDescriptor.set.call(receiver, V), true); +} + +$({ target: 'Reflect', stat: true }, { + set: set +}); diff --git a/core-js/modules/es.regexp.constructor.js b/core-js/modules/es.regexp.constructor.js new file mode 100644 index 0000000000..05a3370f29 --- /dev/null +++ b/core-js/modules/es.regexp.constructor.js @@ -0,0 +1,60 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var isForced = require('../internals/is-forced'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var defineProperty = require('../internals/object-define-property').f; +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var isRegExp = require('../internals/is-regexp'); +var getFlags = require('../internals/regexp-flags'); +var redefine = require('../internals/redefine'); +var fails = require('../internals/fails'); +var setSpecies = require('../internals/set-species'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var MATCH = wellKnownSymbol('match'); +var NativeRegExp = global.RegExp; +var RegExpPrototype = NativeRegExp.prototype; +var re1 = /a/g; +var re2 = /a/g; + +// "new" should create a new object, old webkit bug +var CORRECT_NEW = new NativeRegExp(re1) !== re1; + +var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || fails(function () { + re2[MATCH] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; +}))); + +// `RegExp` constructor +// https://tc39.github.io/ecma262/#sec-regexp-constructor +if (FORCED) { + var RegExpWrapper = function RegExp(pattern, flags) { + var thisIsRegExp = this instanceof RegExpWrapper; + var patternIsRegExp = isRegExp(pattern); + var flagsAreUndefined = flags === undefined; + return !thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined ? pattern + : inheritIfRequired(CORRECT_NEW + ? new NativeRegExp(patternIsRegExp && !flagsAreUndefined ? pattern.source : pattern, flags) + : NativeRegExp((patternIsRegExp = pattern instanceof RegExpWrapper) + ? pattern.source + : pattern, patternIsRegExp && flagsAreUndefined ? getFlags.call(pattern) : flags) + , thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); + }; + var proxy = function (key) { + key in RegExpWrapper || defineProperty(RegExpWrapper, key, { + configurable: true, + get: function () { return NativeRegExp[key]; }, + set: function (it) { NativeRegExp[key] = it; } + }); + }; + var keys = getOwnPropertyNames(NativeRegExp); + var index = 0; + while (keys.length > index) proxy(keys[index++]); + RegExpPrototype.constructor = RegExpWrapper; + RegExpWrapper.prototype = RegExpPrototype; + redefine(global, 'RegExp', RegExpWrapper); +} + +// https://tc39.github.io/ecma262/#sec-get-regexp-@@species +setSpecies('RegExp'); diff --git a/core-js/modules/es.regexp.exec.js b/core-js/modules/es.regexp.exec.js new file mode 100644 index 0000000000..d47a89d69f --- /dev/null +++ b/core-js/modules/es.regexp.exec.js @@ -0,0 +1,7 @@ +'use strict'; +var $ = require('../internals/export'); +var exec = require('../internals/regexp-exec'); + +$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { + exec: exec +}); diff --git a/core-js/modules/es.regexp.flags.js b/core-js/modules/es.regexp.flags.js new file mode 100644 index 0000000000..693b22a8b9 --- /dev/null +++ b/core-js/modules/es.regexp.flags.js @@ -0,0 +1,12 @@ +var DESCRIPTORS = require('../internals/descriptors'); +var objectDefinePropertyModule = require('../internals/object-define-property'); +var regExpFlags = require('../internals/regexp-flags'); + +// `RegExp.prototype.flags` getter +// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags +if (DESCRIPTORS && /./g.flags != 'g') { + objectDefinePropertyModule.f(RegExp.prototype, 'flags', { + configurable: true, + get: regExpFlags + }); +} diff --git a/core-js/modules/es.regexp.to-string.js b/core-js/modules/es.regexp.to-string.js new file mode 100644 index 0000000000..b75a79a959 --- /dev/null +++ b/core-js/modules/es.regexp.to-string.js @@ -0,0 +1,25 @@ +'use strict'; +var redefine = require('../internals/redefine'); +var anObject = require('../internals/an-object'); +var fails = require('../internals/fails'); +var flags = require('../internals/regexp-flags'); + +var TO_STRING = 'toString'; +var RegExpPrototype = RegExp.prototype; +var nativeToString = RegExpPrototype[TO_STRING]; + +var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); +// FF44- RegExp#toString has a wrong name +var INCORRECT_NAME = nativeToString.name != TO_STRING; + +// `RegExp.prototype.toString` method +// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring +if (NOT_GENERIC || INCORRECT_NAME) { + redefine(RegExp.prototype, TO_STRING, function toString() { + var R = anObject(this); + var p = String(R.source); + var rf = R.flags; + var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); + return '/' + p + '/' + f; + }, { unsafe: true }); +} diff --git a/core-js/modules/es.set.js b/core-js/modules/es.set.js new file mode 100644 index 0000000000..962dc8185b --- /dev/null +++ b/core-js/modules/es.set.js @@ -0,0 +1,9 @@ +'use strict'; +var collection = require('../internals/collection'); +var collectionStrong = require('../internals/collection-strong'); + +// `Set` constructor +// https://tc39.github.io/ecma262/#sec-set-objects +module.exports = collection('Set', function (get) { + return function Set() { return get(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong); diff --git a/core-js/modules/es.string.anchor.js b/core-js/modules/es.string.anchor.js new file mode 100644 index 0000000000..3a7fd0d9b0 --- /dev/null +++ b/core-js/modules/es.string.anchor.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.anchor` method +// https://tc39.github.io/ecma262/#sec-string.prototype.anchor +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('anchor') }, { + anchor: function anchor(name) { + return createHTML(this, 'a', 'name', name); + } +}); diff --git a/core-js/modules/es.string.big.js b/core-js/modules/es.string.big.js new file mode 100644 index 0000000000..3e530641a0 --- /dev/null +++ b/core-js/modules/es.string.big.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.big` method +// https://tc39.github.io/ecma262/#sec-string.prototype.big +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('big') }, { + big: function big() { + return createHTML(this, 'big', '', ''); + } +}); diff --git a/core-js/modules/es.string.blink.js b/core-js/modules/es.string.blink.js new file mode 100644 index 0000000000..fa4b7b547f --- /dev/null +++ b/core-js/modules/es.string.blink.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.blink` method +// https://tc39.github.io/ecma262/#sec-string.prototype.blink +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('blink') }, { + blink: function blink() { + return createHTML(this, 'blink', '', ''); + } +}); diff --git a/core-js/modules/es.string.bold.js b/core-js/modules/es.string.bold.js new file mode 100644 index 0000000000..e0d07e0d39 --- /dev/null +++ b/core-js/modules/es.string.bold.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.bold` method +// https://tc39.github.io/ecma262/#sec-string.prototype.bold +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('bold') }, { + bold: function bold() { + return createHTML(this, 'b', '', ''); + } +}); diff --git a/core-js/modules/es.string.code-point-at.js b/core-js/modules/es.string.code-point-at.js new file mode 100644 index 0000000000..26a2da2ef0 --- /dev/null +++ b/core-js/modules/es.string.code-point-at.js @@ -0,0 +1,11 @@ +'use strict'; +var $ = require('../internals/export'); +var codeAt = require('../internals/string-multibyte').codeAt; + +// `String.prototype.codePointAt` method +// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat +$({ target: 'String', proto: true }, { + codePointAt: function codePointAt(pos) { + return codeAt(this, pos); + } +}); diff --git a/core-js/modules/es.string.ends-with.js b/core-js/modules/es.string.ends-with.js new file mode 100644 index 0000000000..7eee44b12f --- /dev/null +++ b/core-js/modules/es.string.ends-with.js @@ -0,0 +1,25 @@ +'use strict'; +var $ = require('../internals/export'); +var toLength = require('../internals/to-length'); +var notARegExp = require('../internals/not-a-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); + +var nativeEndsWith = ''.endsWith; +var min = Math.min; + +// `String.prototype.endsWith` method +// https://tc39.github.io/ecma262/#sec-string.prototype.endswith +$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('endsWith') }, { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = String(requireObjectCoercible(this)); + notARegExp(searchString); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : min(toLength(endPosition), len); + var search = String(searchString); + return nativeEndsWith + ? nativeEndsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); diff --git a/core-js/modules/es.string.fixed.js b/core-js/modules/es.string.fixed.js new file mode 100644 index 0000000000..5e240e421c --- /dev/null +++ b/core-js/modules/es.string.fixed.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.fixed` method +// https://tc39.github.io/ecma262/#sec-string.prototype.fixed +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, { + fixed: function fixed() { + return createHTML(this, 'tt', '', ''); + } +}); diff --git a/core-js/modules/es.string.fontcolor.js b/core-js/modules/es.string.fontcolor.js new file mode 100644 index 0000000000..50b4f35780 --- /dev/null +++ b/core-js/modules/es.string.fontcolor.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.fontcolor` method +// https://tc39.github.io/ecma262/#sec-string.prototype.fontcolor +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontcolor') }, { + fontcolor: function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + } +}); diff --git a/core-js/modules/es.string.fontsize.js b/core-js/modules/es.string.fontsize.js new file mode 100644 index 0000000000..dbf2826dae --- /dev/null +++ b/core-js/modules/es.string.fontsize.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.fontsize` method +// https://tc39.github.io/ecma262/#sec-string.prototype.fontsize +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontsize') }, { + fontsize: function fontsize(size) { + return createHTML(this, 'font', 'size', size); + } +}); diff --git a/core-js/modules/es.string.from-code-point.js b/core-js/modules/es.string.from-code-point.js new file mode 100644 index 0000000000..139ed89190 --- /dev/null +++ b/core-js/modules/es.string.from-code-point.js @@ -0,0 +1,27 @@ +var $ = require('../internals/export'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); + +var fromCharCode = String.fromCharCode; +var nativeFromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +var INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1; + +// `String.fromCodePoint` method +// https://tc39.github.io/ecma262/#sec-string.fromcodepoint +$({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, { + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var elements = []; + var length = arguments.length; + var i = 0; + var code; + while (length > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point'); + elements.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00) + ); + } return elements.join(''); + } +}); diff --git a/core-js/modules/es.string.includes.js b/core-js/modules/es.string.includes.js new file mode 100644 index 0000000000..25dbcd8d4e --- /dev/null +++ b/core-js/modules/es.string.includes.js @@ -0,0 +1,14 @@ +'use strict'; +var $ = require('../internals/export'); +var notARegExp = require('../internals/not-a-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); + +// `String.prototype.includes` method +// https://tc39.github.io/ecma262/#sec-string.prototype.includes +$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { + includes: function includes(searchString /* , position = 0 */) { + return !!~String(requireObjectCoercible(this)) + .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.string.italics.js b/core-js/modules/es.string.italics.js new file mode 100644 index 0000000000..ce66fbfc86 --- /dev/null +++ b/core-js/modules/es.string.italics.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.italics` method +// https://tc39.github.io/ecma262/#sec-string.prototype.italics +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('italics') }, { + italics: function italics() { + return createHTML(this, 'i', '', ''); + } +}); diff --git a/core-js/modules/es.string.iterator.js b/core-js/modules/es.string.iterator.js new file mode 100644 index 0000000000..8a268e0e44 --- /dev/null +++ b/core-js/modules/es.string.iterator.js @@ -0,0 +1,29 @@ +'use strict'; +var charAt = require('../internals/string-multibyte').charAt; +var InternalStateModule = require('../internals/internal-state'); +var defineIterator = require('../internals/define-iterator'); + +var STRING_ITERATOR = 'String Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); + +// `String.prototype[@@iterator]` method +// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator +defineIterator(String, 'String', function (iterated) { + setInternalState(this, { + type: STRING_ITERATOR, + string: String(iterated), + index: 0 + }); +// `%StringIteratorPrototype%.next` method +// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next +}, function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return { value: undefined, done: true }; + point = charAt(string, index); + state.index += point.length; + return { value: point, done: false }; +}); diff --git a/core-js/modules/es.string.link.js b/core-js/modules/es.string.link.js new file mode 100644 index 0000000000..fcd97bbef9 --- /dev/null +++ b/core-js/modules/es.string.link.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.link` method +// https://tc39.github.io/ecma262/#sec-string.prototype.link +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('link') }, { + link: function link(url) { + return createHTML(this, 'a', 'href', url); + } +}); diff --git a/core-js/modules/es.string.match-all.js b/core-js/modules/es.string.match-all.js new file mode 100644 index 0000000000..53bcc7bb03 --- /dev/null +++ b/core-js/modules/es.string.match-all.js @@ -0,0 +1,94 @@ +'use strict'; +var $ = require('../internals/export'); +var createIteratorConstructor = require('../internals/create-iterator-constructor'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var toLength = require('../internals/to-length'); +var aFunction = require('../internals/a-function'); +var anObject = require('../internals/an-object'); +var classof = require('../internals/classof'); +var getFlags = require('../internals/regexp-flags'); +var hide = require('../internals/hide'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var speciesConstructor = require('../internals/species-constructor'); +var advanceStringIndex = require('../internals/advance-string-index'); +var InternalStateModule = require('../internals/internal-state'); +var IS_PURE = require('../internals/is-pure'); + +var MATCH_ALL = wellKnownSymbol('matchAll'); +var REGEXP_STRING = 'RegExp String'; +var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR); +var RegExpPrototype = RegExp.prototype; +var regExpBuiltinExec = RegExpPrototype.exec; + +var regExpExec = function (R, S) { + var exec = R.exec; + var result; + if (typeof exec == 'function') { + result = exec.call(R, S); + if (typeof result != 'object') throw TypeError('Incorrect exec result'); + return result; + } return regExpBuiltinExec.call(R, S); +}; + +// eslint-disable-next-line max-len +var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) { + setInternalState(this, { + type: REGEXP_STRING_ITERATOR, + regexp: regexp, + string: string, + global: global, + unicode: fullUnicode, + done: false + }); +}, REGEXP_STRING, function next() { + var state = getInternalState(this); + if (state.done) return { value: undefined, done: true }; + var R = state.regexp; + var S = state.string; + var match = regExpExec(R, S); + if (match === null) return { value: undefined, done: state.done = true }; + if (state.global) { + if (String(match[0]) == '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode); + return { value: match, done: false }; + } + state.done = true; + return { value: match, done: false }; +}); + +var $matchAll = function (string) { + var R = anObject(this); + var S = String(string); + var C, flagsValue, flags, matcher, global, fullUnicode; + C = speciesConstructor(R, RegExp); + flagsValue = R.flags; + if (flagsValue === undefined && R instanceof RegExp && !('flags' in RegExpPrototype)) { + flagsValue = getFlags.call(R); + } + flags = flagsValue === undefined ? '' : String(flagsValue); + matcher = new C(C === RegExp ? R.source : R, flags); + global = !!~flags.indexOf('g'); + fullUnicode = !!~flags.indexOf('u'); + matcher.lastIndex = toLength(R.lastIndex); + return new $RegExpStringIterator(matcher, S, global, fullUnicode); +}; + +// `String.prototype.matchAll` method +// https://github.com/tc39/proposal-string-matchall +$({ target: 'String', proto: true }, { + matchAll: function matchAll(regexp) { + var O = requireObjectCoercible(this); + var S, matcher, rx; + if (regexp != null) { + matcher = regexp[MATCH_ALL]; + if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll; + if (matcher != null) return aFunction(matcher).call(regexp, O); + } + S = String(O); + rx = new RegExp(regexp, 'g'); + return IS_PURE ? $matchAll.call(rx, S) : rx[MATCH_ALL](S); + } +}); + +IS_PURE || MATCH_ALL in RegExpPrototype || hide(RegExpPrototype, MATCH_ALL, $matchAll); diff --git a/core-js/modules/es.string.match.js b/core-js/modules/es.string.match.js new file mode 100644 index 0000000000..b69a2a278f --- /dev/null +++ b/core-js/modules/es.string.match.js @@ -0,0 +1,44 @@ +'use strict'; +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var toLength = require('../internals/to-length'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var advanceStringIndex = require('../internals/advance-string-index'); +var regExpExec = require('../internals/regexp-exec-abstract'); + +// @@match logic +fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.github.io/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = requireObjectCoercible(this); + var matcher = regexp == undefined ? undefined : regexp[MATCH]; + return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match + function (regexp) { + var res = maybeCallNative(nativeMatch, regexp, this); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + if (!rx.global) return regExpExec(rx, S); + + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = String(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; + } + return n === 0 ? null : A; + } + ]; +}); diff --git a/core-js/modules/es.string.pad-end.js b/core-js/modules/es.string.pad-end.js new file mode 100644 index 0000000000..5880847261 --- /dev/null +++ b/core-js/modules/es.string.pad-end.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var $padEnd = require('../internals/string-pad').end; +var WEBKIT_BUG = require('../internals/webkit-string-pad-bug'); + +// `String.prototype.padEnd` method +// https://tc39.github.io/ecma262/#sec-string.prototype.padend +$({ target: 'String', proto: true, forced: WEBKIT_BUG }, { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.string.pad-start.js b/core-js/modules/es.string.pad-start.js new file mode 100644 index 0000000000..13e265f0e1 --- /dev/null +++ b/core-js/modules/es.string.pad-start.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var $padStart = require('../internals/string-pad').start; +var WEBKIT_BUG = require('../internals/webkit-string-pad-bug'); + +// `String.prototype.padStart` method +// https://tc39.github.io/ecma262/#sec-string.prototype.padstart +$({ target: 'String', proto: true, forced: WEBKIT_BUG }, { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/core-js/modules/es.string.raw.js b/core-js/modules/es.string.raw.js new file mode 100644 index 0000000000..beb0783949 --- /dev/null +++ b/core-js/modules/es.string.raw.js @@ -0,0 +1,19 @@ +var $ = require('../internals/export'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toLength = require('../internals/to-length'); + +// `String.raw` method +// https://tc39.github.io/ecma262/#sec-string.raw +$({ target: 'String', stat: true }, { + raw: function raw(template) { + var rawTemplate = toIndexedObject(template.raw); + var literalSegments = toLength(rawTemplate.length); + var argumentsLength = arguments.length; + var elements = []; + var i = 0; + while (literalSegments > i) { + elements.push(String(rawTemplate[i++])); + if (i < argumentsLength) elements.push(String(arguments[i])); + } return elements.join(''); + } +}); diff --git a/core-js/modules/es.string.repeat.js b/core-js/modules/es.string.repeat.js new file mode 100644 index 0000000000..43890aa53c --- /dev/null +++ b/core-js/modules/es.string.repeat.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var repeat = require('../internals/string-repeat'); + +// `String.prototype.repeat` method +// https://tc39.github.io/ecma262/#sec-string.prototype.repeat +$({ target: 'String', proto: true }, { + repeat: repeat +}); diff --git a/core-js/modules/es.string.replace.js b/core-js/modules/es.string.replace.js new file mode 100644 index 0000000000..42d37af7ae --- /dev/null +++ b/core-js/modules/es.string.replace.js @@ -0,0 +1,126 @@ +'use strict'; +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var toInteger = require('../internals/to-integer'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var advanceStringIndex = require('../internals/advance-string-index'); +var regExpExec = require('../internals/regexp-exec-abstract'); + +var max = Math.max; +var min = Math.min; +var floor = Math.floor; +var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; +var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; + +var maybeToString = function (it) { + return it === undefined ? it : String(it); +}; + +// @@replace logic +fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) { + return [ + // `String.prototype.replace` method + // https://tc39.github.io/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; + return replacer !== undefined + ? replacer.call(searchValue, O, replaceValue) + : nativeReplace.call(String(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace + function (regexp, replaceValue) { + var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + var functionalReplace = typeof replaceValue === 'function'; + if (!functionalReplace) replaceValue = String(replaceValue); + + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = []; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; + + results.push(result); + if (!global) break; + + var matchStr = String(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } + + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + + var matched = String(result[0]); + var position = max(min(toInteger(result.index), S.length), 0); + var captures = []; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = [matched].concat(captures, position, S); + if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); + var replacement = String(replaceValue.apply(undefined, replacerArgs)); + } else { + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += S.slice(nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + return accumulatedResult + S.slice(nextSourcePosition); + } + ]; + + // https://tc39.github.io/ecma262/#sec-getsubstitution + function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return nativeReplace.call(replacement, symbols, function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case '$': return '$'; + case '&': return matched; + case '`': return str.slice(0, position); + case "'": return str.slice(tailPos); + case '<': + capture = namedCaptures[ch.slice(1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? '' : capture; + }); + } +}); diff --git a/core-js/modules/es.string.search.js b/core-js/modules/es.string.search.js new file mode 100644 index 0000000000..8322e2213a --- /dev/null +++ b/core-js/modules/es.string.search.js @@ -0,0 +1,34 @@ +'use strict'; +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var sameValue = require('../internals/same-value'); +var regExpExec = require('../internals/regexp-exec-abstract'); + +// @@search logic +fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.github.io/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = regexp == undefined ? undefined : regexp[SEARCH]; + return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative(nativeSearch, regexp, this); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + } + ]; +}); diff --git a/core-js/modules/es.string.small.js b/core-js/modules/es.string.small.js new file mode 100644 index 0000000000..f66b11c4d0 --- /dev/null +++ b/core-js/modules/es.string.small.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.small` method +// https://tc39.github.io/ecma262/#sec-string.prototype.small +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('small') }, { + small: function small() { + return createHTML(this, 'small', '', ''); + } +}); diff --git a/core-js/modules/es.string.split.js b/core-js/modules/es.string.split.js new file mode 100644 index 0000000000..26743f50b4 --- /dev/null +++ b/core-js/modules/es.string.split.js @@ -0,0 +1,134 @@ +'use strict'; +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var isRegExp = require('../internals/is-regexp'); +var anObject = require('../internals/an-object'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var speciesConstructor = require('../internals/species-constructor'); +var advanceStringIndex = require('../internals/advance-string-index'); +var toLength = require('../internals/to-length'); +var callRegExpExec = require('../internals/regexp-exec-abstract'); +var regexpExec = require('../internals/regexp-exec'); +var fails = require('../internals/fails'); + +var arrayPush = [].push; +var min = Math.min; +var MAX_UINT32 = 0xFFFFFFFF; + +// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError +var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); }); + +// @@split logic +fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) { + var internalSplit; + if ( + 'abbc'.split(/(b)*/)[1] == 'c' || + 'test'.split(/(?:)/, -1).length != 4 || + 'ab'.split(/(?:ab)*/).length != 2 || + '.'.split(/(.?)(.?)/).length != 4 || + '.'.split(/()()/).length > 1 || + ''.split(/.?/).length + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = String(requireObjectCoercible(this)); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (separator === undefined) return [string]; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) { + return nativeSplit.call(string, separator, lim); + } + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, lastIndex, lastLength; + while (match = regexpExec.call(separatorCopy, string)) { + lastIndex = separatorCopy.lastIndex; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1)); + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= lim) break; + } + if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop + } + if (lastLastIndex === string.length) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output.length > lim ? output.slice(0, lim) : output; + }; + // Chakra, V8 + } else if ('0'.split(undefined, 0).length) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit); + }; + } else internalSplit = nativeSplit; + + return [ + // `String.prototype.split` method + // https://tc39.github.io/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = requireObjectCoercible(this); + var splitter = separator == undefined ? undefined : separator[SPLIT]; + return splitter !== undefined + ? splitter.call(separator, O, limit) + : internalSplit.call(String(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (regexp, limit) { + var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + var C = speciesConstructor(rx, RegExp); + + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + + (rx.multiline ? 'm' : '') + + (rx.unicode ? 'u' : '') + + (SUPPORTS_Y ? 'y' : 'g'); + + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = SUPPORTS_Y ? q : 0; + var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); + var e; + if ( + z === null || + (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p + ) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + A.push(S.slice(p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + A.push(z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + A.push(S.slice(p)); + return A; + } + ]; +}, !SUPPORTS_Y); diff --git a/core-js/modules/es.string.starts-with.js b/core-js/modules/es.string.starts-with.js new file mode 100644 index 0000000000..14a590482f --- /dev/null +++ b/core-js/modules/es.string.starts-with.js @@ -0,0 +1,23 @@ +'use strict'; +var $ = require('../internals/export'); +var toLength = require('../internals/to-length'); +var notARegExp = require('../internals/not-a-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); + +var nativeStartsWith = ''.startsWith; +var min = Math.min; + +// `String.prototype.startsWith` method +// https://tc39.github.io/ecma262/#sec-string.prototype.startswith +$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('startsWith') }, { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = String(requireObjectCoercible(this)); + notARegExp(searchString); + var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return nativeStartsWith + ? nativeStartsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); diff --git a/core-js/modules/es.string.strike.js b/core-js/modules/es.string.strike.js new file mode 100644 index 0000000000..81a2ed0031 --- /dev/null +++ b/core-js/modules/es.string.strike.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.strike` method +// https://tc39.github.io/ecma262/#sec-string.prototype.strike +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('strike') }, { + strike: function strike() { + return createHTML(this, 'strike', '', ''); + } +}); diff --git a/core-js/modules/es.string.sub.js b/core-js/modules/es.string.sub.js new file mode 100644 index 0000000000..db7949e639 --- /dev/null +++ b/core-js/modules/es.string.sub.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.sub` method +// https://tc39.github.io/ecma262/#sec-string.prototype.sub +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sub') }, { + sub: function sub() { + return createHTML(this, 'sub', '', ''); + } +}); diff --git a/core-js/modules/es.string.sup.js b/core-js/modules/es.string.sup.js new file mode 100644 index 0000000000..46b6e10c0e --- /dev/null +++ b/core-js/modules/es.string.sup.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var createHTML = require('../internals/create-html'); +var forcedStringHTMLMethod = require('../internals/forced-string-html-method'); + +// `String.prototype.sup` method +// https://tc39.github.io/ecma262/#sec-string.prototype.sup +$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, { + sup: function sup() { + return createHTML(this, 'sup', '', ''); + } +}); diff --git a/core-js/modules/es.string.trim-end.js b/core-js/modules/es.string.trim-end.js new file mode 100644 index 0000000000..eec4a08a4b --- /dev/null +++ b/core-js/modules/es.string.trim-end.js @@ -0,0 +1,17 @@ +'use strict'; +var $ = require('../internals/export'); +var $trimEnd = require('../internals/string-trim').end; +var forcedStringTrimMethod = require('../internals/forced-string-trim-method'); + +var FORCED = forcedStringTrimMethod('trimEnd'); + +var trimEnd = FORCED ? function trimEnd() { + return $trimEnd(this); +} : ''.trimEnd; + +// `String.prototype.{ trimEnd, trimRight }` methods +// https://github.com/tc39/ecmascript-string-left-right-trim +$({ target: 'String', proto: true, forced: FORCED }, { + trimEnd: trimEnd, + trimRight: trimEnd +}); diff --git a/core-js/modules/es.string.trim-start.js b/core-js/modules/es.string.trim-start.js new file mode 100644 index 0000000000..882a1871d0 --- /dev/null +++ b/core-js/modules/es.string.trim-start.js @@ -0,0 +1,17 @@ +'use strict'; +var $ = require('../internals/export'); +var $trimStart = require('../internals/string-trim').start; +var forcedStringTrimMethod = require('../internals/forced-string-trim-method'); + +var FORCED = forcedStringTrimMethod('trimStart'); + +var trimStart = FORCED ? function trimStart() { + return $trimStart(this); +} : ''.trimStart; + +// `String.prototype.{ trimStart, trimLeft }` methods +// https://github.com/tc39/ecmascript-string-left-right-trim +$({ target: 'String', proto: true, forced: FORCED }, { + trimStart: trimStart, + trimLeft: trimStart +}); diff --git a/core-js/modules/es.string.trim.js b/core-js/modules/es.string.trim.js new file mode 100644 index 0000000000..d71156406f --- /dev/null +++ b/core-js/modules/es.string.trim.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var $trim = require('../internals/string-trim').trim; +var forcedStringTrimMethod = require('../internals/forced-string-trim-method'); + +// `String.prototype.trim` method +// https://tc39.github.io/ecma262/#sec-string.prototype.trim +$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + trim: function trim() { + return $trim(this); + } +}); diff --git a/core-js/modules/es.symbol.async-iterator.js b/core-js/modules/es.symbol.async-iterator.js new file mode 100644 index 0000000000..ecf7281deb --- /dev/null +++ b/core-js/modules/es.symbol.async-iterator.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.asyncIterator` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.asynciterator +defineWellKnownSymbol('asyncIterator'); diff --git a/core-js/modules/es.symbol.description.js b/core-js/modules/es.symbol.description.js new file mode 100644 index 0000000000..ea67abf6fb --- /dev/null +++ b/core-js/modules/es.symbol.description.js @@ -0,0 +1,50 @@ +// `Symbol.prototype.description` getter +// https://tc39.github.io/ecma262/#sec-symbol.prototype.description +'use strict'; +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var has = require('../internals/has'); +var isObject = require('../internals/is-object'); +var defineProperty = require('../internals/object-define-property').f; +var copyConstructorProperties = require('../internals/copy-constructor-properties'); + +var NativeSymbol = global.Symbol; + +if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) || + // Safari 12 bug + NativeSymbol().description !== undefined +)) { + var EmptyStringDescriptionStore = {}; + // wrap Symbol constructor for correct work with undefined description + var SymbolWrapper = function Symbol() { + var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]); + var result = this instanceof SymbolWrapper + ? new NativeSymbol(description) + // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' + : description === undefined ? NativeSymbol() : NativeSymbol(description); + if (description === '') EmptyStringDescriptionStore[result] = true; + return result; + }; + copyConstructorProperties(SymbolWrapper, NativeSymbol); + var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype; + symbolPrototype.constructor = SymbolWrapper; + + var symbolToString = symbolPrototype.toString; + var native = String(NativeSymbol('test')) == 'Symbol(test)'; + var regexp = /^Symbol\((.*)\)[^)]+$/; + defineProperty(symbolPrototype, 'description', { + configurable: true, + get: function description() { + var symbol = isObject(this) ? this.valueOf() : this; + var string = symbolToString.call(symbol); + if (has(EmptyStringDescriptionStore, symbol)) return ''; + var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1'); + return desc === '' ? undefined : desc; + } + }); + + $({ global: true, forced: true }, { + Symbol: SymbolWrapper + }); +} diff --git a/core-js/modules/es.symbol.has-instance.js b/core-js/modules/es.symbol.has-instance.js new file mode 100644 index 0000000000..2226ddb2c5 --- /dev/null +++ b/core-js/modules/es.symbol.has-instance.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.hasInstance` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.hasinstance +defineWellKnownSymbol('hasInstance'); diff --git a/core-js/modules/es.symbol.is-concat-spreadable.js b/core-js/modules/es.symbol.is-concat-spreadable.js new file mode 100644 index 0000000000..d53771ba9f --- /dev/null +++ b/core-js/modules/es.symbol.is-concat-spreadable.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.isConcatSpreadable` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable +defineWellKnownSymbol('isConcatSpreadable'); diff --git a/core-js/modules/es.symbol.iterator.js b/core-js/modules/es.symbol.iterator.js new file mode 100644 index 0000000000..e43878df84 --- /dev/null +++ b/core-js/modules/es.symbol.iterator.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.iterator` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.iterator +defineWellKnownSymbol('iterator'); diff --git a/core-js/modules/es.symbol.js b/core-js/modules/es.symbol.js new file mode 100644 index 0000000000..8c06b96601 --- /dev/null +++ b/core-js/modules/es.symbol.js @@ -0,0 +1,299 @@ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var IS_PURE = require('../internals/is-pure'); +var DESCRIPTORS = require('../internals/descriptors'); +var NATIVE_SYMBOL = require('../internals/native-symbol'); +var fails = require('../internals/fails'); +var has = require('../internals/has'); +var isArray = require('../internals/is-array'); +var isObject = require('../internals/is-object'); +var anObject = require('../internals/an-object'); +var toObject = require('../internals/to-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toPrimitive = require('../internals/to-primitive'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var nativeObjectCreate = require('../internals/object-create'); +var objectKeys = require('../internals/object-keys'); +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var definePropertyModule = require('../internals/object-define-property'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var hide = require('../internals/hide'); +var redefine = require('../internals/redefine'); +var shared = require('../internals/shared'); +var sharedKey = require('../internals/shared-key'); +var hiddenKeys = require('../internals/hidden-keys'); +var uid = require('../internals/uid'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol'); +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); +var setToStringTag = require('../internals/set-to-string-tag'); +var InternalStateModule = require('../internals/internal-state'); +var $forEach = require('../internals/array-iteration').forEach; + +var HIDDEN = sharedKey('hidden'); +var SYMBOL = 'Symbol'; +var PROTOTYPE = 'prototype'; +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(SYMBOL); +var ObjectPrototype = Object[PROTOTYPE]; +var $Symbol = global.Symbol; +var JSON = global.JSON; +var nativeJSONStringify = JSON && JSON.stringify; +var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; +var nativeDefineProperty = definePropertyModule.f; +var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; +var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; +var AllSymbols = shared('symbols'); +var ObjectPrototypeSymbols = shared('op-symbols'); +var StringToSymbolRegistry = shared('string-to-symbol-registry'); +var SymbolToStringRegistry = shared('symbol-to-string-registry'); +var WellKnownSymbolsStore = shared('wks'); +var QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDescriptor = DESCRIPTORS && fails(function () { + return nativeObjectCreate(nativeDefineProperty({}, 'a', { + get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (O, P, Attributes) { + var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); + if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; + nativeDefineProperty(O, P, Attributes); + if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { + nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); + } +} : nativeDefineProperty; + +var wrap = function (tag, description) { + var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]); + setInternalState(symbol, { + type: SYMBOL, + tag: tag, + description: description + }); + if (!DESCRIPTORS) symbol.description = description; + return symbol; +}; + +var isSymbol = NATIVE_SYMBOL && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return Object(it) instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(O, P, Attributes) { + if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); + anObject(O); + var key = toPrimitive(P, true); + anObject(Attributes); + if (has(AllSymbols, key)) { + if (!Attributes.enumerable) { + if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); + O[HIDDEN][key] = true; + } else { + if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; + Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); + } return setSymbolDescriptor(O, key, Attributes); + } return nativeDefineProperty(O, key, Attributes); +}; + +var $defineProperties = function defineProperties(O, Properties) { + anObject(O); + var properties = toIndexedObject(Properties); + var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); + $forEach(keys, function (key) { + if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); + }); + return O; +}; + +var $create = function create(O, Properties) { + return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); +}; + +var $propertyIsEnumerable = function propertyIsEnumerable(V) { + var P = toPrimitive(V, true); + var enumerable = nativePropertyIsEnumerable.call(this, P); + if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; + return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; +}; + +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { + var it = toIndexedObject(O); + var key = toPrimitive(P, true); + if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; + var descriptor = nativeGetOwnPropertyDescriptor(it, key); + if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { + descriptor.enumerable = true; + } + return descriptor; +}; + +var $getOwnPropertyNames = function getOwnPropertyNames(O) { + var names = nativeGetOwnPropertyNames(toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); + }); + return result; +}; + +var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; + var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) { + result.push(AllSymbols[key]); + } + }); + return result; +}; + +// `Symbol` constructor +// https://tc39.github.io/ecma262/#sec-symbol-constructor +if (!NATIVE_SYMBOL) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); + var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); + var tag = uid(description); + var setter = function (value) { + if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); + }; + if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); + return wrap(tag, description); + }; + + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return getInternalState(this).tag; + }); + + propertyIsEnumerableModule.f = $propertyIsEnumerable; + definePropertyModule.f = $defineProperty; + getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; + getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; + getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; + + if (DESCRIPTORS) { + // https://github.com/tc39/proposal-Symbol-description + nativeDefineProperty($Symbol[PROTOTYPE], 'description', { + configurable: true, + get: function description() { + return getInternalState(this).description; + } + }); + if (!IS_PURE) { + redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); + } + } + + wrappedWellKnownSymbolModule.f = function (name) { + return wrap(wellKnownSymbol(name), name); + }; +} + +$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { + Symbol: $Symbol +}); + +$forEach(objectKeys(WellKnownSymbolsStore), function (name) { + defineWellKnownSymbol(name); +}); + +$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { + // `Symbol.for` method + // https://tc39.github.io/ecma262/#sec-symbol.for + 'for': function (key) { + var string = String(key); + if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; + var symbol = $Symbol(string); + StringToSymbolRegistry[string] = symbol; + SymbolToStringRegistry[symbol] = string; + return symbol; + }, + // `Symbol.keyFor` method + // https://tc39.github.io/ecma262/#sec-symbol.keyfor + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); + if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; + }, + useSetter: function () { USE_SETTER = true; }, + useSimple: function () { USE_SETTER = false; } +}); + +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { + // `Object.create` method + // https://tc39.github.io/ecma262/#sec-object.create + create: $create, + // `Object.defineProperty` method + // https://tc39.github.io/ecma262/#sec-object.defineproperty + defineProperty: $defineProperty, + // `Object.defineProperties` method + // https://tc39.github.io/ecma262/#sec-object.defineproperties + defineProperties: $defineProperties, + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + getOwnPropertyDescriptor: $getOwnPropertyDescriptor +}); + +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + getOwnPropertyNames: $getOwnPropertyNames, + // `Object.getOwnPropertySymbols` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 +$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return getOwnPropertySymbolsModule.f(toObject(it)); + } +}); + +// `JSON.stringify` method behavior with symbols +// https://tc39.github.io/ecma262/#sec-json.stringify +JSON && $({ target: 'JSON', stat: true, forced: !NATIVE_SYMBOL || fails(function () { + var symbol = $Symbol(); + // MS Edge converts symbol values to JSON as {} + return nativeJSONStringify([symbol]) != '[null]' + // WebKit converts symbol values to JSON as null + || nativeJSONStringify({ a: symbol }) != '{}' + // V8 throws on boxed symbols + || nativeJSONStringify(Object(symbol)) != '{}'; +}) }, { + stringify: function stringify(it) { + var args = [it]; + var index = 1; + var replacer, $replacer; + while (arguments.length > index) args.push(arguments[index++]); + $replacer = replacer = args[1]; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return nativeJSONStringify.apply(JSON, args); + } +}); + +// `Symbol.prototype[@@toPrimitive]` method +// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive +if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// `Symbol.prototype[@@toStringTag]` property +// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag +setToStringTag($Symbol, SYMBOL); + +hiddenKeys[HIDDEN] = true; diff --git a/core-js/modules/es.symbol.match-all.js b/core-js/modules/es.symbol.match-all.js new file mode 100644 index 0000000000..b16c8beaa0 --- /dev/null +++ b/core-js/modules/es.symbol.match-all.js @@ -0,0 +1,4 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.matchAll` well-known symbol +defineWellKnownSymbol('matchAll'); diff --git a/core-js/modules/es.symbol.match.js b/core-js/modules/es.symbol.match.js new file mode 100644 index 0000000000..ec2fbdbedf --- /dev/null +++ b/core-js/modules/es.symbol.match.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.match` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.match +defineWellKnownSymbol('match'); diff --git a/core-js/modules/es.symbol.replace.js b/core-js/modules/es.symbol.replace.js new file mode 100644 index 0000000000..d252d8d4b5 --- /dev/null +++ b/core-js/modules/es.symbol.replace.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.replace` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.replace +defineWellKnownSymbol('replace'); diff --git a/core-js/modules/es.symbol.search.js b/core-js/modules/es.symbol.search.js new file mode 100644 index 0000000000..0c28e62c3e --- /dev/null +++ b/core-js/modules/es.symbol.search.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.search` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.search +defineWellKnownSymbol('search'); diff --git a/core-js/modules/es.symbol.species.js b/core-js/modules/es.symbol.species.js new file mode 100644 index 0000000000..8391f22d78 --- /dev/null +++ b/core-js/modules/es.symbol.species.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.species` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.species +defineWellKnownSymbol('species'); diff --git a/core-js/modules/es.symbol.split.js b/core-js/modules/es.symbol.split.js new file mode 100644 index 0000000000..5f76df44ff --- /dev/null +++ b/core-js/modules/es.symbol.split.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.split` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.split +defineWellKnownSymbol('split'); diff --git a/core-js/modules/es.symbol.to-primitive.js b/core-js/modules/es.symbol.to-primitive.js new file mode 100644 index 0000000000..c2978265c9 --- /dev/null +++ b/core-js/modules/es.symbol.to-primitive.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.toPrimitive` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.toprimitive +defineWellKnownSymbol('toPrimitive'); diff --git a/core-js/modules/es.symbol.to-string-tag.js b/core-js/modules/es.symbol.to-string-tag.js new file mode 100644 index 0000000000..8ddbfad12c --- /dev/null +++ b/core-js/modules/es.symbol.to-string-tag.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.toStringTag` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.tostringtag +defineWellKnownSymbol('toStringTag'); diff --git a/core-js/modules/es.symbol.unscopables.js b/core-js/modules/es.symbol.unscopables.js new file mode 100644 index 0000000000..a9daa60650 --- /dev/null +++ b/core-js/modules/es.symbol.unscopables.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.unscopables` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.unscopables +defineWellKnownSymbol('unscopables'); diff --git a/core-js/modules/es.typed-array.copy-within.js b/core-js/modules/es.typed-array.copy-within.js new file mode 100644 index 0000000000..59d489ae4f --- /dev/null +++ b/core-js/modules/es.typed-array.copy-within.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $copyWithin = require('../internals/array-copy-within'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.copyWithin` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin +ArrayBufferViewCore.exportProto('copyWithin', function copyWithin(target, start /* , end */) { + return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); +}); diff --git a/core-js/modules/es.typed-array.every.js b/core-js/modules/es.typed-array.every.js new file mode 100644 index 0000000000..72ae25599f --- /dev/null +++ b/core-js/modules/es.typed-array.every.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $every = require('../internals/array-iteration').every; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.every` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every +ArrayBufferViewCore.exportProto('every', function every(callbackfn /* , thisArg */) { + return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.fill.js b/core-js/modules/es.typed-array.fill.js new file mode 100644 index 0000000000..f9eb8723c3 --- /dev/null +++ b/core-js/modules/es.typed-array.fill.js @@ -0,0 +1,12 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $fill = require('../internals/array-fill'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.fill` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill +// eslint-disable-next-line no-unused-vars +ArrayBufferViewCore.exportProto('fill', function fill(value /* , start, end */) { + return $fill.apply(aTypedArray(this), arguments); +}); diff --git a/core-js/modules/es.typed-array.filter.js b/core-js/modules/es.typed-array.filter.js new file mode 100644 index 0000000000..744cecb7a7 --- /dev/null +++ b/core-js/modules/es.typed-array.filter.js @@ -0,0 +1,19 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $filter = require('../internals/array-iteration').filter; +var speciesConstructor = require('../internals/species-constructor'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + +// `%TypedArray%.prototype.filter` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter +ArrayBufferViewCore.exportProto('filter', function filter(callbackfn /* , thisArg */) { + var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + var C = speciesConstructor(this, this.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; +}); diff --git a/core-js/modules/es.typed-array.find-index.js b/core-js/modules/es.typed-array.find-index.js new file mode 100644 index 0000000000..fc98cd4ae5 --- /dev/null +++ b/core-js/modules/es.typed-array.find-index.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $findIndex = require('../internals/array-iteration').findIndex; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.findIndex` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex +ArrayBufferViewCore.exportProto('findIndex', function findIndex(predicate /* , thisArg */) { + return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.find.js b/core-js/modules/es.typed-array.find.js new file mode 100644 index 0000000000..c04cf9df69 --- /dev/null +++ b/core-js/modules/es.typed-array.find.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $find = require('../internals/array-iteration').find; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.find` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find +ArrayBufferViewCore.exportProto('find', function find(predicate /* , thisArg */) { + return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.float32-array.js b/core-js/modules/es.typed-array.float32-array.js new file mode 100644 index 0000000000..41c0ccef16 --- /dev/null +++ b/core-js/modules/es.typed-array.float32-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Float32Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.float64-array.js b/core-js/modules/es.typed-array.float64-array.js new file mode 100644 index 0000000000..18a0798a17 --- /dev/null +++ b/core-js/modules/es.typed-array.float64-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Float64Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.for-each.js b/core-js/modules/es.typed-array.for-each.js new file mode 100644 index 0000000000..b761c7ee94 --- /dev/null +++ b/core-js/modules/es.typed-array.for-each.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $forEach = require('../internals/array-iteration').forEach; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.forEach` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach +ArrayBufferViewCore.exportProto('forEach', function forEach(callbackfn /* , thisArg */) { + $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.from.js b/core-js/modules/es.typed-array.from.js new file mode 100644 index 0000000000..0b027e7b61 --- /dev/null +++ b/core-js/modules/es.typed-array.from.js @@ -0,0 +1,8 @@ +'use strict'; +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-arrays-constructors-requires-wrappers'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var typedArrayFrom = require('../internals/typed-array-from'); + +// `%TypedArray%.from` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.from +ArrayBufferViewCore.exportStatic('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS); diff --git a/core-js/modules/es.typed-array.includes.js b/core-js/modules/es.typed-array.includes.js new file mode 100644 index 0000000000..6ac5a6142c --- /dev/null +++ b/core-js/modules/es.typed-array.includes.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $includes = require('../internals/array-includes').includes; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.includes` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes +ArrayBufferViewCore.exportProto('includes', function includes(searchElement /* , fromIndex */) { + return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.index-of.js b/core-js/modules/es.typed-array.index-of.js new file mode 100644 index 0000000000..7ed1f49bfe --- /dev/null +++ b/core-js/modules/es.typed-array.index-of.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $indexOf = require('../internals/array-includes').indexOf; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.indexOf` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof +ArrayBufferViewCore.exportProto('indexOf', function indexOf(searchElement /* , fromIndex */) { + return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.int16-array.js b/core-js/modules/es.typed-array.int16-array.js new file mode 100644 index 0000000000..25b0a859cc --- /dev/null +++ b/core-js/modules/es.typed-array.int16-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Int16Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.int32-array.js b/core-js/modules/es.typed-array.int32-array.js new file mode 100644 index 0000000000..0ad85dcbae --- /dev/null +++ b/core-js/modules/es.typed-array.int32-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Int32Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.int8-array.js b/core-js/modules/es.typed-array.int8-array.js new file mode 100644 index 0000000000..8c5d64ea80 --- /dev/null +++ b/core-js/modules/es.typed-array.int8-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Int8Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.iterator.js b/core-js/modules/es.typed-array.iterator.js new file mode 100644 index 0000000000..2b149254fe --- /dev/null +++ b/core-js/modules/es.typed-array.iterator.js @@ -0,0 +1,38 @@ +'use strict'; +var global = require('../internals/global'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var ArrayIterators = require('../modules/es.array.iterator'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); +var Uint8Array = global.Uint8Array; +var arrayValues = ArrayIterators.values; +var arrayKeys = ArrayIterators.keys; +var arrayEntries = ArrayIterators.entries; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportProto = ArrayBufferViewCore.exportProto; +var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR]; + +var CORRECT_ITER_NAME = !!nativeTypedArrayIterator + && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined); + +var typedArrayValues = function values() { + return arrayValues.call(aTypedArray(this)); +}; + +// `%TypedArray%.prototype.entries` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries +exportProto('entries', function entries() { + return arrayEntries.call(aTypedArray(this)); +}); +// `%TypedArray%.prototype.keys` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys +exportProto('keys', function keys() { + return arrayKeys.call(aTypedArray(this)); +}); +// `%TypedArray%.prototype.values` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values +exportProto('values', typedArrayValues, !CORRECT_ITER_NAME); +// `%TypedArray%.prototype[@@iterator]` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator +exportProto(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME); diff --git a/core-js/modules/es.typed-array.join.js b/core-js/modules/es.typed-array.join.js new file mode 100644 index 0000000000..7954e745e7 --- /dev/null +++ b/core-js/modules/es.typed-array.join.js @@ -0,0 +1,12 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var $join = [].join; + +// `%TypedArray%.prototype.join` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join +// eslint-disable-next-line no-unused-vars +ArrayBufferViewCore.exportProto('join', function join(separator) { + return $join.apply(aTypedArray(this), arguments); +}); diff --git a/core-js/modules/es.typed-array.last-index-of.js b/core-js/modules/es.typed-array.last-index-of.js new file mode 100644 index 0000000000..ed76ead4c4 --- /dev/null +++ b/core-js/modules/es.typed-array.last-index-of.js @@ -0,0 +1,12 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $lastIndexOf = require('../internals/array-last-index-of'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.lastIndexOf` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof +// eslint-disable-next-line no-unused-vars +ArrayBufferViewCore.exportProto('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { + return $lastIndexOf.apply(aTypedArray(this), arguments); +}); diff --git a/core-js/modules/es.typed-array.map.js b/core-js/modules/es.typed-array.map.js new file mode 100644 index 0000000000..354e288569 --- /dev/null +++ b/core-js/modules/es.typed-array.map.js @@ -0,0 +1,15 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $map = require('../internals/array-iteration').map; +var speciesConstructor = require('../internals/species-constructor'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + +// `%TypedArray%.prototype.map` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map +ArrayBufferViewCore.exportProto('map', function map(mapfn /* , thisArg */) { + return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { + return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length); + }); +}); diff --git a/core-js/modules/es.typed-array.of.js b/core-js/modules/es.typed-array.of.js new file mode 100644 index 0000000000..03a5543094 --- /dev/null +++ b/core-js/modules/es.typed-array.of.js @@ -0,0 +1,15 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-arrays-constructors-requires-wrappers'); + +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + +// `%TypedArray%.of` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.of +ArrayBufferViewCore.exportStatic('of', function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = new (aTypedArrayConstructor(this))(length); + while (length > index) result[index] = arguments[index++]; + return result; +}, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS); diff --git a/core-js/modules/es.typed-array.reduce-right.js b/core-js/modules/es.typed-array.reduce-right.js new file mode 100644 index 0000000000..df9a7ec93c --- /dev/null +++ b/core-js/modules/es.typed-array.reduce-right.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $reduceRight = require('../internals/array-reduce').right; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.reduceRicht` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright +ArrayBufferViewCore.exportProto('reduceRight', function reduceRight(callbackfn /* , initialValue */) { + return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.reduce.js b/core-js/modules/es.typed-array.reduce.js new file mode 100644 index 0000000000..ba81c6a188 --- /dev/null +++ b/core-js/modules/es.typed-array.reduce.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $reduce = require('../internals/array-reduce').left; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.reduce` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce +ArrayBufferViewCore.exportProto('reduce', function reduce(callbackfn /* , initialValue */) { + return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.reverse.js b/core-js/modules/es.typed-array.reverse.js new file mode 100644 index 0000000000..5d7157193c --- /dev/null +++ b/core-js/modules/es.typed-array.reverse.js @@ -0,0 +1,20 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var floor = Math.floor; + +// `%TypedArray%.prototype.reverse` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse +ArrayBufferViewCore.exportProto('reverse', function reverse() { + var that = this; + var length = aTypedArray(that).length; + var middle = floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; +}); diff --git a/core-js/modules/es.typed-array.set.js b/core-js/modules/es.typed-array.set.js new file mode 100644 index 0000000000..2e6134cbcb --- /dev/null +++ b/core-js/modules/es.typed-array.set.js @@ -0,0 +1,26 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var toLength = require('../internals/to-length'); +var toOffset = require('../internals/to-offset'); +var toObject = require('../internals/to-object'); +var fails = require('../internals/fails'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +var FORCED = fails(function () { + // eslint-disable-next-line no-undef + new Int8Array(1).set({}); +}); + +// `%TypedArray%.prototype.set` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set +ArrayBufferViewCore.exportProto('set', function set(arrayLike /* , offset */) { + aTypedArray(this); + var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError('Wrong length'); + while (index < len) this[offset + index] = src[index++]; +}, FORCED); diff --git a/core-js/modules/es.typed-array.slice.js b/core-js/modules/es.typed-array.slice.js new file mode 100644 index 0000000000..663919f40a --- /dev/null +++ b/core-js/modules/es.typed-array.slice.js @@ -0,0 +1,25 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var speciesConstructor = require('../internals/species-constructor'); +var fails = require('../internals/fails'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; +var $slice = [].slice; + +var FORCED = fails(function () { + // eslint-disable-next-line no-undef + new Int8Array(1).slice(); +}); + +// `%TypedArray%.prototype.slice` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice +ArrayBufferViewCore.exportProto('slice', function slice(start, end) { + var list = $slice.call(aTypedArray(this), start, end); + var C = speciesConstructor(this, this.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; +}, FORCED); diff --git a/core-js/modules/es.typed-array.some.js b/core-js/modules/es.typed-array.some.js new file mode 100644 index 0000000000..c6838ddac3 --- /dev/null +++ b/core-js/modules/es.typed-array.some.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $some = require('../internals/array-iteration').some; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.some` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some +ArrayBufferViewCore.exportProto('some', function some(callbackfn /* , thisArg */) { + return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); diff --git a/core-js/modules/es.typed-array.sort.js b/core-js/modules/es.typed-array.sort.js new file mode 100644 index 0000000000..aef31734fb --- /dev/null +++ b/core-js/modules/es.typed-array.sort.js @@ -0,0 +1,11 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var $sort = [].sort; + +// `%TypedArray%.prototype.sort` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort +ArrayBufferViewCore.exportProto('sort', function sort(comparefn) { + return $sort.call(aTypedArray(this), comparefn); +}); diff --git a/core-js/modules/es.typed-array.subarray.js b/core-js/modules/es.typed-array.subarray.js new file mode 100644 index 0000000000..7e76b4e486 --- /dev/null +++ b/core-js/modules/es.typed-array.subarray.js @@ -0,0 +1,20 @@ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var toLength = require('../internals/to-length'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var speciesConstructor = require('../internals/species-constructor'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; + +// `%TypedArray%.prototype.subarray` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray +ArrayBufferViewCore.exportProto('subarray', function subarray(begin, end) { + var O = aTypedArray(this); + var length = O.length; + var beginIndex = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O.constructor))( + O.buffer, + O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) + ); +}); diff --git a/core-js/modules/es.typed-array.to-locale-string.js b/core-js/modules/es.typed-array.to-locale-string.js new file mode 100644 index 0000000000..c4e5a7da38 --- /dev/null +++ b/core-js/modules/es.typed-array.to-locale-string.js @@ -0,0 +1,26 @@ +'use strict'; +var global = require('../internals/global'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var fails = require('../internals/fails'); + +var Int8Array = global.Int8Array; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var $toLocaleString = [].toLocaleString; +var $slice = [].slice; + +// iOS Safari 6.x fails here +var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { + $toLocaleString.call(new Int8Array(1)); +}); + +var FORCED = fails(function () { + return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString(); +}) || !fails(function () { + Int8Array.prototype.toLocaleString.call([1, 2]); +}); + +// `%TypedArray%.prototype.toLocaleString` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring +ArrayBufferViewCore.exportProto('toLocaleString', function toLocaleString() { + return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments); +}, FORCED); diff --git a/core-js/modules/es.typed-array.to-string.js b/core-js/modules/es.typed-array.to-string.js new file mode 100644 index 0000000000..fbc76715fe --- /dev/null +++ b/core-js/modules/es.typed-array.to-string.js @@ -0,0 +1,19 @@ +'use strict'; +var global = require('../internals/global'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var fails = require('../internals/fails'); + +var Uint8Array = global.Uint8Array; +var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype; +var arrayToString = [].toString; +var arrayJoin = [].join; + +if (fails(function () { arrayToString.call({}); })) { + arrayToString = function toString() { + return arrayJoin.call(this); + }; +} + +// `%TypedArray%.prototype.toString` method +// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring +ArrayBufferViewCore.exportProto('toString', arrayToString, (Uint8ArrayPrototype || {}).toString != arrayToString); diff --git a/core-js/modules/es.typed-array.uint16-array.js b/core-js/modules/es.typed-array.uint16-array.js new file mode 100644 index 0000000000..faca09b6aa --- /dev/null +++ b/core-js/modules/es.typed-array.uint16-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Uint16Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.uint32-array.js b/core-js/modules/es.typed-array.uint32-array.js new file mode 100644 index 0000000000..3d2a8cacfe --- /dev/null +++ b/core-js/modules/es.typed-array.uint32-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Uint32Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.uint8-array.js b/core-js/modules/es.typed-array.uint8-array.js new file mode 100644 index 0000000000..5051c64588 --- /dev/null +++ b/core-js/modules/es.typed-array.uint8-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Uint8Array` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/core-js/modules/es.typed-array.uint8-clamped-array.js b/core-js/modules/es.typed-array.uint8-clamped-array.js new file mode 100644 index 0000000000..806b26f624 --- /dev/null +++ b/core-js/modules/es.typed-array.uint8-clamped-array.js @@ -0,0 +1,9 @@ +var typedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Uint8ClampedArray` constructor +// https://tc39.github.io/ecma262/#sec-typedarray-objects +typedArrayConstructor('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); diff --git a/core-js/modules/es.weak-map.js b/core-js/modules/es.weak-map.js new file mode 100644 index 0000000000..89784bbcef --- /dev/null +++ b/core-js/modules/es.weak-map.js @@ -0,0 +1,67 @@ +'use strict'; +var global = require('../internals/global'); +var redefineAll = require('../internals/redefine-all'); +var InternalMetadataModule = require('../internals/internal-metadata'); +var collection = require('../internals/collection'); +var collectionWeak = require('../internals/collection-weak'); +var isObject = require('../internals/is-object'); +var enforceIternalState = require('../internals/internal-state').enforce; +var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); + +var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; +var isExtensible = Object.isExtensible; +var InternalWeakMap; + +var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length ? arguments[0] : undefined); + }; +}; + +// `WeakMap` constructor +// https://tc39.github.io/ecma262/#sec-weakmap-constructor +var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak, true, true); + +// IE11 WeakMap frozen keys fix +// We can't use feature detection because it crash some old IE builds +// https://github.com/zloirock/core-js/issues/485 +if (NATIVE_WEAK_MAP && IS_IE11) { + InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); + InternalMetadataModule.REQUIRED = true; + var WeakMapPrototype = $WeakMap.prototype; + var nativeDelete = WeakMapPrototype['delete']; + var nativeHas = WeakMapPrototype.has; + var nativeGet = WeakMapPrototype.get; + var nativeSet = WeakMapPrototype.set; + redefineAll(WeakMapPrototype, { + 'delete': function (key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeDelete.call(this, key) || state.frozen['delete'](key); + } return nativeDelete.call(this, key); + }, + has: function has(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) || state.frozen.has(key); + } return nativeHas.call(this, key); + }, + get: function get(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key); + } return nativeGet.call(this, key); + }, + set: function set(key, value) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value); + } else nativeSet.call(this, key, value); + return this; + } + }); +} diff --git a/core-js/modules/es.weak-set.js b/core-js/modules/es.weak-set.js new file mode 100644 index 0000000000..a412aa557a --- /dev/null +++ b/core-js/modules/es.weak-set.js @@ -0,0 +1,9 @@ +'use strict'; +var collection = require('../internals/collection'); +var collectionWeak = require('../internals/collection-weak'); + +// `WeakSet` constructor +// https://tc39.github.io/ecma262/#sec-weakset-constructor +collection('WeakSet', function (get) { + return function WeakSet() { return get(this, arguments.length ? arguments[0] : undefined); }; +}, collectionWeak, false, true); diff --git a/core-js/modules/esnext.aggregate-error.js b/core-js/modules/esnext.aggregate-error.js new file mode 100644 index 0000000000..ec55c4374c --- /dev/null +++ b/core-js/modules/esnext.aggregate-error.js @@ -0,0 +1,29 @@ +var $ = require('../internals/export'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var create = require('../internals/object-create'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var iterate = require('../internals/iterate'); +var hide = require('../internals/hide'); + +var $AggregateError = function AggregateError(errors, message) { + var that = this; + if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message); + if (setPrototypeOf) { + that = setPrototypeOf(new Error(message), getPrototypeOf(that)); + } + var errorsArray = []; + iterate(errors, errorsArray.push, errorsArray); + hide(that, 'errors', errorsArray); + if (message !== undefined) hide(that, 'message', String(message)); + return that; +}; + +$AggregateError.prototype = create(Error.prototype, { + constructor: createPropertyDescriptor(5, $AggregateError), + name: createPropertyDescriptor(5, 'AggregateError') +}); + +$({ global: true }, { + AggregateError: $AggregateError +}); diff --git a/core-js/modules/esnext.array.is-template-object.js b/core-js/modules/esnext.array.is-template-object.js new file mode 100644 index 0000000000..a1d8428806 --- /dev/null +++ b/core-js/modules/esnext.array.is-template-object.js @@ -0,0 +1,28 @@ +var $ = require('../internals/export'); +var isArray = require('../internals/is-array'); + +var isFrozen = Object.isFrozen; + +var isFrozenStringArray = function (array, allowUndefined) { + if (!isFrozen || !isArray(array) || !isFrozen(array)) return false; + var index = 0; + var length = array.length; + var element; + while (index < length) { + element = array[index++]; + if (!(typeof element === 'string' || (allowUndefined && typeof element === 'undefined'))) { + return false; + } + } return length !== 0; +}; + +// `Array.isTemplateObject` method +// https://github.com/tc39/proposal-array-is-template-object +$({ target: 'Array', stat: true }, { + isTemplateObject: function isTemplateObject(value) { + if (!isFrozenStringArray(value, true)) return false; + var raw = value.raw; + if (raw.length !== value.length || !isFrozenStringArray(raw, false)) return false; + return true; + } +}); diff --git a/core-js/modules/esnext.array.last-index.js b/core-js/modules/esnext.array.last-index.js new file mode 100644 index 0000000000..60a2bc3fc1 --- /dev/null +++ b/core-js/modules/esnext.array.last-index.js @@ -0,0 +1,21 @@ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var addToUnscopables = require('../internals/add-to-unscopables'); +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var defineProperty = require('../internals/object-define-property').f; + +// `Array.prototype.lastIndex` getter +// https://github.com/keithamus/proposal-array-last +if (DESCRIPTORS && !('lastIndex' in [])) { + defineProperty(Array.prototype, 'lastIndex', { + configurable: true, + get: function lastIndex() { + var O = toObject(this); + var len = toLength(O.length); + return len == 0 ? 0 : len - 1; + } + }); + + addToUnscopables('lastIndex'); +} diff --git a/core-js/modules/esnext.array.last-item.js b/core-js/modules/esnext.array.last-item.js new file mode 100644 index 0000000000..7c638fe71e --- /dev/null +++ b/core-js/modules/esnext.array.last-item.js @@ -0,0 +1,26 @@ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var addToUnscopables = require('../internals/add-to-unscopables'); +var toObject = require('../internals/to-object'); +var toLength = require('../internals/to-length'); +var defineProperty = require('../internals/object-define-property').f; + +// `Array.prototype.lastIndex` accessor +// https://github.com/keithamus/proposal-array-last +if (DESCRIPTORS && !('lastItem' in [])) { + defineProperty(Array.prototype, 'lastItem', { + configurable: true, + get: function lastItem() { + var O = toObject(this); + var len = toLength(O.length); + return len == 0 ? undefined : O[len - 1]; + }, + set: function lastItem(value) { + var O = toObject(this); + var len = toLength(O.length); + return O[len == 0 ? 0 : len - 1] = value; + } + }); + + addToUnscopables('lastItem'); +} diff --git a/core-js/modules/esnext.composite-key.js b/core-js/modules/esnext.composite-key.js new file mode 100644 index 0000000000..43bedaea8b --- /dev/null +++ b/core-js/modules/esnext.composite-key.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var getCompositeKeyNode = require('../internals/composite-key'); +var getBuiltIn = require('../internals/get-built-in'); +var create = require('../internals/object-create'); + +var initializer = function () { + var freeze = getBuiltIn('Object', 'freeze'); + return freeze ? freeze(create(null)) : create(null); +}; + +// https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey +$({ global: true }, { + compositeKey: function compositeKey() { + return getCompositeKeyNode.apply(Object, arguments).get('object', initializer); + } +}); diff --git a/core-js/modules/esnext.composite-symbol.js b/core-js/modules/esnext.composite-symbol.js new file mode 100644 index 0000000000..06d1b229f9 --- /dev/null +++ b/core-js/modules/esnext.composite-symbol.js @@ -0,0 +1,11 @@ +var $ = require('../internals/export'); +var getCompositeKeyNode = require('../internals/composite-key'); +var getBuiltIn = require('../internals/get-built-in'); + +// https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey +$({ global: true }, { + compositeSymbol: function compositeSymbol() { + if (arguments.length === 1 && typeof arguments[0] === 'string') return getBuiltIn('Symbol')['for'](arguments[0]); + return getCompositeKeyNode.apply(null, arguments).get('symbol', getBuiltIn('Symbol')); + } +}); diff --git a/core-js/modules/esnext.global-this.js b/core-js/modules/esnext.global-this.js new file mode 100644 index 0000000000..7e925c8753 --- /dev/null +++ b/core-js/modules/esnext.global-this.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var global = require('../internals/global'); + +// `globalThis` object +// https://github.com/tc39/proposal-global +$({ global: true }, { + globalThis: global +}); diff --git a/core-js/modules/esnext.map.delete-all.js b/core-js/modules/esnext.map.delete-all.js new file mode 100644 index 0000000000..4554b47df0 --- /dev/null +++ b/core-js/modules/esnext.map.delete-all.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var collectionDeleteAll = require('../internals/collection-delete-all'); + +// `Map.prototype.deleteAll` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + deleteAll: function deleteAll(/* ...elements */) { + return collectionDeleteAll.apply(this, arguments); + } +}); diff --git a/core-js/modules/esnext.map.every.js b/core-js/modules/esnext.map.every.js new file mode 100644 index 0000000000..f91460a060 --- /dev/null +++ b/core-js/modules/esnext.map.every.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var bind = require('../internals/bind-context'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.every` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + every: function every(callbackfn /* , thisArg */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + return !iterate(iterator, function (key, value) { + if (!boundFunction(value, key, map)) return iterate.stop(); + }, undefined, true, true).stopped; + } +}); diff --git a/core-js/modules/esnext.map.filter.js b/core-js/modules/esnext.map.filter.js new file mode 100644 index 0000000000..3813a1f9d0 --- /dev/null +++ b/core-js/modules/esnext.map.filter.js @@ -0,0 +1,26 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var bind = require('../internals/bind-context'); +var speciesConstructor = require('../internals/species-constructor'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.filter` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + filter: function filter(callbackfn /* , thisArg */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); + var setter = aFunction(newMap.set); + iterate(iterator, function (key, value) { + if (boundFunction(value, key, map)) setter.call(newMap, key, value); + }, undefined, true, true); + return newMap; + } +}); diff --git a/core-js/modules/esnext.map.find-key.js b/core-js/modules/esnext.map.find-key.js new file mode 100644 index 0000000000..72634c7947 --- /dev/null +++ b/core-js/modules/esnext.map.find-key.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var bind = require('../internals/bind-context'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.findKey` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + findKey: function findKey(callbackfn /* , thisArg */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + return iterate(iterator, function (key, value) { + if (boundFunction(value, key, map)) return iterate.stop(key); + }, undefined, true, true).result; + } +}); diff --git a/core-js/modules/esnext.map.find.js b/core-js/modules/esnext.map.find.js new file mode 100644 index 0000000000..2d759af68b --- /dev/null +++ b/core-js/modules/esnext.map.find.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var bind = require('../internals/bind-context'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.find` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + find: function find(callbackfn /* , thisArg */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + return iterate(iterator, function (key, value) { + if (boundFunction(value, key, map)) return iterate.stop(value); + }, undefined, true, true).result; + } +}); diff --git a/core-js/modules/esnext.map.from.js b/core-js/modules/esnext.map.from.js new file mode 100644 index 0000000000..9aa6aac7d2 --- /dev/null +++ b/core-js/modules/esnext.map.from.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var from = require('../internals/collection-from'); + +// `Map.from` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +$({ target: 'Map', stat: true }, { + from: from +}); diff --git a/core-js/modules/esnext.map.group-by.js b/core-js/modules/esnext.map.group-by.js new file mode 100644 index 0000000000..a34c6a01f7 --- /dev/null +++ b/core-js/modules/esnext.map.group-by.js @@ -0,0 +1,22 @@ +'use strict'; +var $ = require('../internals/export'); +var iterate = require('../internals/iterate'); +var aFunction = require('../internals/a-function'); + +// `Map.groupBy` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', stat: true }, { + groupBy: function groupBy(iterable, keyDerivative) { + var newMap = new this(); + aFunction(keyDerivative); + var has = aFunction(newMap.has); + var get = aFunction(newMap.get); + var set = aFunction(newMap.set); + iterate(iterable, function (element) { + var derivedKey = keyDerivative(element); + if (!has.call(newMap, derivedKey)) set.call(newMap, derivedKey, [element]); + else get.call(newMap, derivedKey).push(element); + }); + return newMap; + } +}); diff --git a/core-js/modules/esnext.map.includes.js b/core-js/modules/esnext.map.includes.js new file mode 100644 index 0000000000..5f9aff000a --- /dev/null +++ b/core-js/modules/esnext.map.includes.js @@ -0,0 +1,17 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var getMapIterator = require('../internals/get-map-iterator'); +var sameValueZero = require('../internals/same-value-zero'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.includes` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + includes: function includes(searchElement) { + return iterate(getMapIterator(anObject(this)), function (key, value) { + if (sameValueZero(value, searchElement)) return iterate.stop(); + }, undefined, true, true).stopped; + } +}); diff --git a/core-js/modules/esnext.map.key-by.js b/core-js/modules/esnext.map.key-by.js new file mode 100644 index 0000000000..0204bf2cbe --- /dev/null +++ b/core-js/modules/esnext.map.key-by.js @@ -0,0 +1,18 @@ +'use strict'; +var $ = require('../internals/export'); +var iterate = require('../internals/iterate'); +var aFunction = require('../internals/a-function'); + +// `Map.keyBy` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', stat: true }, { + keyBy: function keyBy(iterable, keyDerivative) { + var newMap = new this(); + aFunction(keyDerivative); + var setter = aFunction(newMap.set); + iterate(iterable, function (element) { + setter.call(newMap, keyDerivative(element), element); + }); + return newMap; + } +}); diff --git a/core-js/modules/esnext.map.key-of.js b/core-js/modules/esnext.map.key-of.js new file mode 100644 index 0000000000..1d100dee0c --- /dev/null +++ b/core-js/modules/esnext.map.key-of.js @@ -0,0 +1,16 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.includes` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + keyOf: function keyOf(searchElement) { + return iterate(getMapIterator(anObject(this)), function (key, value) { + if (value === searchElement) return iterate.stop(key); + }, undefined, true, true).result; + } +}); diff --git a/core-js/modules/esnext.map.map-keys.js b/core-js/modules/esnext.map.map-keys.js new file mode 100644 index 0000000000..05c7ae9112 --- /dev/null +++ b/core-js/modules/esnext.map.map-keys.js @@ -0,0 +1,26 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var bind = require('../internals/bind-context'); +var speciesConstructor = require('../internals/species-constructor'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.mapKeys` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + mapKeys: function mapKeys(callbackfn /* , thisArg */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); + var setter = aFunction(newMap.set); + iterate(iterator, function (key, value) { + setter.call(newMap, boundFunction(value, key, map), value); + }, undefined, true, true); + return newMap; + } +}); diff --git a/core-js/modules/esnext.map.map-values.js b/core-js/modules/esnext.map.map-values.js new file mode 100644 index 0000000000..125fd1030d --- /dev/null +++ b/core-js/modules/esnext.map.map-values.js @@ -0,0 +1,26 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var bind = require('../internals/bind-context'); +var speciesConstructor = require('../internals/species-constructor'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.mapValues` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + mapValues: function mapValues(callbackfn /* , thisArg */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); + var setter = aFunction(newMap.set); + iterate(iterator, function (key, value) { + setter.call(newMap, key, boundFunction(value, key, map)); + }, undefined, true, true); + return newMap; + } +}); diff --git a/core-js/modules/esnext.map.merge.js b/core-js/modules/esnext.map.merge.js new file mode 100644 index 0000000000..fd2c79ccab --- /dev/null +++ b/core-js/modules/esnext.map.merge.js @@ -0,0 +1,21 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.merge` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + // eslint-disable-next-line no-unused-vars + merge: function merge(iterable /* ...iterbles */) { + var map = anObject(this); + var setter = aFunction(map.set); + var i = 0; + while (i < arguments.length) { + iterate(arguments[i++], setter, map, true); + } + return map; + } +}); diff --git a/core-js/modules/esnext.map.of.js b/core-js/modules/esnext.map.of.js new file mode 100644 index 0000000000..4f84d89d6d --- /dev/null +++ b/core-js/modules/esnext.map.of.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var of = require('../internals/collection-of'); + +// `Map.of` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +$({ target: 'Map', stat: true }, { + of: of +}); diff --git a/core-js/modules/esnext.map.reduce.js b/core-js/modules/esnext.map.reduce.js new file mode 100644 index 0000000000..91480f4873 --- /dev/null +++ b/core-js/modules/esnext.map.reduce.js @@ -0,0 +1,28 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Map.prototype.reduce` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + reduce: function reduce(callbackfn /* , initialValue */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var accumulator, step; + aFunction(callbackfn); + if (arguments.length > 1) accumulator = arguments[1]; + else { + step = iterator.next(); + if (step.done) throw TypeError('Reduce of empty map with no initial value'); + accumulator = step.value[1]; + } + iterate(iterator, function (key, value) { + accumulator = callbackfn(accumulator, value, key, map); + }, undefined, true, true); + return accumulator; + } +}); diff --git a/core-js/modules/esnext.map.some.js b/core-js/modules/esnext.map.some.js new file mode 100644 index 0000000000..822f437d77 --- /dev/null +++ b/core-js/modules/esnext.map.some.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var bind = require('../internals/bind-context'); +var getMapIterator = require('../internals/get-map-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.some` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + some: function some(callbackfn /* , thisArg */) { + var map = anObject(this); + var iterator = getMapIterator(map); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + return iterate(iterator, function (key, value) { + if (boundFunction(value, key, map)) return iterate.stop(); + }, undefined, true, true).stopped; + } +}); diff --git a/core-js/modules/esnext.map.update-or-insert.js b/core-js/modules/esnext.map.update-or-insert.js new file mode 100644 index 0000000000..6a0dac88fe --- /dev/null +++ b/core-js/modules/esnext.map.update-or-insert.js @@ -0,0 +1,18 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); + +// `Set.prototype.updateOrInsert` method +// https://docs.google.com/presentation/d/1_xtrGSoN1-l2Q74eCXPHBbbrBHsVyqArWN0ebnW-pVQ/ +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + updateOrInsert: function updateOrInsert(key, onUpdate, onInsert) { + var map = anObject(this); + aFunction(onUpdate); + aFunction(onInsert); + var value = map.has(key) ? onUpdate(map.get(key)) : onInsert(); + map.set(key, value); + return value; + } +}); diff --git a/core-js/modules/esnext.map.update.js b/core-js/modules/esnext.map.update.js new file mode 100644 index 0000000000..97358e814b --- /dev/null +++ b/core-js/modules/esnext.map.update.js @@ -0,0 +1,22 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); + +// `Set.prototype.update` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { + update: function update(key, callback /* , thunk */) { + var map = anObject(this); + var length = arguments.length; + aFunction(callback); + var isPresentInMap = map.has(key); + if (!isPresentInMap && length < 3) { + throw TypeError('Updating absent value'); + } + var value = isPresentInMap ? map.get(key) : aFunction(length > 2 ? arguments[2] : undefined)(key, map); + map.set(key, callback(value, key, map)); + return map; + } +}); diff --git a/core-js/modules/esnext.math.clamp.js b/core-js/modules/esnext.math.clamp.js new file mode 100644 index 0000000000..c69b1227cb --- /dev/null +++ b/core-js/modules/esnext.math.clamp.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +var min = Math.min; +var max = Math.max; + +// `Math.clamp` method +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + clamp: function clamp(x, lower, upper) { + return min(upper, max(lower, x)); + } +}); diff --git a/core-js/modules/esnext.math.deg-per-rad.js b/core-js/modules/esnext.math.deg-per-rad.js new file mode 100644 index 0000000000..b1c09b8e5a --- /dev/null +++ b/core-js/modules/esnext.math.deg-per-rad.js @@ -0,0 +1,7 @@ +var $ = require('../internals/export'); + +// `Math.DEG_PER_RAD` constant +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + DEG_PER_RAD: Math.PI / 180 +}); diff --git a/core-js/modules/esnext.math.degrees.js b/core-js/modules/esnext.math.degrees.js new file mode 100644 index 0000000000..e91de91cb4 --- /dev/null +++ b/core-js/modules/esnext.math.degrees.js @@ -0,0 +1,11 @@ +var $ = require('../internals/export'); + +var RAD_PER_DEG = 180 / Math.PI; + +// `Math.degrees` method +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); diff --git a/core-js/modules/esnext.math.fscale.js b/core-js/modules/esnext.math.fscale.js new file mode 100644 index 0000000000..3db68ef147 --- /dev/null +++ b/core-js/modules/esnext.math.fscale.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +var scale = require('../internals/math-scale'); +var fround = require('../internals/math-fround'); + +// `Math.fscale` method +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); diff --git a/core-js/modules/esnext.math.iaddh.js b/core-js/modules/esnext.math.iaddh.js new file mode 100644 index 0000000000..25f777bd25 --- /dev/null +++ b/core-js/modules/esnext.math.iaddh.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +// `Math.iaddh` method +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +$({ target: 'Math', stat: true }, { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); diff --git a/core-js/modules/esnext.math.imulh.js b/core-js/modules/esnext.math.imulh.js new file mode 100644 index 0000000000..3d64bb1309 --- /dev/null +++ b/core-js/modules/esnext.math.imulh.js @@ -0,0 +1,17 @@ +var $ = require('../internals/export'); + +// `Math.imulh` method +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +$({ target: 'Math', stat: true }, { + imulh: function imulh(u, v) { + var UINT16 = 0xFFFF; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); diff --git a/core-js/modules/esnext.math.isubh.js b/core-js/modules/esnext.math.isubh.js new file mode 100644 index 0000000000..367eaca064 --- /dev/null +++ b/core-js/modules/esnext.math.isubh.js @@ -0,0 +1,12 @@ +var $ = require('../internals/export'); + +// `Math.isubh` method +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +$({ target: 'Math', stat: true }, { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); diff --git a/core-js/modules/esnext.math.rad-per-deg.js b/core-js/modules/esnext.math.rad-per-deg.js new file mode 100644 index 0000000000..6515cbe583 --- /dev/null +++ b/core-js/modules/esnext.math.rad-per-deg.js @@ -0,0 +1,7 @@ +var $ = require('../internals/export'); + +// `Math.RAD_PER_DEG` constant +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + RAD_PER_DEG: 180 / Math.PI +}); diff --git a/core-js/modules/esnext.math.radians.js b/core-js/modules/esnext.math.radians.js new file mode 100644 index 0000000000..0b25512ec6 --- /dev/null +++ b/core-js/modules/esnext.math.radians.js @@ -0,0 +1,11 @@ +var $ = require('../internals/export'); + +var DEG_PER_RAD = Math.PI / 180; + +// `Math.radians` method +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); diff --git a/core-js/modules/esnext.math.scale.js b/core-js/modules/esnext.math.scale.js new file mode 100644 index 0000000000..400a9ed518 --- /dev/null +++ b/core-js/modules/esnext.math.scale.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var scale = require('../internals/math-scale'); + +// `Math.scale` method +// https://rwaldron.github.io/proposal-math-extensions/ +$({ target: 'Math', stat: true }, { + scale: scale +}); diff --git a/core-js/modules/esnext.math.seeded-prng.js b/core-js/modules/esnext.math.seeded-prng.js new file mode 100644 index 0000000000..6e3968889d --- /dev/null +++ b/core-js/modules/esnext.math.seeded-prng.js @@ -0,0 +1,33 @@ +var $ = require('../internals/export'); +var anObject = require('../internals/an-object'); +var numberIsFinite = require('../internals/number-is-finite'); +var createIteratorConstructor = require('../internals/create-iterator-constructor'); +var InternalStateModule = require('../internals/internal-state'); + +var SEEDED_RANDOM = 'Seeded Random'; +var SEEDED_RANDOM_GENERATOR = SEEDED_RANDOM + ' Generator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(SEEDED_RANDOM_GENERATOR); +var SEED_TYPE_ERROR = 'Math.seededPRNG() argument should have a "seed" field with a finite value.'; + +var $SeededRandomGenerator = createIteratorConstructor(function SeededRandomGenerator(seed) { + setInternalState(this, { + type: SEEDED_RANDOM_GENERATOR, + seed: seed % 2147483647 + }); +}, SEEDED_RANDOM, function next() { + var state = getInternalState(this); + var seed = state.seed = (state.seed * 1103515245 + 12345) % 2147483647; + return { value: (seed & 1073741823) / 1073741823, done: false }; +}); + +// `Math.seededPRNG` method +// https://github.com/tc39/proposal-seeded-random +// based on https://github.com/tc39/proposal-seeded-random/blob/78b8258835b57fc2100d076151ab506bc3202ae6/demo.html +$({ target: 'Math', stat: true, forced: true }, { + seededPRNG: function seededPRNG(it) { + var seed = anObject(it).seed; + if (!numberIsFinite(seed)) throw TypeError(SEED_TYPE_ERROR); + return new $SeededRandomGenerator(seed); + } +}); diff --git a/core-js/modules/esnext.math.signbit.js b/core-js/modules/esnext.math.signbit.js new file mode 100644 index 0000000000..1631c9b773 --- /dev/null +++ b/core-js/modules/esnext.math.signbit.js @@ -0,0 +1,10 @@ +var $ = require('../internals/export'); + +// `Math.signbit` method +// https://github.com/tc39/proposal-Math.signbit +$({ target: 'Math', stat: true }, { + signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; + } +}); diff --git a/core-js/modules/esnext.math.umulh.js b/core-js/modules/esnext.math.umulh.js new file mode 100644 index 0000000000..3174c2a5db --- /dev/null +++ b/core-js/modules/esnext.math.umulh.js @@ -0,0 +1,17 @@ +var $ = require('../internals/export'); + +// `Math.umulh` method +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +$({ target: 'Math', stat: true }, { + umulh: function umulh(u, v) { + var UINT16 = 0xFFFF; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); diff --git a/core-js/modules/esnext.number.from-string.js b/core-js/modules/esnext.number.from-string.js new file mode 100644 index 0000000000..2e2c0e94ca --- /dev/null +++ b/core-js/modules/esnext.number.from-string.js @@ -0,0 +1,30 @@ +'use strict'; +var $ = require('../internals/export'); +var toInteger = require('../internals/to-integer'); +var parseInt = require('../internals/parse-int'); + +var INVALID_NUMBER_REPRESENTATION = 'Invalid number representation'; +var INVALID_RADIX = 'Invalid radix'; +var valid = /^[\da-z]+$/; + +// `Number.fromString` method +// https://github.com/tc39/proposal-number-fromstring +$({ target: 'Number', stat: true }, { + fromString: function fromString(string, radix) { + var sign = 1; + var R, mathNum; + if (typeof string != 'string') throw TypeError(INVALID_NUMBER_REPRESENTATION); + if (!string.length) throw SyntaxError(INVALID_NUMBER_REPRESENTATION); + if (string.charAt(0) == '-') { + sign = -1; + string = string.slice(1); + if (!string.length) throw SyntaxError(INVALID_NUMBER_REPRESENTATION); + } + R = radix === undefined ? 10 : toInteger(radix); + if (R < 2 || R > 36) throw RangeError(INVALID_RADIX); + if (!valid.test(string) || (mathNum = parseInt(string, R)).toString(R) !== string) { + throw SyntaxError(INVALID_NUMBER_REPRESENTATION); + } + return sign * mathNum; + } +}); diff --git a/core-js/modules/esnext.observable.js b/core-js/modules/esnext.observable.js new file mode 100644 index 0000000000..fdfda49c6b --- /dev/null +++ b/core-js/modules/esnext.observable.js @@ -0,0 +1,207 @@ +'use strict'; +// https://github.com/tc39/proposal-observable +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var setSpecies = require('../internals/set-species'); +var aFunction = require('../internals/a-function'); +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var anInstance = require('../internals/an-instance'); +var defineProperty = require('../internals/object-define-property').f; +var hide = require('../internals/hide'); +var redefineAll = require('../internals/redefine-all'); +var getIterator = require('../internals/get-iterator'); +var iterate = require('../internals/iterate'); +var hostReportErrors = require('../internals/host-report-errors'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var InternalStateModule = require('../internals/internal-state'); + +var OBSERVABLE = wellKnownSymbol('observable'); +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscriptionState) { + var cleanup = subscriptionState.cleanup; + if (cleanup) { + subscriptionState.cleanup = undefined; + try { + cleanup(); + } catch (error) { + hostReportErrors(error); + } + } +}; + +var subscriptionClosed = function (subscriptionState) { + return subscriptionState.observer === undefined; +}; + +var close = function (subscription, subscriptionState) { + if (!DESCRIPTORS) { + subscription.closed = true; + var subscriptionObserver = subscriptionState.subscriptionObserver; + if (subscriptionObserver) subscriptionObserver.closed = true; + } subscriptionState.observer = undefined; +}; + +var Subscription = function (observer, subscriber) { + var subscriptionState = setInternalState(this, { + cleanup: undefined, + observer: anObject(observer), + subscriptionObserver: undefined + }); + var start; + if (!DESCRIPTORS) this.closed = false; + try { + if (start = getMethod(observer.start)) start.call(observer, this); + } catch (error) { + hostReportErrors(error); + } + if (subscriptionClosed(subscriptionState)) return; + var subscriptionObserver = subscriptionState.subscriptionObserver = new SubscriptionObserver(this); + try { + var cleanup = subscriber(subscriptionObserver); + var subscription = cleanup; + if (cleanup != null) subscriptionState.cleanup = typeof cleanup.unsubscribe === 'function' + ? function () { subscription.unsubscribe(); } + : aFunction(cleanup); + } catch (error) { + subscriptionObserver.error(error); + return; + } if (subscriptionClosed(subscriptionState)) cleanupSubscription(subscriptionState); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { + var subscriptionState = getInternalState(this); + if (!subscriptionClosed(subscriptionState)) { + close(this, subscriptionState); + cleanupSubscription(subscriptionState); + } + } +}); + +if (DESCRIPTORS) defineProperty(Subscription.prototype, 'closed', { + configurable: true, + get: function () { + return subscriptionClosed(getInternalState(this)); + } +}); + +var SubscriptionObserver = function (subscription) { + setInternalState(this, { subscription: subscription }); + if (!DESCRIPTORS) this.closed = false; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscriptionState = getInternalState(getInternalState(this).subscription); + if (!subscriptionClosed(subscriptionState)) { + var observer = subscriptionState.observer; + try { + var nextMethod = getMethod(observer.next); + if (nextMethod) nextMethod.call(observer, value); + } catch (error) { + hostReportErrors(error); + } + } + }, + error: function error(value) { + var subscription = getInternalState(this).subscription; + var subscriptionState = getInternalState(subscription); + if (!subscriptionClosed(subscriptionState)) { + var observer = subscriptionState.observer; + close(subscription, subscriptionState); + try { + var errorMethod = getMethod(observer.error); + if (errorMethod) errorMethod.call(observer, value); + else hostReportErrors(value); + } catch (err) { + hostReportErrors(err); + } cleanupSubscription(subscriptionState); + } + }, + complete: function complete() { + var subscription = getInternalState(this).subscription; + var subscriptionState = getInternalState(subscription); + if (!subscriptionClosed(subscriptionState)) { + var observer = subscriptionState.observer; + close(subscription, subscriptionState); + try { + var completeMethod = getMethod(observer.complete); + if (completeMethod) completeMethod.call(observer); + } catch (error) { + hostReportErrors(error); + } cleanupSubscription(subscriptionState); + } + } +}); + +if (DESCRIPTORS) defineProperty(SubscriptionObserver.prototype, 'closed', { + configurable: true, + get: function () { + return subscriptionClosed(getInternalState(getInternalState(this).subscription)); + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable'); + setInternalState(this, { subscriber: aFunction(subscriber) }); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + var length = arguments.length; + return new Subscription(typeof observer === 'function' ? { + next: observer, + error: length > 1 ? arguments[1] : undefined, + complete: length > 2 ? arguments[2] : undefined + } : isObject(observer) ? observer : {}, getInternalState(this).subscriber); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var observableMethod = getMethod(anObject(x)[OBSERVABLE]); + if (observableMethod) { + var observable = anObject(observableMethod.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + var iterator = getIterator(x); + return new C(function (observer) { + iterate(iterator, function (it) { + observer.next(it); + if (observer.closed) return iterate.stop(); + }, undefined, false, true); + observer.complete(); + }); + }, + of: function of() { + var C = typeof this === 'function' ? this : $Observable; + var length = arguments.length; + var items = new Array(length); + var index = 0; + while (index < length) items[index] = arguments[index++]; + return new C(function (observer) { + for (var i = 0; i < length; i++) { + observer.next(items[i]); + if (observer.closed) return; + } observer.complete(); + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$({ global: true }, { + Observable: $Observable +}); + +setSpecies('Observable'); diff --git a/core-js/modules/esnext.promise.all-settled.js b/core-js/modules/esnext.promise.all-settled.js new file mode 100644 index 0000000000..0b9d7eeeb0 --- /dev/null +++ b/core-js/modules/esnext.promise.all-settled.js @@ -0,0 +1,2 @@ +// TODO: Remove from `core-js@4` +require('./es.promise.all-settled.js'); diff --git a/core-js/modules/esnext.promise.any.js b/core-js/modules/esnext.promise.any.js new file mode 100644 index 0000000000..e26d1b33e2 --- /dev/null +++ b/core-js/modules/esnext.promise.any.js @@ -0,0 +1,46 @@ +'use strict'; +var $ = require('../internals/export'); +var aFunction = require('../internals/a-function'); +var getBuiltIn = require('../internals/get-built-in'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); +var iterate = require('../internals/iterate'); + +var PROMISE_ANY_ERROR = 'No one promise resolved'; + +// `Promise.any` method +// https://github.com/tc39/proposal-promise-any +$({ target: 'Promise', stat: true }, { + any: function any(iterable) { + var C = this; + var capability = newPromiseCapabilityModule.f(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var promiseResolve = aFunction(C.resolve); + var errors = []; + var counter = 0; + var remaining = 1; + var alreadyResolved = false; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyRejected = false; + errors.push(undefined); + remaining++; + promiseResolve.call(C, promise).then(function (value) { + if (alreadyRejected || alreadyResolved) return; + alreadyResolved = true; + resolve(value); + }, function (e) { + if (alreadyRejected || alreadyResolved) return; + alreadyRejected = true; + errors[index] = e; + --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR)); + }); + }); + --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR)); + }); + if (result.error) reject(result.value); + return capability.promise; + } +}); diff --git a/core-js/modules/esnext.promise.try.js b/core-js/modules/esnext.promise.try.js new file mode 100644 index 0000000000..7a7b93b6a6 --- /dev/null +++ b/core-js/modules/esnext.promise.try.js @@ -0,0 +1,15 @@ +'use strict'; +var $ = require('../internals/export'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); + +// `Promise.try` method +// https://github.com/tc39/proposal-promise-try +$({ target: 'Promise', stat: true }, { + 'try': function (callbackfn) { + var promiseCapability = newPromiseCapabilityModule.f(this); + var result = perform(callbackfn); + (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); + return promiseCapability.promise; + } +}); diff --git a/core-js/modules/esnext.reflect.define-metadata.js b/core-js/modules/esnext.reflect.define-metadata.js new file mode 100644 index 0000000000..25964392cc --- /dev/null +++ b/core-js/modules/esnext.reflect.define-metadata.js @@ -0,0 +1,15 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); + +var toMetadataKey = ReflectMetadataModule.toKey; +var ordinaryDefineOwnMetadata = ReflectMetadataModule.set; + +// `Reflect.defineMetadata` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + defineMetadata: function defineMetadata(metadataKey, metadataValue, target /* , targetKey */) { + var targetKey = arguments.length < 4 ? undefined : toMetadataKey(arguments[3]); + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), targetKey); + } +}); diff --git a/core-js/modules/esnext.reflect.delete-metadata.js b/core-js/modules/esnext.reflect.delete-metadata.js new file mode 100644 index 0000000000..ec510d38f0 --- /dev/null +++ b/core-js/modules/esnext.reflect.delete-metadata.js @@ -0,0 +1,21 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); + +var toMetadataKey = ReflectMetadataModule.toKey; +var getOrCreateMetadataMap = ReflectMetadataModule.getMap; +var store = ReflectMetadataModule.store; + +// `Reflect.deleteMetadata` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); + } +}); diff --git a/core-js/modules/esnext.reflect.get-metadata-keys.js b/core-js/modules/esnext.reflect.get-metadata-keys.js new file mode 100644 index 0000000000..795f63d641 --- /dev/null +++ b/core-js/modules/esnext.reflect.get-metadata-keys.js @@ -0,0 +1,33 @@ +var $ = require('../internals/export'); +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` +var Set = require('../modules/es.set'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var iterate = require('../internals/iterate'); + +var ordinaryOwnMetadataKeys = ReflectMetadataModule.keys; +var toMetadataKey = ReflectMetadataModule.toKey; + +var from = function (iter) { + var result = []; + iterate(iter, result.push, result); + return result; +}; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +// `Reflect.getMetadataKeys` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + var targetKey = arguments.length < 2 ? undefined : toMetadataKey(arguments[1]); + return ordinaryMetadataKeys(anObject(target), targetKey); + } +}); diff --git a/core-js/modules/esnext.reflect.get-metadata.js b/core-js/modules/esnext.reflect.get-metadata.js new file mode 100644 index 0000000000..fd344e8454 --- /dev/null +++ b/core-js/modules/esnext.reflect.get-metadata.js @@ -0,0 +1,24 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); + +var ordinaryHasOwnMetadata = ReflectMetadataModule.has; +var ordinaryGetOwnMetadata = ReflectMetadataModule.get; +var toMetadataKey = ReflectMetadataModule.toKey; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +// `Reflect.getMetadata` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); + return ordinaryGetMetadata(metadataKey, anObject(target), targetKey); + } +}); diff --git a/core-js/modules/esnext.reflect.get-own-metadata-keys.js b/core-js/modules/esnext.reflect.get-own-metadata-keys.js new file mode 100644 index 0000000000..090bb8dd76 --- /dev/null +++ b/core-js/modules/esnext.reflect.get-own-metadata-keys.js @@ -0,0 +1,15 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); + +var ordinaryOwnMetadataKeys = ReflectMetadataModule.keys; +var toMetadataKey = ReflectMetadataModule.toKey; + +// `Reflect.getOwnMetadataKeys` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + var targetKey = arguments.length < 2 ? undefined : toMetadataKey(arguments[1]); + return ordinaryOwnMetadataKeys(anObject(target), targetKey); + } +}); diff --git a/core-js/modules/esnext.reflect.get-own-metadata.js b/core-js/modules/esnext.reflect.get-own-metadata.js new file mode 100644 index 0000000000..81c40d0672 --- /dev/null +++ b/core-js/modules/esnext.reflect.get-own-metadata.js @@ -0,0 +1,15 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); + +var ordinaryGetOwnMetadata = ReflectMetadataModule.get; +var toMetadataKey = ReflectMetadataModule.toKey; + +// `Reflect.getOwnMetadata` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); + return ordinaryGetOwnMetadata(metadataKey, anObject(target), targetKey); + } +}); diff --git a/core-js/modules/esnext.reflect.has-metadata.js b/core-js/modules/esnext.reflect.has-metadata.js new file mode 100644 index 0000000000..4b81771848 --- /dev/null +++ b/core-js/modules/esnext.reflect.has-metadata.js @@ -0,0 +1,23 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); + +var ordinaryHasOwnMetadata = ReflectMetadataModule.has; +var toMetadataKey = ReflectMetadataModule.toKey; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +// `Reflect.hasMetadata` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); + return ordinaryHasMetadata(metadataKey, anObject(target), targetKey); + } +}); diff --git a/core-js/modules/esnext.reflect.has-own-metadata.js b/core-js/modules/esnext.reflect.has-own-metadata.js new file mode 100644 index 0000000000..87774b197d --- /dev/null +++ b/core-js/modules/esnext.reflect.has-own-metadata.js @@ -0,0 +1,15 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); + +var ordinaryHasOwnMetadata = ReflectMetadataModule.has; +var toMetadataKey = ReflectMetadataModule.toKey; + +// `Reflect.hasOwnMetadata` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]); + return ordinaryHasOwnMetadata(metadataKey, anObject(target), targetKey); + } +}); diff --git a/core-js/modules/esnext.reflect.metadata.js b/core-js/modules/esnext.reflect.metadata.js new file mode 100644 index 0000000000..7e1caa6812 --- /dev/null +++ b/core-js/modules/esnext.reflect.metadata.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var ReflectMetadataModule = require('../internals/reflect-metadata'); +var anObject = require('../internals/an-object'); + +var toMetadataKey = ReflectMetadataModule.toKey; +var ordinaryDefineOwnMetadata = ReflectMetadataModule.set; + +// `Reflect.metadata` method +// https://github.com/rbuckton/reflect-metadata +$({ target: 'Reflect', stat: true }, { + metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, key) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetadataKey(key)); + }; + } +}); diff --git a/core-js/modules/esnext.set.add-all.js b/core-js/modules/esnext.set.add-all.js new file mode 100644 index 0000000000..5de5089535 --- /dev/null +++ b/core-js/modules/esnext.set.add-all.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var collectionAddAll = require('../internals/collection-add-all'); + +// `Set.prototype.addAll` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + addAll: function addAll(/* ...elements */) { + return collectionAddAll.apply(this, arguments); + } +}); diff --git a/core-js/modules/esnext.set.delete-all.js b/core-js/modules/esnext.set.delete-all.js new file mode 100644 index 0000000000..43e4195494 --- /dev/null +++ b/core-js/modules/esnext.set.delete-all.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var collectionDeleteAll = require('../internals/collection-delete-all'); + +// `Set.prototype.deleteAll` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + deleteAll: function deleteAll(/* ...elements */) { + return collectionDeleteAll.apply(this, arguments); + } +}); diff --git a/core-js/modules/esnext.set.difference.js b/core-js/modules/esnext.set.difference.js new file mode 100644 index 0000000000..0bb6562657 --- /dev/null +++ b/core-js/modules/esnext.set.difference.js @@ -0,0 +1,22 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var speciesConstructor = require('../internals/species-constructor'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.difference` method +// https://github.com/tc39/proposal-set-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + difference: function difference(iterable) { + var set = anObject(this); + var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); + var remover = aFunction(newSet['delete']); + iterate(iterable, function (value) { + remover.call(newSet, value); + }); + return newSet; + } +}); diff --git a/core-js/modules/esnext.set.every.js b/core-js/modules/esnext.set.every.js new file mode 100644 index 0000000000..c8a8e1d9fb --- /dev/null +++ b/core-js/modules/esnext.set.every.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var bind = require('../internals/bind-context'); +var getSetIterator = require('../internals/get-set-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.every` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + every: function every(callbackfn /* , thisArg */) { + var set = anObject(this); + var iterator = getSetIterator(set); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + return !iterate(iterator, function (value) { + if (!boundFunction(value, value, set)) return iterate.stop(); + }, undefined, false, true).stopped; + } +}); diff --git a/core-js/modules/esnext.set.filter.js b/core-js/modules/esnext.set.filter.js new file mode 100644 index 0000000000..aeca99ac95 --- /dev/null +++ b/core-js/modules/esnext.set.filter.js @@ -0,0 +1,26 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var bind = require('../internals/bind-context'); +var speciesConstructor = require('../internals/species-constructor'); +var getSetIterator = require('../internals/get-set-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.filter` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + filter: function filter(callbackfn /* , thisArg */) { + var set = anObject(this); + var iterator = getSetIterator(set); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); + var adder = aFunction(newSet.add); + iterate(iterator, function (value) { + if (boundFunction(value, value, set)) adder.call(newSet, value); + }, undefined, false, true); + return newSet; + } +}); diff --git a/core-js/modules/esnext.set.find.js b/core-js/modules/esnext.set.find.js new file mode 100644 index 0000000000..991ee2e16a --- /dev/null +++ b/core-js/modules/esnext.set.find.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var bind = require('../internals/bind-context'); +var getSetIterator = require('../internals/get-set-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.find` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + find: function find(callbackfn /* , thisArg */) { + var set = anObject(this); + var iterator = getSetIterator(set); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + return iterate(iterator, function (value) { + if (boundFunction(value, value, set)) return iterate.stop(value); + }, undefined, false, true).result; + } +}); diff --git a/core-js/modules/esnext.set.from.js b/core-js/modules/esnext.set.from.js new file mode 100644 index 0000000000..3ca34f4517 --- /dev/null +++ b/core-js/modules/esnext.set.from.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var from = require('../internals/collection-from'); + +// `Set.from` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +$({ target: 'Set', stat: true }, { + from: from +}); diff --git a/core-js/modules/esnext.set.intersection.js b/core-js/modules/esnext.set.intersection.js new file mode 100644 index 0000000000..2d59f0d97a --- /dev/null +++ b/core-js/modules/esnext.set.intersection.js @@ -0,0 +1,23 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var speciesConstructor = require('../internals/species-constructor'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.intersection` method +// https://github.com/tc39/proposal-set-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + intersection: function intersection(iterable) { + var set = anObject(this); + var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); + var hasCheck = aFunction(set.has); + var adder = aFunction(newSet.add); + iterate(iterable, function (value) { + if (hasCheck.call(set, value)) adder.call(newSet, value); + }); + return newSet; + } +}); diff --git a/core-js/modules/esnext.set.is-disjoint-from.js b/core-js/modules/esnext.set.is-disjoint-from.js new file mode 100644 index 0000000000..3166ed9f4e --- /dev/null +++ b/core-js/modules/esnext.set.is-disjoint-from.js @@ -0,0 +1,18 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.isDisjointFrom` method +// https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + isDisjointFrom: function isDisjointFrom(iterable) { + var set = anObject(this); + var hasCheck = aFunction(set.has); + return !iterate(iterable, function (value) { + if (hasCheck.call(set, value) === true) return iterate.stop(); + }).stopped; + } +}); diff --git a/core-js/modules/esnext.set.is-subset-of.js b/core-js/modules/esnext.set.is-subset-of.js new file mode 100644 index 0000000000..b3dde5e717 --- /dev/null +++ b/core-js/modules/esnext.set.is-subset-of.js @@ -0,0 +1,25 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var getIterator = require('../internals/get-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.isSubsetOf` method +// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + isSubsetOf: function isSubsetOf(iterable) { + var iterator = getIterator(this); + var otherSet = anObject(iterable); + var hasCheck = otherSet.has; + if (typeof hasCheck != 'function') { + otherSet = new (getBuiltIn('Set'))(iterable); + hasCheck = aFunction(otherSet.has); + } + return !iterate(iterator, function (value) { + if (hasCheck.call(otherSet, value) === false) return iterate.stop(); + }, undefined, false, true).stopped; + } +}); diff --git a/core-js/modules/esnext.set.is-superset-of.js b/core-js/modules/esnext.set.is-superset-of.js new file mode 100644 index 0000000000..303667a644 --- /dev/null +++ b/core-js/modules/esnext.set.is-superset-of.js @@ -0,0 +1,18 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.isSupersetOf` method +// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + isSupersetOf: function isSupersetOf(iterable) { + var set = anObject(this); + var hasCheck = aFunction(set.has); + return !iterate(iterable, function (value) { + if (hasCheck.call(set, value) === false) return iterate.stop(); + }).stopped; + } +}); diff --git a/core-js/modules/esnext.set.join.js b/core-js/modules/esnext.set.join.js new file mode 100644 index 0000000000..4b78472710 --- /dev/null +++ b/core-js/modules/esnext.set.join.js @@ -0,0 +1,19 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var getSetIterator = require('../internals/get-set-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.join` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + join: function join(separator) { + var set = anObject(this); + var iterator = getSetIterator(set); + var sep = separator === undefined ? ',' : String(separator); + var result = []; + iterate(iterator, result.push, result, false, true); + return result.join(sep); + } +}); diff --git a/core-js/modules/esnext.set.map.js b/core-js/modules/esnext.set.map.js new file mode 100644 index 0000000000..023a82a93e --- /dev/null +++ b/core-js/modules/esnext.set.map.js @@ -0,0 +1,26 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var bind = require('../internals/bind-context'); +var speciesConstructor = require('../internals/species-constructor'); +var getSetIterator = require('../internals/get-set-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.map` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + map: function map(callbackfn /* , thisArg */) { + var set = anObject(this); + var iterator = getSetIterator(set); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); + var adder = aFunction(newSet.add); + iterate(iterator, function (value) { + adder.call(newSet, boundFunction(value, value, set)); + }, undefined, false, true); + return newSet; + } +}); diff --git a/core-js/modules/esnext.set.of.js b/core-js/modules/esnext.set.of.js new file mode 100644 index 0000000000..744698eba9 --- /dev/null +++ b/core-js/modules/esnext.set.of.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var of = require('../internals/collection-of'); + +// `Set.of` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +$({ target: 'Set', stat: true }, { + of: of +}); diff --git a/core-js/modules/esnext.set.reduce.js b/core-js/modules/esnext.set.reduce.js new file mode 100644 index 0000000000..6a08fa23d8 --- /dev/null +++ b/core-js/modules/esnext.set.reduce.js @@ -0,0 +1,28 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var getSetIterator = require('../internals/get-set-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.reduce` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + reduce: function reduce(callbackfn /* , initialValue */) { + var set = anObject(this); + var iterator = getSetIterator(set); + var accumulator, step; + aFunction(callbackfn); + if (arguments.length > 1) accumulator = arguments[1]; + else { + step = iterator.next(); + if (step.done) throw TypeError('Reduce of empty set with no initial value'); + accumulator = step.value; + } + iterate(iterator, function (value) { + accumulator = callbackfn(accumulator, value, value, set); + }, undefined, false, true); + return accumulator; + } +}); diff --git a/core-js/modules/esnext.set.some.js b/core-js/modules/esnext.set.some.js new file mode 100644 index 0000000000..abb653eb1f --- /dev/null +++ b/core-js/modules/esnext.set.some.js @@ -0,0 +1,20 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var anObject = require('../internals/an-object'); +var bind = require('../internals/bind-context'); +var getSetIterator = require('../internals/get-set-iterator'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.some` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + some: function some(callbackfn /* , thisArg */) { + var set = anObject(this); + var iterator = getSetIterator(set); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + return iterate(iterator, function (value) { + if (boundFunction(value, value, set)) return iterate.stop(); + }, undefined, false, true).stopped; + } +}); diff --git a/core-js/modules/esnext.set.symmetric-difference.js b/core-js/modules/esnext.set.symmetric-difference.js new file mode 100644 index 0000000000..ccd326fd9b --- /dev/null +++ b/core-js/modules/esnext.set.symmetric-difference.js @@ -0,0 +1,23 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var speciesConstructor = require('../internals/species-constructor'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.symmetricDifference` method +// https://github.com/tc39/proposal-set-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + symmetricDifference: function symmetricDifference(iterable) { + var set = anObject(this); + var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); + var remover = aFunction(newSet['delete']); + var adder = aFunction(newSet.add); + iterate(iterable, function (value) { + remover.call(newSet, value) || adder.call(newSet, value); + }); + return newSet; + } +}); diff --git a/core-js/modules/esnext.set.union.js b/core-js/modules/esnext.set.union.js new file mode 100644 index 0000000000..fc153d400a --- /dev/null +++ b/core-js/modules/esnext.set.union.js @@ -0,0 +1,19 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var getBuiltIn = require('../internals/get-built-in'); +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var speciesConstructor = require('../internals/species-constructor'); +var iterate = require('../internals/iterate'); + +// `Set.prototype.union` method +// https://github.com/tc39/proposal-set-methods +$({ target: 'Set', proto: true, real: true, forced: IS_PURE }, { + union: function union(iterable) { + var set = anObject(this); + var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); + iterate(iterable, aFunction(newSet.add), newSet); + return newSet; + } +}); diff --git a/core-js/modules/esnext.string.at.js b/core-js/modules/esnext.string.at.js new file mode 100644 index 0000000000..fc3c44a760 --- /dev/null +++ b/core-js/modules/esnext.string.at.js @@ -0,0 +1,11 @@ +'use strict'; +var $ = require('../internals/export'); +var charAt = require('../internals/string-multibyte').charAt; + +// `String.prototype.at` method +// https://github.com/mathiasbynens/String.prototype.at +$({ target: 'String', proto: true }, { + at: function at(pos) { + return charAt(this, pos); + } +}); diff --git a/core-js/modules/esnext.string.code-points.js b/core-js/modules/esnext.string.code-points.js new file mode 100644 index 0000000000..fcf15d667f --- /dev/null +++ b/core-js/modules/esnext.string.code-points.js @@ -0,0 +1,38 @@ +'use strict'; +var $ = require('../internals/export'); +var createIteratorConstructor = require('../internals/create-iterator-constructor'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var InternalStateModule = require('../internals/internal-state'); +var StringMultibyteModule = require('../internals/string-multibyte'); + +var codeAt = StringMultibyteModule.codeAt; +var charAt = StringMultibyteModule.charAt; +var STRING_ITERATOR = 'String Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); + +// TODO: unify with String#@@iterator +var $StringIterator = createIteratorConstructor(function StringIterator(string) { + setInternalState(this, { + type: STRING_ITERATOR, + string: string, + index: 0 + }); +}, 'String', function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return { value: undefined, done: true }; + point = charAt(string, index); + state.index += point.length; + return { value: { codePoint: codeAt(point, 0), position: index }, done: false }; +}); + +// `String.prototype.codePoints` method +// https://github.com/tc39/proposal-string-prototype-codepoints +$({ target: 'String', proto: true }, { + codePoints: function codePoints() { + return new $StringIterator(String(requireObjectCoercible(this))); + } +}); diff --git a/core-js/modules/esnext.string.match-all.js b/core-js/modules/esnext.string.match-all.js new file mode 100644 index 0000000000..d507e03fbf --- /dev/null +++ b/core-js/modules/esnext.string.match-all.js @@ -0,0 +1,3 @@ +// TODO: Remove from `core-js@4` +require('./es.symbol.match-all'); +require('./es.string.match-all'); diff --git a/core-js/modules/esnext.string.replace-all.js b/core-js/modules/esnext.string.replace-all.js new file mode 100644 index 0000000000..521d7de144 --- /dev/null +++ b/core-js/modules/esnext.string.replace-all.js @@ -0,0 +1,53 @@ +'use strict'; +var $ = require('../internals/export'); +var hide = require('../internals/hide'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var anObject = require('../internals/an-object'); +var isRegExp = require('../internals/is-regexp'); +var getRegExpFlags = require('../internals/regexp-flags'); +var speciesConstructor = require('../internals/species-constructor'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_PURE = require('../internals/is-pure'); + +var REPLACE_ALL = wellKnownSymbol('replaceAll'); +var RegExpPrototype = RegExp.prototype; + +var $replaceAll = function (string, replaceValue) { + var rx = anObject(this); + var flags = String('flags' in RegExpPrototype ? rx.flags : getRegExpFlags.call(rx)); + if (!~flags.indexOf('g')) { + rx = new (speciesConstructor(rx, RegExp))(rx.source, flags + 'g'); + } + return String(string).replace(rx, replaceValue); +}; + +// `String.prototype.replaceAll` method +// https://github.com/tc39/proposal-string-replace-all +$({ target: 'String', proto: true }, { + replaceAll: function replaceAll(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer, string, searchString, template, result, index; + if (searchValue != null) { + replacer = searchValue[REPLACE_ALL]; + if (replacer !== undefined) { + return replacer.call(searchValue, O, replaceValue); + } else if (IS_PURE && isRegExp(searchValue)) { + return $replaceAll.call(searchValue, O, replaceValue); + } + } + string = String(O); + searchString = String(searchValue); + template = string.split(searchString); + if (typeof replaceValue !== 'function') { + return template.join(String(replaceValue)); + } + result = template[0]; + for (index = 1; index < template.length; index++) { + result += String(replaceValue(searchString, index - 1, string)); + result += template[index]; + } + return result; + } +}); + +IS_PURE || REPLACE_ALL in RegExpPrototype || hide(RegExpPrototype, REPLACE_ALL, $replaceAll); diff --git a/core-js/modules/esnext.symbol.async-dispose.js b/core-js/modules/esnext.symbol.async-dispose.js new file mode 100644 index 0000000000..776608e901 --- /dev/null +++ b/core-js/modules/esnext.symbol.async-dispose.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.asyncDispose` well-known symbol +// https://github.com/tc39/proposal-using-statement +defineWellKnownSymbol('asyncDispose'); diff --git a/core-js/modules/esnext.symbol.dispose.js b/core-js/modules/esnext.symbol.dispose.js new file mode 100644 index 0000000000..ac7691dd51 --- /dev/null +++ b/core-js/modules/esnext.symbol.dispose.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.dispose` well-known symbol +// https://github.com/tc39/proposal-using-statement +defineWellKnownSymbol('dispose'); diff --git a/core-js/modules/esnext.symbol.observable.js b/core-js/modules/esnext.symbol.observable.js new file mode 100644 index 0000000000..dc4a4f5501 --- /dev/null +++ b/core-js/modules/esnext.symbol.observable.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.observable` well-known symbol +// https://github.com/tc39/proposal-observable +defineWellKnownSymbol('observable'); diff --git a/core-js/modules/esnext.symbol.pattern-match.js b/core-js/modules/esnext.symbol.pattern-match.js new file mode 100644 index 0000000000..01200639cf --- /dev/null +++ b/core-js/modules/esnext.symbol.pattern-match.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.patternMatch` well-known symbol +// https://github.com/tc39/proposal-pattern-matching +defineWellKnownSymbol('patternMatch'); diff --git a/core-js/modules/esnext.symbol.replace-all.js b/core-js/modules/esnext.symbol.replace-all.js new file mode 100644 index 0000000000..c103887233 --- /dev/null +++ b/core-js/modules/esnext.symbol.replace-all.js @@ -0,0 +1,5 @@ +var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); + +// `Symbol.replaceAll` well-known symbol +// https://tc39.github.io/proposal-string-replaceall/ +defineWellKnownSymbol('replaceAll'); diff --git a/core-js/modules/esnext.weak-map.delete-all.js b/core-js/modules/esnext.weak-map.delete-all.js new file mode 100644 index 0000000000..ef56f99c88 --- /dev/null +++ b/core-js/modules/esnext.weak-map.delete-all.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var collectionDeleteAll = require('../internals/collection-delete-all'); + +// `WeakMap.prototype.deleteAll` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, { + deleteAll: function deleteAll(/* ...elements */) { + return collectionDeleteAll.apply(this, arguments); + } +}); diff --git a/core-js/modules/esnext.weak-map.from.js b/core-js/modules/esnext.weak-map.from.js new file mode 100644 index 0000000000..8dc7b01a52 --- /dev/null +++ b/core-js/modules/esnext.weak-map.from.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var from = require('../internals/collection-from'); + +// `WeakMap.from` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +$({ target: 'WeakMap', stat: true }, { + from: from +}); diff --git a/core-js/modules/esnext.weak-map.of.js b/core-js/modules/esnext.weak-map.of.js new file mode 100644 index 0000000000..efea5139b1 --- /dev/null +++ b/core-js/modules/esnext.weak-map.of.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var of = require('../internals/collection-of'); + +// `WeakMap.of` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +$({ target: 'WeakMap', stat: true }, { + of: of +}); diff --git a/core-js/modules/esnext.weak-set.add-all.js b/core-js/modules/esnext.weak-set.add-all.js new file mode 100644 index 0000000000..e8bb4c9629 --- /dev/null +++ b/core-js/modules/esnext.weak-set.add-all.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var collectionAddAll = require('../internals/collection-add-all'); + +// `WeakSet.prototype.addAll` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'WeakSet', proto: true, real: true, forced: IS_PURE }, { + addAll: function addAll(/* ...elements */) { + return collectionAddAll.apply(this, arguments); + } +}); diff --git a/core-js/modules/esnext.weak-set.delete-all.js b/core-js/modules/esnext.weak-set.delete-all.js new file mode 100644 index 0000000000..b2628213f4 --- /dev/null +++ b/core-js/modules/esnext.weak-set.delete-all.js @@ -0,0 +1,12 @@ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var collectionDeleteAll = require('../internals/collection-delete-all'); + +// `WeakSet.prototype.deleteAll` method +// https://github.com/tc39/proposal-collection-methods +$({ target: 'WeakSet', proto: true, real: true, forced: IS_PURE }, { + deleteAll: function deleteAll(/* ...elements */) { + return collectionDeleteAll.apply(this, arguments); + } +}); diff --git a/core-js/modules/esnext.weak-set.from.js b/core-js/modules/esnext.weak-set.from.js new file mode 100644 index 0000000000..e13acec6dc --- /dev/null +++ b/core-js/modules/esnext.weak-set.from.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var from = require('../internals/collection-from'); + +// `WeakSet.from` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +$({ target: 'WeakSet', stat: true }, { + from: from +}); diff --git a/core-js/modules/esnext.weak-set.of.js b/core-js/modules/esnext.weak-set.of.js new file mode 100644 index 0000000000..aee9920fe4 --- /dev/null +++ b/core-js/modules/esnext.weak-set.of.js @@ -0,0 +1,8 @@ +var $ = require('../internals/export'); +var of = require('../internals/collection-of'); + +// `WeakSet.of` method +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +$({ target: 'WeakSet', stat: true }, { + of: of +}); diff --git a/core-js/modules/web.dom-collections.for-each.js b/core-js/modules/web.dom-collections.for-each.js new file mode 100644 index 0000000000..72c125aae4 --- /dev/null +++ b/core-js/modules/web.dom-collections.for-each.js @@ -0,0 +1,15 @@ +var global = require('../internals/global'); +var DOMIterables = require('../internals/dom-iterables'); +var forEach = require('../internals/array-for-each'); +var hide = require('../internals/hide'); + +for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { + hide(CollectionPrototype, 'forEach', forEach); + } catch (error) { + CollectionPrototype.forEach = forEach; + } +} diff --git a/core-js/modules/web.dom-collections.iterator.js b/core-js/modules/web.dom-collections.iterator.js new file mode 100644 index 0000000000..38a7709193 --- /dev/null +++ b/core-js/modules/web.dom-collections.iterator.js @@ -0,0 +1,31 @@ +var global = require('../internals/global'); +var DOMIterables = require('../internals/dom-iterables'); +var ArrayIteratorMethods = require('../modules/es.array.iterator'); +var hide = require('../internals/hide'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var ArrayValues = ArrayIteratorMethods.values; + +for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + if (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[ITERATOR] !== ArrayValues) try { + hide(CollectionPrototype, ITERATOR, ArrayValues); + } catch (error) { + CollectionPrototype[ITERATOR] = ArrayValues; + } + if (!CollectionPrototype[TO_STRING_TAG]) hide(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); + if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { + hide(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); + } catch (error) { + CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; + } + } + } +} diff --git a/core-js/modules/web.immediate.js b/core-js/modules/web.immediate.js new file mode 100644 index 0000000000..b606d40640 --- /dev/null +++ b/core-js/modules/web.immediate.js @@ -0,0 +1,14 @@ +var global = require('../internals/global'); +var task = require('../internals/task'); + +var FORCED = !global.setImmediate || !global.clearImmediate; + +// http://w3c.github.io/setImmediate/ +require('../internals/export')({ global: true, bind: true, enumerable: true, forced: FORCED }, { + // `setImmediate` method + // http://w3c.github.io/setImmediate/#si-setImmediate + setImmediate: task.set, + // `clearImmediate` method + // http://w3c.github.io/setImmediate/#si-clearImmediate + clearImmediate: task.clear +}); diff --git a/core-js/modules/web.queue-microtask.js b/core-js/modules/web.queue-microtask.js new file mode 100644 index 0000000000..ac5530c1b2 --- /dev/null +++ b/core-js/modules/web.queue-microtask.js @@ -0,0 +1,16 @@ +var $ = require('../internals/export'); +var global = require('../internals/global'); +var microtask = require('../internals/microtask'); +var classof = require('../internals/classof-raw'); + +var process = global.process; +var isNode = classof(process) == 'process'; + +// `queueMicrotask` method +// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask +$({ global: true, enumerable: true, noTargetGet: true }, { + queueMicrotask: function queueMicrotask(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); diff --git a/core-js/modules/web.timers.js b/core-js/modules/web.timers.js new file mode 100644 index 0000000000..0a5fc97481 --- /dev/null +++ b/core-js/modules/web.timers.js @@ -0,0 +1,28 @@ +var $ = require('../internals/export'); +var global = require('../internals/global'); +var userAgent = require('../internals/user-agent'); + +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check + +var wrap = function (scheduler) { + return function (handler, timeout /* , ...arguments */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : undefined; + return scheduler(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof handler == 'function' ? handler : Function(handler)).apply(this, args); + } : handler, timeout); + }; +}; + +// ie9- setTimeout & setInterval additional parameters fix +// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers +$({ global: true, bind: true, forced: MSIE }, { + // `setTimeout` method + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout + setTimeout: wrap(global.setTimeout), + // `setInterval` method + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval + setInterval: wrap(global.setInterval) +}); diff --git a/core-js/modules/web.url-search-params.js b/core-js/modules/web.url-search-params.js new file mode 100644 index 0000000000..57454b3276 --- /dev/null +++ b/core-js/modules/web.url-search-params.js @@ -0,0 +1,311 @@ +'use strict'; +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` +require('../modules/es.array.iterator'); +var $ = require('../internals/export'); +var USE_NATIVE_URL = require('../internals/native-url'); +var redefine = require('../internals/redefine'); +var redefineAll = require('../internals/redefine-all'); +var setToStringTag = require('../internals/set-to-string-tag'); +var createIteratorConstructor = require('../internals/create-iterator-constructor'); +var InternalStateModule = require('../internals/internal-state'); +var anInstance = require('../internals/an-instance'); +var hasOwn = require('../internals/has'); +var bind = require('../internals/bind-context'); +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var getIterator = require('../internals/get-iterator'); +var getIteratorMethod = require('../internals/get-iterator-method'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); +var URL_SEARCH_PARAMS = 'URLSearchParams'; +var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS); +var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); + +var plus = /\+/g; +var sequences = Array(4); + +var percentSequence = function (bytes) { + return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); +}; + +var percentDecode = function (sequence) { + try { + return decodeURIComponent(sequence); + } catch (error) { + return sequence; + } +}; + +var deserialize = function (it) { + var result = it.replace(plus, ' '); + var bytes = 4; + try { + return decodeURIComponent(result); + } catch (error) { + while (bytes) { + result = result.replace(percentSequence(bytes--), percentDecode); + } + return result; + } +}; + +var find = /[!'()~]|%20/g; + +var replace = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+' +}; + +var replacer = function (match) { + return replace[match]; +}; + +var serialize = function (it) { + return encodeURIComponent(it).replace(find, replacer); +}; + +var parseSearchParams = function (result, query) { + if (query) { + var attributes = query.split('&'); + var index = 0; + var attribute, entry; + while (index < attributes.length) { + attribute = attributes[index++]; + if (attribute.length) { + entry = attribute.split('='); + result.push({ + key: deserialize(entry.shift()), + value: deserialize(entry.join('=')) + }); + } + } + } +}; + +var updateSearchParams = function (query) { + this.entries.length = 0; + parseSearchParams(this.entries, query); +}; + +var validateArgumentsLength = function (passed, required) { + if (passed < required) throw TypeError('Not enough arguments'); +}; + +var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { + setInternalState(this, { + type: URL_SEARCH_PARAMS_ITERATOR, + iterator: getIterator(getInternalParamsState(params).entries), + kind: kind + }); +}, 'Iterator', function next() { + var state = getInternalIteratorState(this); + var kind = state.kind; + var step = state.iterator.next(); + var entry = step.value; + if (!step.done) { + step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value]; + } return step; +}); + +// `URLSearchParams` constructor +// https://url.spec.whatwg.org/#interface-urlsearchparams +var URLSearchParamsConstructor = function URLSearchParams(/* init */) { + anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); + var init = arguments.length > 0 ? arguments[0] : undefined; + var that = this; + var entries = []; + var iteratorMethod, iterator, step, entryIterator, first, second, key; + + setInternalState(that, { + type: URL_SEARCH_PARAMS, + entries: entries, + updateURL: function () { /* empty */ }, + updateSearchParams: updateSearchParams + }); + + if (init !== undefined) { + if (isObject(init)) { + iteratorMethod = getIteratorMethod(init); + if (typeof iteratorMethod === 'function') { + iterator = iteratorMethod.call(init); + while (!(step = iterator.next()).done) { + entryIterator = getIterator(anObject(step.value)); + if ( + (first = entryIterator.next()).done || + (second = entryIterator.next()).done || + !entryIterator.next().done + ) throw TypeError('Expected sequence with length 2'); + entries.push({ key: first.value + '', value: second.value + '' }); + } + } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' }); + } else { + parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + ''); + } + } +}; + +var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; + +redefineAll(URLSearchParamsPrototype, { + // `URLSearchParams.prototype.appent` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-append + append: function append(name, value) { + validateArgumentsLength(arguments.length, 2); + var state = getInternalParamsState(this); + state.entries.push({ key: name + '', value: value + '' }); + state.updateURL(); + }, + // `URLSearchParams.prototype.delete` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-delete + 'delete': function (name) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var key = name + ''; + var index = 0; + while (index < entries.length) { + if (entries[index].key === key) entries.splice(index, 1); + else index++; + } + state.updateURL(); + }, + // `URLSearchParams.prototype.get` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-get + get: function get(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) return entries[index].value; + } + return null; + }, + // `URLSearchParams.prototype.getAll` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-getall + getAll: function getAll(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var result = []; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) result.push(entries[index].value); + } + return result; + }, + // `URLSearchParams.prototype.has` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-has + has: function has(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var index = 0; + while (index < entries.length) { + if (entries[index++].key === key) return true; + } + return false; + }, + // `URLSearchParams.prototype.set` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-set + set: function set(name, value) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var found = false; + var key = name + ''; + var val = value + ''; + var index = 0; + var entry; + for (; index < entries.length; index++) { + entry = entries[index]; + if (entry.key === key) { + if (found) entries.splice(index--, 1); + else { + found = true; + entry.value = val; + } + } + } + if (!found) entries.push({ key: key, value: val }); + state.updateURL(); + }, + // `URLSearchParams.prototype.sort` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-sort + sort: function sort() { + var state = getInternalParamsState(this); + var entries = state.entries; + // Array#sort is not stable in some engines + var slice = entries.slice(); + var entry, entriesIndex, sliceIndex; + entries.length = 0; + for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { + entry = slice[sliceIndex]; + for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) { + if (entries[entriesIndex].key > entry.key) { + entries.splice(entriesIndex, 0, entry); + break; + } + } + if (entriesIndex === sliceIndex) entries.push(entry); + } + state.updateURL(); + }, + // `URLSearchParams.prototype.forEach` method + forEach: function forEach(callback /* , thisArg */) { + var entries = getInternalParamsState(this).entries; + var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3); + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + boundFunction(entry.value, entry.key, this); + } + }, + // `URLSearchParams.prototype.keys` method + keys: function keys() { + return new URLSearchParamsIterator(this, 'keys'); + }, + // `URLSearchParams.prototype.values` method + values: function values() { + return new URLSearchParamsIterator(this, 'values'); + }, + // `URLSearchParams.prototype.entries` method + entries: function entries() { + return new URLSearchParamsIterator(this, 'entries'); + } +}, { enumerable: true }); + +// `URLSearchParams.prototype[@@iterator]` method +redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries); + +// `URLSearchParams.prototype.toString` method +// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior +redefine(URLSearchParamsPrototype, 'toString', function toString() { + var entries = getInternalParamsState(this).entries; + var result = []; + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + result.push(serialize(entry.key) + '=' + serialize(entry.value)); + } return result.join('&'); +}, { enumerable: true }); + +setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); + +$({ global: true, forced: !USE_NATIVE_URL }, { + URLSearchParams: URLSearchParamsConstructor +}); + +module.exports = { + URLSearchParams: URLSearchParamsConstructor, + getState: getInternalParamsState +}; diff --git a/core-js/modules/web.url.js b/core-js/modules/web.url.js new file mode 100644 index 0000000000..2d4a924985 --- /dev/null +++ b/core-js/modules/web.url.js @@ -0,0 +1,1008 @@ +'use strict'; +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` +require('../modules/es.string.iterator'); +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var USE_NATIVE_URL = require('../internals/native-url'); +var global = require('../internals/global'); +var defineProperties = require('../internals/object-define-properties'); +var redefine = require('../internals/redefine'); +var anInstance = require('../internals/an-instance'); +var has = require('../internals/has'); +var assign = require('../internals/object-assign'); +var arrayFrom = require('../internals/array-from'); +var codeAt = require('../internals/string-multibyte').codeAt; +var toASCII = require('../internals/punycode-to-ascii'); +var setToStringTag = require('../internals/set-to-string-tag'); +var URLSearchParamsModule = require('../modules/web.url-search-params'); +var InternalStateModule = require('../internals/internal-state'); + +var NativeURL = global.URL; +var URLSearchParams = URLSearchParamsModule.URLSearchParams; +var getInternalSearchParamsState = URLSearchParamsModule.getState; +var setInternalState = InternalStateModule.set; +var getInternalURLState = InternalStateModule.getterFor('URL'); +var floor = Math.floor; +var pow = Math.pow; + +var INVALID_AUTHORITY = 'Invalid authority'; +var INVALID_SCHEME = 'Invalid scheme'; +var INVALID_HOST = 'Invalid host'; +var INVALID_PORT = 'Invalid port'; + +var ALPHA = /[A-Za-z]/; +var ALPHANUMERIC = /[\d+\-.A-Za-z]/; +var DIGIT = /\d/; +var HEX_START = /^(0x|0X)/; +var OCT = /^[0-7]+$/; +var DEC = /^\d+$/; +var HEX = /^[\dA-Fa-f]+$/; +// eslint-disable-next-line no-control-regex +var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; +// eslint-disable-next-line no-control-regex +var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; +// eslint-disable-next-line no-control-regex +var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; +// eslint-disable-next-line no-control-regex +var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; +var EOF; + +var parseHost = function (url, input) { + var result, codePoints, index; + if (input.charAt(0) == '[') { + if (input.charAt(input.length - 1) != ']') return INVALID_HOST; + result = parseIPv6(input.slice(1, -1)); + if (!result) return INVALID_HOST; + url.host = result; + // opaque host + } else if (!isSpecial(url)) { + if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; + result = ''; + codePoints = arrayFrom(input); + for (index = 0; index < codePoints.length; index++) { + result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); + } + url.host = result; + } else { + input = toASCII(input); + if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; + result = parseIPv4(input); + if (result === null) return INVALID_HOST; + url.host = result; + } +}; + +var parseIPv4 = function (input) { + var parts = input.split('.'); + var partsLength, numbers, index, part, radix, number, ipv4; + if (parts.length && parts[parts.length - 1] == '') { + parts.pop(); + } + partsLength = parts.length; + if (partsLength > 4) return input; + numbers = []; + for (index = 0; index < partsLength; index++) { + part = parts[index]; + if (part == '') return input; + radix = 10; + if (part.length > 1 && part.charAt(0) == '0') { + radix = HEX_START.test(part) ? 16 : 8; + part = part.slice(radix == 8 ? 1 : 2); + } + if (part === '') { + number = 0; + } else { + if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input; + number = parseInt(part, radix); + } + numbers.push(number); + } + for (index = 0; index < partsLength; index++) { + number = numbers[index]; + if (index == partsLength - 1) { + if (number >= pow(256, 5 - partsLength)) return null; + } else if (number > 255) return null; + } + ipv4 = numbers.pop(); + for (index = 0; index < numbers.length; index++) { + ipv4 += numbers[index] * pow(256, 3 - index); + } + return ipv4; +}; + +// eslint-disable-next-line max-statements +var parseIPv6 = function (input) { + var address = [0, 0, 0, 0, 0, 0, 0, 0]; + var pieceIndex = 0; + var compress = null; + var pointer = 0; + var value, length, numbersSeen, ipv4Piece, number, swaps, swap; + + var char = function () { + return input.charAt(pointer); + }; + + if (char() == ':') { + if (input.charAt(1) != ':') return; + pointer += 2; + pieceIndex++; + compress = pieceIndex; + } + while (char()) { + if (pieceIndex == 8) return; + if (char() == ':') { + if (compress !== null) return; + pointer++; + pieceIndex++; + compress = pieceIndex; + continue; + } + value = length = 0; + while (length < 4 && HEX.test(char())) { + value = value * 16 + parseInt(char(), 16); + pointer++; + length++; + } + if (char() == '.') { + if (length == 0) return; + pointer -= length; + if (pieceIndex > 6) return; + numbersSeen = 0; + while (char()) { + ipv4Piece = null; + if (numbersSeen > 0) { + if (char() == '.' && numbersSeen < 4) pointer++; + else return; + } + if (!DIGIT.test(char())) return; + while (DIGIT.test(char())) { + number = parseInt(char(), 10); + if (ipv4Piece === null) ipv4Piece = number; + else if (ipv4Piece == 0) return; + else ipv4Piece = ipv4Piece * 10 + number; + if (ipv4Piece > 255) return; + pointer++; + } + address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; + numbersSeen++; + if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; + } + if (numbersSeen != 4) return; + break; + } else if (char() == ':') { + pointer++; + if (!char()) return; + } else if (char()) return; + address[pieceIndex++] = value; + } + if (compress !== null) { + swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex != 0 && swaps > 0) { + swap = address[pieceIndex]; + address[pieceIndex--] = address[compress + swaps - 1]; + address[compress + --swaps] = swap; + } + } else if (pieceIndex != 8) return; + return address; +}; + +var findLongestZeroSequence = function (ipv6) { + var maxIndex = null; + var maxLength = 1; + var currStart = null; + var currLength = 0; + var index = 0; + for (; index < 8; index++) { + if (ipv6[index] !== 0) { + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + currStart = null; + currLength = 0; + } else { + if (currStart === null) currStart = index; + ++currLength; + } + } + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + return maxIndex; +}; + +var serializeHost = function (host) { + var result, index, compress, ignore0; + // ipv4 + if (typeof host == 'number') { + result = []; + for (index = 0; index < 4; index++) { + result.unshift(host % 256); + host = floor(host / 256); + } return result.join('.'); + // ipv6 + } else if (typeof host == 'object') { + result = ''; + compress = findLongestZeroSequence(host); + for (index = 0; index < 8; index++) { + if (ignore0 && host[index] === 0) continue; + if (ignore0) ignore0 = false; + if (compress === index) { + result += index ? ':' : '::'; + ignore0 = true; + } else { + result += host[index].toString(16); + if (index < 7) result += ':'; + } + } + return '[' + result + ']'; + } return host; +}; + +var C0ControlPercentEncodeSet = {}; +var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { + ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 +}); +var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { + '#': 1, '?': 1, '{': 1, '}': 1 +}); +var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { + '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1 +}); + +var percentEncode = function (char, set) { + var code = codeAt(char, 0); + return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char); +}; + +var specialSchemes = { + ftp: 21, + file: null, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +var isSpecial = function (url) { + return has(specialSchemes, url.scheme); +}; + +var includesCredentials = function (url) { + return url.username != '' || url.password != ''; +}; + +var cannotHaveUsernamePasswordPort = function (url) { + return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; +}; + +var isWindowsDriveLetter = function (string, normalized) { + var second; + return string.length == 2 && ALPHA.test(string.charAt(0)) + && ((second = string.charAt(1)) == ':' || (!normalized && second == '|')); +}; + +var startsWithWindowsDriveLetter = function (string) { + var third; + return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && ( + string.length == 2 || + ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#') + ); +}; + +var shortenURLsPath = function (url) { + var path = url.path; + var pathSize = path.length; + if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { + path.pop(); + } +}; + +var isSingleDot = function (segment) { + return segment === '.' || segment.toLowerCase() === '%2e'; +}; + +var isDoubleDot = function (segment) { + segment = segment.toLowerCase(); + return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; +}; + +// States: +var SCHEME_START = {}; +var SCHEME = {}; +var NO_SCHEME = {}; +var SPECIAL_RELATIVE_OR_AUTHORITY = {}; +var PATH_OR_AUTHORITY = {}; +var RELATIVE = {}; +var RELATIVE_SLASH = {}; +var SPECIAL_AUTHORITY_SLASHES = {}; +var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; +var AUTHORITY = {}; +var HOST = {}; +var HOSTNAME = {}; +var PORT = {}; +var FILE = {}; +var FILE_SLASH = {}; +var FILE_HOST = {}; +var PATH_START = {}; +var PATH = {}; +var CANNOT_BE_A_BASE_URL_PATH = {}; +var QUERY = {}; +var FRAGMENT = {}; + +// eslint-disable-next-line max-statements +var parseURL = function (url, input, stateOverride, base) { + var state = stateOverride || SCHEME_START; + var pointer = 0; + var buffer = ''; + var seenAt = false; + var seenBracket = false; + var seenPasswordToken = false; + var codePoints, char, bufferCodePoints, failure; + + if (!stateOverride) { + url.scheme = ''; + url.username = ''; + url.password = ''; + url.host = null; + url.port = null; + url.path = []; + url.query = null; + url.fragment = null; + url.cannotBeABaseURL = false; + input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); + } + + input = input.replace(TAB_AND_NEW_LINE, ''); + + codePoints = arrayFrom(input); + + while (pointer <= codePoints.length) { + char = codePoints[pointer]; + switch (state) { + case SCHEME_START: + if (char && ALPHA.test(char)) { + buffer += char.toLowerCase(); + state = SCHEME; + } else if (!stateOverride) { + state = NO_SCHEME; + continue; + } else return INVALID_SCHEME; + break; + + case SCHEME: + if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) { + buffer += char.toLowerCase(); + } else if (char == ':') { + if (stateOverride && ( + (isSpecial(url) != has(specialSchemes, buffer)) || + (buffer == 'file' && (includesCredentials(url) || url.port !== null)) || + (url.scheme == 'file' && !url.host) + )) return; + url.scheme = buffer; + if (stateOverride) { + if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; + return; + } + buffer = ''; + if (url.scheme == 'file') { + state = FILE; + } else if (isSpecial(url) && base && base.scheme == url.scheme) { + state = SPECIAL_RELATIVE_OR_AUTHORITY; + } else if (isSpecial(url)) { + state = SPECIAL_AUTHORITY_SLASHES; + } else if (codePoints[pointer + 1] == '/') { + state = PATH_OR_AUTHORITY; + pointer++; + } else { + url.cannotBeABaseURL = true; + url.path.push(''); + state = CANNOT_BE_A_BASE_URL_PATH; + } + } else if (!stateOverride) { + buffer = ''; + state = NO_SCHEME; + pointer = 0; + continue; + } else return INVALID_SCHEME; + break; + + case NO_SCHEME: + if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME; + if (base.cannotBeABaseURL && char == '#') { + url.scheme = base.scheme; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + url.cannotBeABaseURL = true; + state = FRAGMENT; + break; + } + state = base.scheme == 'file' ? FILE : RELATIVE; + continue; + + case SPECIAL_RELATIVE_OR_AUTHORITY: + if (char == '/' && codePoints[pointer + 1] == '/') { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + pointer++; + } else { + state = RELATIVE; + continue; + } break; + + case PATH_OR_AUTHORITY: + if (char == '/') { + state = AUTHORITY; + break; + } else { + state = PATH; + continue; + } + + case RELATIVE: + url.scheme = base.scheme; + if (char == EOF) { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == '/' || (char == '\\' && isSpecial(url))) { + state = RELATIVE_SLASH; + } else if (char == '?') { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + state = FRAGMENT; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.path.pop(); + state = PATH; + continue; + } break; + + case RELATIVE_SLASH: + if (isSpecial(url) && (char == '/' || char == '\\')) { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + } else if (char == '/') { + state = AUTHORITY; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + state = PATH; + continue; + } break; + + case SPECIAL_AUTHORITY_SLASHES: + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + if (char != '/' || buffer.charAt(pointer + 1) != '/') continue; + pointer++; + break; + + case SPECIAL_AUTHORITY_IGNORE_SLASHES: + if (char != '/' && char != '\\') { + state = AUTHORITY; + continue; + } break; + + case AUTHORITY: + if (char == '@') { + if (seenAt) buffer = '%40' + buffer; + seenAt = true; + bufferCodePoints = arrayFrom(buffer); + for (var i = 0; i < bufferCodePoints.length; i++) { + var codePoint = bufferCodePoints[i]; + if (codePoint == ':' && !seenPasswordToken) { + seenPasswordToken = true; + continue; + } + var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); + if (seenPasswordToken) url.password += encodedCodePoints; + else url.username += encodedCodePoints; + } + buffer = ''; + } else if ( + char == EOF || char == '/' || char == '?' || char == '#' || + (char == '\\' && isSpecial(url)) + ) { + if (seenAt && buffer == '') return INVALID_AUTHORITY; + pointer -= arrayFrom(buffer).length + 1; + buffer = ''; + state = HOST; + } else buffer += char; + break; + + case HOST: + case HOSTNAME: + if (stateOverride && url.scheme == 'file') { + state = FILE_HOST; + continue; + } else if (char == ':' && !seenBracket) { + if (buffer == '') return INVALID_HOST; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ''; + state = PORT; + if (stateOverride == HOSTNAME) return; + } else if ( + char == EOF || char == '/' || char == '?' || char == '#' || + (char == '\\' && isSpecial(url)) + ) { + if (isSpecial(url) && buffer == '') return INVALID_HOST; + if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ''; + state = PATH_START; + if (stateOverride) return; + continue; + } else { + if (char == '[') seenBracket = true; + else if (char == ']') seenBracket = false; + buffer += char; + } break; + + case PORT: + if (DIGIT.test(char)) { + buffer += char; + } else if ( + char == EOF || char == '/' || char == '?' || char == '#' || + (char == '\\' && isSpecial(url)) || + stateOverride + ) { + if (buffer != '') { + var port = parseInt(buffer, 10); + if (port > 0xFFFF) return INVALID_PORT; + url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port; + buffer = ''; + } + if (stateOverride) return; + state = PATH_START; + continue; + } else return INVALID_PORT; + break; + + case FILE: + url.scheme = 'file'; + if (char == '/' || char == '\\') state = FILE_SLASH; + else if (base && base.scheme == 'file') { + if (char == EOF) { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == '?') { + url.host = base.host; + url.path = base.path.slice(); + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + state = FRAGMENT; + } else { + if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { + url.host = base.host; + url.path = base.path.slice(); + shortenURLsPath(url); + } + state = PATH; + continue; + } + } else { + state = PATH; + continue; + } break; + + case FILE_SLASH: + if (char == '/' || char == '\\') { + state = FILE_HOST; + break; + } + if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { + if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]); + else url.host = base.host; + } + state = PATH; + continue; + + case FILE_HOST: + if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') { + if (!stateOverride && isWindowsDriveLetter(buffer)) { + state = PATH; + } else if (buffer == '') { + url.host = ''; + if (stateOverride) return; + state = PATH_START; + } else { + failure = parseHost(url, buffer); + if (failure) return failure; + if (url.host == 'localhost') url.host = ''; + if (stateOverride) return; + buffer = ''; + state = PATH_START; + } continue; + } else buffer += char; + break; + + case PATH_START: + if (isSpecial(url)) { + state = PATH; + if (char != '/' && char != '\\') continue; + } else if (!stateOverride && char == '?') { + url.query = ''; + state = QUERY; + } else if (!stateOverride && char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + state = PATH; + if (char != '/') continue; + } break; + + case PATH: + if ( + char == EOF || char == '/' || + (char == '\\' && isSpecial(url)) || + (!stateOverride && (char == '?' || char == '#')) + ) { + if (isDoubleDot(buffer)) { + shortenURLsPath(url); + if (char != '/' && !(char == '\\' && isSpecial(url))) { + url.path.push(''); + } + } else if (isSingleDot(buffer)) { + if (char != '/' && !(char == '\\' && isSpecial(url))) { + url.path.push(''); + } + } else { + if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { + if (url.host) url.host = ''; + buffer = buffer.charAt(0) + ':'; // normalize windows drive letter + } + url.path.push(buffer); + } + buffer = ''; + if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) { + while (url.path.length > 1 && url.path[0] === '') { + url.path.shift(); + } + } + if (char == '?') { + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.fragment = ''; + state = FRAGMENT; + } + } else { + buffer += percentEncode(char, pathPercentEncodeSet); + } break; + + case CANNOT_BE_A_BASE_URL_PATH: + if (char == '?') { + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + url.path[0] += percentEncode(char, C0ControlPercentEncodeSet); + } break; + + case QUERY: + if (!stateOverride && char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + if (char == "'" && isSpecial(url)) url.query += '%27'; + else if (char == '#') url.query += '%23'; + else url.query += percentEncode(char, C0ControlPercentEncodeSet); + } break; + + case FRAGMENT: + if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet); + break; + } + + pointer++; + } +}; + +// `URL` constructor +// https://url.spec.whatwg.org/#url-class +var URLConstructor = function URL(url /* , base */) { + var that = anInstance(this, URLConstructor, 'URL'); + var base = arguments.length > 1 ? arguments[1] : undefined; + var urlString = String(url); + var state = setInternalState(that, { type: 'URL' }); + var baseState, failure; + if (base !== undefined) { + if (base instanceof URLConstructor) baseState = getInternalURLState(base); + else { + failure = parseURL(baseState = {}, String(base)); + if (failure) throw TypeError(failure); + } + } + failure = parseURL(state, urlString, null, baseState); + if (failure) throw TypeError(failure); + var searchParams = state.searchParams = new URLSearchParams(); + var searchParamsState = getInternalSearchParamsState(searchParams); + searchParamsState.updateSearchParams(state.query); + searchParamsState.updateURL = function () { + state.query = String(searchParams) || null; + }; + if (!DESCRIPTORS) { + that.href = serializeURL.call(that); + that.origin = getOrigin.call(that); + that.protocol = getProtocol.call(that); + that.username = getUsername.call(that); + that.password = getPassword.call(that); + that.host = getHost.call(that); + that.hostname = getHostname.call(that); + that.port = getPort.call(that); + that.pathname = getPathname.call(that); + that.search = getSearch.call(that); + that.searchParams = getSearchParams.call(that); + that.hash = getHash.call(that); + } +}; + +var URLPrototype = URLConstructor.prototype; + +var serializeURL = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var username = url.username; + var password = url.password; + var host = url.host; + var port = url.port; + var path = url.path; + var query = url.query; + var fragment = url.fragment; + var output = scheme + ':'; + if (host !== null) { + output += '//'; + if (includesCredentials(url)) { + output += username + (password ? ':' + password : '') + '@'; + } + output += serializeHost(host); + if (port !== null) output += ':' + port; + } else if (scheme == 'file') output += '//'; + output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; + if (query !== null) output += '?' + query; + if (fragment !== null) output += '#' + fragment; + return output; +}; + +var getOrigin = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var port = url.port; + if (scheme == 'blob') try { + return new URL(scheme.path[0]).origin; + } catch (error) { + return 'null'; + } + if (scheme == 'file' || !isSpecial(url)) return 'null'; + return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); +}; + +var getProtocol = function () { + return getInternalURLState(this).scheme + ':'; +}; + +var getUsername = function () { + return getInternalURLState(this).username; +}; + +var getPassword = function () { + return getInternalURLState(this).password; +}; + +var getHost = function () { + var url = getInternalURLState(this); + var host = url.host; + var port = url.port; + return host === null ? '' + : port === null ? serializeHost(host) + : serializeHost(host) + ':' + port; +}; + +var getHostname = function () { + var host = getInternalURLState(this).host; + return host === null ? '' : serializeHost(host); +}; + +var getPort = function () { + var port = getInternalURLState(this).port; + return port === null ? '' : String(port); +}; + +var getPathname = function () { + var url = getInternalURLState(this); + var path = url.path; + return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; +}; + +var getSearch = function () { + var query = getInternalURLState(this).query; + return query ? '?' + query : ''; +}; + +var getSearchParams = function () { + return getInternalURLState(this).searchParams; +}; + +var getHash = function () { + var fragment = getInternalURLState(this).fragment; + return fragment ? '#' + fragment : ''; +}; + +var accessorDescriptor = function (getter, setter) { + return { get: getter, set: setter, configurable: true, enumerable: true }; +}; + +if (DESCRIPTORS) { + defineProperties(URLPrototype, { + // `URL.prototype.href` accessors pair + // https://url.spec.whatwg.org/#dom-url-href + href: accessorDescriptor(serializeURL, function (href) { + var url = getInternalURLState(this); + var urlString = String(href); + var failure = parseURL(url, urlString); + if (failure) throw TypeError(failure); + getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); + }), + // `URL.prototype.origin` getter + // https://url.spec.whatwg.org/#dom-url-origin + origin: accessorDescriptor(getOrigin), + // `URL.prototype.protocol` accessors pair + // https://url.spec.whatwg.org/#dom-url-protocol + protocol: accessorDescriptor(getProtocol, function (protocol) { + var url = getInternalURLState(this); + parseURL(url, String(protocol) + ':', SCHEME_START); + }), + // `URL.prototype.username` accessors pair + // https://url.spec.whatwg.org/#dom-url-username + username: accessorDescriptor(getUsername, function (username) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(username)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.username = ''; + for (var i = 0; i < codePoints.length; i++) { + url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); + } + }), + // `URL.prototype.password` accessors pair + // https://url.spec.whatwg.org/#dom-url-password + password: accessorDescriptor(getPassword, function (password) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(password)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.password = ''; + for (var i = 0; i < codePoints.length; i++) { + url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); + } + }), + // `URL.prototype.host` accessors pair + // https://url.spec.whatwg.org/#dom-url-host + host: accessorDescriptor(getHost, function (host) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(host), HOST); + }), + // `URL.prototype.hostname` accessors pair + // https://url.spec.whatwg.org/#dom-url-hostname + hostname: accessorDescriptor(getHostname, function (hostname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(hostname), HOSTNAME); + }), + // `URL.prototype.port` accessors pair + // https://url.spec.whatwg.org/#dom-url-port + port: accessorDescriptor(getPort, function (port) { + var url = getInternalURLState(this); + if (cannotHaveUsernamePasswordPort(url)) return; + port = String(port); + if (port == '') url.port = null; + else parseURL(url, port, PORT); + }), + // `URL.prototype.pathname` accessors pair + // https://url.spec.whatwg.org/#dom-url-pathname + pathname: accessorDescriptor(getPathname, function (pathname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + url.path = []; + parseURL(url, pathname + '', PATH_START); + }), + // `URL.prototype.search` accessors pair + // https://url.spec.whatwg.org/#dom-url-search + search: accessorDescriptor(getSearch, function (search) { + var url = getInternalURLState(this); + search = String(search); + if (search == '') { + url.query = null; + } else { + if ('?' == search.charAt(0)) search = search.slice(1); + url.query = ''; + parseURL(url, search, QUERY); + } + getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); + }), + // `URL.prototype.searchParams` getter + // https://url.spec.whatwg.org/#dom-url-searchparams + searchParams: accessorDescriptor(getSearchParams), + // `URL.prototype.hash` accessors pair + // https://url.spec.whatwg.org/#dom-url-hash + hash: accessorDescriptor(getHash, function (hash) { + var url = getInternalURLState(this); + hash = String(hash); + if (hash == '') { + url.fragment = null; + return; + } + if ('#' == hash.charAt(0)) hash = hash.slice(1); + url.fragment = ''; + parseURL(url, hash, FRAGMENT); + }) + }); +} + +// `URL.prototype.toJSON` method +// https://url.spec.whatwg.org/#dom-url-tojson +redefine(URLPrototype, 'toJSON', function toJSON() { + return serializeURL.call(this); +}, { enumerable: true }); + +// `URL.prototype.toString` method +// https://url.spec.whatwg.org/#URL-stringification-behavior +redefine(URLPrototype, 'toString', function toString() { + return serializeURL.call(this); +}, { enumerable: true }); + +if (NativeURL) { + var nativeCreateObjectURL = NativeURL.createObjectURL; + var nativeRevokeObjectURL = NativeURL.revokeObjectURL; + // `URL.createObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL + // eslint-disable-next-line no-unused-vars + if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { + return nativeCreateObjectURL.apply(NativeURL, arguments); + }); + // `URL.revokeObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL + // eslint-disable-next-line no-unused-vars + if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { + return nativeRevokeObjectURL.apply(NativeURL, arguments); + }); +} + +setToStringTag(URLConstructor, 'URL'); + +$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { + URL: URLConstructor +}); diff --git a/core-js/modules/web.url.to-json.js b/core-js/modules/web.url.to-json.js new file mode 100644 index 0000000000..7e38169c10 --- /dev/null +++ b/core-js/modules/web.url.to-json.js @@ -0,0 +1,10 @@ +'use strict'; +var $ = require('../internals/export'); + +// `URL.prototype.toJSON` method +// https://url.spec.whatwg.org/#dom-url-tojson +$({ target: 'URL', proto: true, enumerable: true }, { + toJSON: function toJSON() { + return URL.prototype.toString.call(this); + } +}); diff --git a/core-js/package.json b/core-js/package.json new file mode 100644 index 0000000000..b6207c31b7 --- /dev/null +++ b/core-js/package.json @@ -0,0 +1,51 @@ +{ + "name": "core-js", + "description": "Standard library", + "version": "3.2.1", + "repository": { + "type": "git", + "url": "https://github.com/zloirock/core-js.git" + }, + "main": "index.js", + "license": "MIT", + "keywords": [ + "ES3", + "ES5", + "ES6", + "ES7", + "ES2015", + "ES2016", + "ES2017", + "ES2018", + "ES2019", + "ECMAScript 3", + "ECMAScript 5", + "ECMAScript 6", + "ECMAScript 7", + "ECMAScript 2015", + "ECMAScript 2016", + "ECMAScript 2017", + "ECMAScript 2018", + "ECMAScript 2019", + "Harmony", + "Strawman", + "Map", + "Set", + "WeakMap", + "WeakSet", + "Promise", + "Observable", + "Symbol", + "TypedArray", + "URL", + "URLSearchParams", + "queueMicrotask", + "setImmediate", + "polyfill", + "ponyfill", + "shim" + ], + "scripts": { + "postinstall": "node scripts/postinstall || echo \"ignore\"" + } +} diff --git a/core-js/proposals/array-is-template-object.js b/core-js/proposals/array-is-template-object.js new file mode 100644 index 0000000000..37388c4d28 --- /dev/null +++ b/core-js/proposals/array-is-template-object.js @@ -0,0 +1 @@ +require('../modules/esnext.array.is-template-object'); diff --git a/core-js/proposals/array-last.js b/core-js/proposals/array-last.js new file mode 100644 index 0000000000..c6710312b5 --- /dev/null +++ b/core-js/proposals/array-last.js @@ -0,0 +1,2 @@ +require('../modules/esnext.array.last-index'); +require('../modules/esnext.array.last-item'); diff --git a/core-js/proposals/collection-methods.js b/core-js/proposals/collection-methods.js new file mode 100644 index 0000000000..3acb8c08e8 --- /dev/null +++ b/core-js/proposals/collection-methods.js @@ -0,0 +1,27 @@ +require('../modules/esnext.map.group-by'); +require('../modules/esnext.map.key-by'); +require('../modules/esnext.map.delete-all'); +require('../modules/esnext.map.every'); +require('../modules/esnext.map.filter'); +require('../modules/esnext.map.find'); +require('../modules/esnext.map.find-key'); +require('../modules/esnext.map.includes'); +require('../modules/esnext.map.key-of'); +require('../modules/esnext.map.map-keys'); +require('../modules/esnext.map.map-values'); +require('../modules/esnext.map.merge'); +require('../modules/esnext.map.reduce'); +require('../modules/esnext.map.some'); +require('../modules/esnext.map.update'); +require('../modules/esnext.set.add-all'); +require('../modules/esnext.set.delete-all'); +require('../modules/esnext.set.every'); +require('../modules/esnext.set.filter'); +require('../modules/esnext.set.find'); +require('../modules/esnext.set.join'); +require('../modules/esnext.set.map'); +require('../modules/esnext.set.reduce'); +require('../modules/esnext.set.some'); +require('../modules/esnext.weak-map.delete-all'); +require('../modules/esnext.weak-set.add-all'); +require('../modules/esnext.weak-set.delete-all'); diff --git a/core-js/proposals/collection-of-from.js b/core-js/proposals/collection-of-from.js new file mode 100644 index 0000000000..ade30003e6 --- /dev/null +++ b/core-js/proposals/collection-of-from.js @@ -0,0 +1,8 @@ +require('../modules/esnext.map.from'); +require('../modules/esnext.map.of'); +require('../modules/esnext.set.from'); +require('../modules/esnext.set.of'); +require('../modules/esnext.weak-map.from'); +require('../modules/esnext.weak-map.of'); +require('../modules/esnext.weak-set.from'); +require('../modules/esnext.weak-set.of'); diff --git a/core-js/proposals/efficient-64-bit-arithmetic.js b/core-js/proposals/efficient-64-bit-arithmetic.js new file mode 100644 index 0000000000..71d40dcb60 --- /dev/null +++ b/core-js/proposals/efficient-64-bit-arithmetic.js @@ -0,0 +1,4 @@ +require('../modules/esnext.math.iaddh'); +require('../modules/esnext.math.isubh'); +require('../modules/esnext.math.imulh'); +require('../modules/esnext.math.umulh'); diff --git a/core-js/proposals/global-this.js b/core-js/proposals/global-this.js new file mode 100644 index 0000000000..f056723c42 --- /dev/null +++ b/core-js/proposals/global-this.js @@ -0,0 +1,3 @@ +require('../modules/esnext.global-this'); + +module.exports = require('../internals/global'); diff --git a/core-js/proposals/index.js b/core-js/proposals/index.js new file mode 100644 index 0000000000..b87a749070 --- /dev/null +++ b/core-js/proposals/index.js @@ -0,0 +1 @@ +require('../stage'); diff --git a/core-js/proposals/keys-composition.js b/core-js/proposals/keys-composition.js new file mode 100644 index 0000000000..47f5e2ed82 --- /dev/null +++ b/core-js/proposals/keys-composition.js @@ -0,0 +1,2 @@ +require('../modules/esnext.composite-key'); +require('../modules/esnext.composite-symbol'); diff --git a/core-js/proposals/map-update-or-insert.js b/core-js/proposals/map-update-or-insert.js new file mode 100644 index 0000000000..0438870dbd --- /dev/null +++ b/core-js/proposals/map-update-or-insert.js @@ -0,0 +1 @@ +require('../modules/esnext.map.update-or-insert'); diff --git a/core-js/proposals/math-extensions.js b/core-js/proposals/math-extensions.js new file mode 100644 index 0000000000..80d86af3fd --- /dev/null +++ b/core-js/proposals/math-extensions.js @@ -0,0 +1,7 @@ +require('../modules/esnext.math.clamp'); +require('../modules/esnext.math.deg-per-rad'); +require('../modules/esnext.math.degrees'); +require('../modules/esnext.math.fscale'); +require('../modules/esnext.math.rad-per-deg'); +require('../modules/esnext.math.radians'); +require('../modules/esnext.math.scale'); diff --git a/core-js/proposals/math-signbit.js b/core-js/proposals/math-signbit.js new file mode 100644 index 0000000000..e0a51d176a --- /dev/null +++ b/core-js/proposals/math-signbit.js @@ -0,0 +1 @@ +require('../modules/esnext.math.signbit'); diff --git a/core-js/proposals/number-from-string.js b/core-js/proposals/number-from-string.js new file mode 100644 index 0000000000..094d084202 --- /dev/null +++ b/core-js/proposals/number-from-string.js @@ -0,0 +1 @@ +require('../modules/esnext.number.from-string'); diff --git a/core-js/proposals/observable.js b/core-js/proposals/observable.js new file mode 100644 index 0000000000..cf591564d2 --- /dev/null +++ b/core-js/proposals/observable.js @@ -0,0 +1,2 @@ +require('../modules/esnext.observable'); +require('../modules/esnext.symbol.observable'); diff --git a/core-js/proposals/pattern-matching.js b/core-js/proposals/pattern-matching.js new file mode 100644 index 0000000000..d5fce70789 --- /dev/null +++ b/core-js/proposals/pattern-matching.js @@ -0,0 +1 @@ +require('../modules/esnext.symbol.pattern-match'); diff --git a/core-js/proposals/promise-all-settled.js b/core-js/proposals/promise-all-settled.js new file mode 100644 index 0000000000..ae35910d68 --- /dev/null +++ b/core-js/proposals/promise-all-settled.js @@ -0,0 +1,2 @@ +// TODO: Remove from `core-js@4` +require('../modules/esnext.promise.all-settled'); diff --git a/core-js/proposals/promise-any.js b/core-js/proposals/promise-any.js new file mode 100644 index 0000000000..9e147363a5 --- /dev/null +++ b/core-js/proposals/promise-any.js @@ -0,0 +1,2 @@ +require('../modules/esnext.aggregate-error'); +require('../modules/esnext.promise.any'); diff --git a/core-js/proposals/promise-try.js b/core-js/proposals/promise-try.js new file mode 100644 index 0000000000..ce5aca5f00 --- /dev/null +++ b/core-js/proposals/promise-try.js @@ -0,0 +1 @@ +require('../modules/esnext.promise.try'); diff --git a/core-js/proposals/reflect-metadata.js b/core-js/proposals/reflect-metadata.js new file mode 100644 index 0000000000..512b1f2521 --- /dev/null +++ b/core-js/proposals/reflect-metadata.js @@ -0,0 +1,9 @@ +require('../modules/esnext.reflect.define-metadata'); +require('../modules/esnext.reflect.delete-metadata'); +require('../modules/esnext.reflect.get-metadata'); +require('../modules/esnext.reflect.get-metadata-keys'); +require('../modules/esnext.reflect.get-own-metadata'); +require('../modules/esnext.reflect.get-own-metadata-keys'); +require('../modules/esnext.reflect.has-metadata'); +require('../modules/esnext.reflect.has-own-metadata'); +require('../modules/esnext.reflect.metadata'); diff --git a/core-js/proposals/seeded-random.js b/core-js/proposals/seeded-random.js new file mode 100644 index 0000000000..5bbd9049eb --- /dev/null +++ b/core-js/proposals/seeded-random.js @@ -0,0 +1 @@ +require('../modules/esnext.math.seeded-prng'); diff --git a/core-js/proposals/set-methods.js b/core-js/proposals/set-methods.js new file mode 100644 index 0000000000..810546093c --- /dev/null +++ b/core-js/proposals/set-methods.js @@ -0,0 +1,7 @@ +require('../modules/esnext.set.difference'); +require('../modules/esnext.set.intersection'); +require('../modules/esnext.set.is-disjoint-from'); +require('../modules/esnext.set.is-subset-of'); +require('../modules/esnext.set.is-superset-of'); +require('../modules/esnext.set.union'); +require('../modules/esnext.set.symmetric-difference'); diff --git a/core-js/proposals/string-at.js b/core-js/proposals/string-at.js new file mode 100644 index 0000000000..e992e58d48 --- /dev/null +++ b/core-js/proposals/string-at.js @@ -0,0 +1 @@ +require('../modules/esnext.string.at'); diff --git a/core-js/proposals/string-code-points.js b/core-js/proposals/string-code-points.js new file mode 100644 index 0000000000..3717523ee5 --- /dev/null +++ b/core-js/proposals/string-code-points.js @@ -0,0 +1 @@ +require('../modules/esnext.string.code-points'); diff --git a/core-js/proposals/string-match-all.js b/core-js/proposals/string-match-all.js new file mode 100644 index 0000000000..be5ba60e02 --- /dev/null +++ b/core-js/proposals/string-match-all.js @@ -0,0 +1,2 @@ +// TODO: Remove from `core-js@4` +require('../modules/esnext.string.match-all'); diff --git a/core-js/proposals/string-replace-all.js b/core-js/proposals/string-replace-all.js new file mode 100644 index 0000000000..c36697d722 --- /dev/null +++ b/core-js/proposals/string-replace-all.js @@ -0,0 +1,2 @@ +require('../modules/esnext.string.replace-all'); +require('../modules/esnext.symbol.replace-all'); diff --git a/core-js/proposals/url.js b/core-js/proposals/url.js new file mode 100644 index 0000000000..151dfab9f1 --- /dev/null +++ b/core-js/proposals/url.js @@ -0,0 +1,3 @@ +require('../modules/web.url'); +require('../modules/web.url.to-json'); +require('../modules/web.url-search-params'); diff --git a/core-js/proposals/using-statement.js b/core-js/proposals/using-statement.js new file mode 100644 index 0000000000..2ac3df7fc2 --- /dev/null +++ b/core-js/proposals/using-statement.js @@ -0,0 +1,3 @@ +// https://github.com/tc39/proposal-using-statement +require('../modules/esnext.symbol.async-dispose'); +require('../modules/esnext.symbol.dispose'); diff --git a/core-js/scripts/postinstall.js b/core-js/scripts/postinstall.js new file mode 100644 index 0000000000..4f3d3d7b0e --- /dev/null +++ b/core-js/scripts/postinstall.js @@ -0,0 +1,24 @@ +/* eslint-disable max-len */ +var env = process.env; +var ADBLOCK = is(env.ADBLOCK); +var CI = is(env.CI); +var COLOR = is(env.npm_config_color); +var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE); +var SILENT = !!~['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel); + +function is(it) { + return !!it && it !== '0' && it !== 'false'; +} + +function log(it) { + // eslint-disable-next-line no-console,no-control-regex + console.log(COLOR ? it : it.replace(/\u001B\[\d+m/g, '')); +} + +if (!ADBLOCK && !CI && !DISABLE_OPENCOLLECTIVE && !SILENT) { + log('\u001B[96mThank you for using core-js (\u001B[94m https://github.com/zloirock/core-js \u001B[96m) for polyfilling JavaScript standard library!\u001B[0m\n'); + log('\u001B[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: \u001B[0m'); + log('\u001B[96m>\u001B[94m https://opencollective.com/core-js \u001B[0m'); + log('\u001B[96m>\u001B[94m https://www.patreon.com/zloirock \u001B[0m\n'); + log('\u001B[96mAlso, the author of core-js (\u001B[94m https://github.com/zloirock \u001B[96m) is looking for a good job -)\u001B[0m\n'); +} diff --git a/core-js/stable/README.md b/core-js/stable/README.md new file mode 100644 index 0000000000..903150c44e --- /dev/null +++ b/core-js/stable/README.md @@ -0,0 +1 @@ +This folder contains entry points for all stable `core-js` features with dependencies. It's the recommended way for usage only required features. diff --git a/core-js/stable/array-buffer/constructor.js b/core-js/stable/array-buffer/constructor.js new file mode 100644 index 0000000000..726f87038f --- /dev/null +++ b/core-js/stable/array-buffer/constructor.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer/constructor'); diff --git a/core-js/stable/array-buffer/index.js b/core-js/stable/array-buffer/index.js new file mode 100644 index 0000000000..80b721e901 --- /dev/null +++ b/core-js/stable/array-buffer/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer'); diff --git a/core-js/stable/array-buffer/is-view.js b/core-js/stable/array-buffer/is-view.js new file mode 100644 index 0000000000..7fe0ee7702 --- /dev/null +++ b/core-js/stable/array-buffer/is-view.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer/is-view'); diff --git a/core-js/stable/array-buffer/slice.js b/core-js/stable/array-buffer/slice.js new file mode 100644 index 0000000000..237d3b4d68 --- /dev/null +++ b/core-js/stable/array-buffer/slice.js @@ -0,0 +1 @@ +module.exports = require('../../es/array-buffer/slice'); diff --git a/core-js/stable/array/concat.js b/core-js/stable/array/concat.js new file mode 100644 index 0000000000..09185fea44 --- /dev/null +++ b/core-js/stable/array/concat.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/concat'); diff --git a/core-js/stable/array/copy-within.js b/core-js/stable/array/copy-within.js new file mode 100644 index 0000000000..171ea9bab9 --- /dev/null +++ b/core-js/stable/array/copy-within.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/copy-within'); diff --git a/core-js/stable/array/entries.js b/core-js/stable/array/entries.js new file mode 100644 index 0000000000..21631f91fa --- /dev/null +++ b/core-js/stable/array/entries.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/entries'); diff --git a/core-js/stable/array/every.js b/core-js/stable/array/every.js new file mode 100644 index 0000000000..e04ec0d264 --- /dev/null +++ b/core-js/stable/array/every.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/every'); diff --git a/core-js/stable/array/fill.js b/core-js/stable/array/fill.js new file mode 100644 index 0000000000..8d43319836 --- /dev/null +++ b/core-js/stable/array/fill.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/fill'); diff --git a/core-js/stable/array/filter.js b/core-js/stable/array/filter.js new file mode 100644 index 0000000000..5fedc7343e --- /dev/null +++ b/core-js/stable/array/filter.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/filter'); diff --git a/core-js/stable/array/find-index.js b/core-js/stable/array/find-index.js new file mode 100644 index 0000000000..0f687ead10 --- /dev/null +++ b/core-js/stable/array/find-index.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/find-index'); diff --git a/core-js/stable/array/find.js b/core-js/stable/array/find.js new file mode 100644 index 0000000000..2fc2611777 --- /dev/null +++ b/core-js/stable/array/find.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/find'); diff --git a/core-js/stable/array/flat-map.js b/core-js/stable/array/flat-map.js new file mode 100644 index 0000000000..87a5555503 --- /dev/null +++ b/core-js/stable/array/flat-map.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/flat-map'); diff --git a/core-js/stable/array/flat.js b/core-js/stable/array/flat.js new file mode 100644 index 0000000000..7b32eb70e9 --- /dev/null +++ b/core-js/stable/array/flat.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/flat'); diff --git a/core-js/stable/array/for-each.js b/core-js/stable/array/for-each.js new file mode 100644 index 0000000000..df36b3b7e1 --- /dev/null +++ b/core-js/stable/array/for-each.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/for-each'); diff --git a/core-js/stable/array/from.js b/core-js/stable/array/from.js new file mode 100644 index 0000000000..483cff183b --- /dev/null +++ b/core-js/stable/array/from.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/from'); diff --git a/core-js/stable/array/includes.js b/core-js/stable/array/includes.js new file mode 100644 index 0000000000..64cc5866ba --- /dev/null +++ b/core-js/stable/array/includes.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/includes'); diff --git a/core-js/stable/array/index-of.js b/core-js/stable/array/index-of.js new file mode 100644 index 0000000000..42f3d838cd --- /dev/null +++ b/core-js/stable/array/index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/index-of'); diff --git a/core-js/stable/array/index.js b/core-js/stable/array/index.js new file mode 100644 index 0000000000..7d2a31e2bb --- /dev/null +++ b/core-js/stable/array/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/array'); diff --git a/core-js/stable/array/is-array.js b/core-js/stable/array/is-array.js new file mode 100644 index 0000000000..12bd214b70 --- /dev/null +++ b/core-js/stable/array/is-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/is-array'); diff --git a/core-js/stable/array/iterator.js b/core-js/stable/array/iterator.js new file mode 100644 index 0000000000..774d23555f --- /dev/null +++ b/core-js/stable/array/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/iterator'); diff --git a/core-js/stable/array/join.js b/core-js/stable/array/join.js new file mode 100644 index 0000000000..4390ed3baa --- /dev/null +++ b/core-js/stable/array/join.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/join'); diff --git a/core-js/stable/array/keys.js b/core-js/stable/array/keys.js new file mode 100644 index 0000000000..241f21ae6c --- /dev/null +++ b/core-js/stable/array/keys.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/keys'); diff --git a/core-js/stable/array/last-index-of.js b/core-js/stable/array/last-index-of.js new file mode 100644 index 0000000000..0eca23c915 --- /dev/null +++ b/core-js/stable/array/last-index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/last-index-of'); diff --git a/core-js/stable/array/map.js b/core-js/stable/array/map.js new file mode 100644 index 0000000000..d3cea88bc0 --- /dev/null +++ b/core-js/stable/array/map.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/map'); diff --git a/core-js/stable/array/of.js b/core-js/stable/array/of.js new file mode 100644 index 0000000000..0e69d5becf --- /dev/null +++ b/core-js/stable/array/of.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/of'); diff --git a/core-js/stable/array/reduce-right.js b/core-js/stable/array/reduce-right.js new file mode 100644 index 0000000000..72e0f58ba5 --- /dev/null +++ b/core-js/stable/array/reduce-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/reduce-right'); diff --git a/core-js/stable/array/reduce.js b/core-js/stable/array/reduce.js new file mode 100644 index 0000000000..c688c9fdea --- /dev/null +++ b/core-js/stable/array/reduce.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/reduce'); diff --git a/core-js/stable/array/reverse.js b/core-js/stable/array/reverse.js new file mode 100644 index 0000000000..65a1d7a830 --- /dev/null +++ b/core-js/stable/array/reverse.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/reverse'); diff --git a/core-js/stable/array/slice.js b/core-js/stable/array/slice.js new file mode 100644 index 0000000000..67345b2d88 --- /dev/null +++ b/core-js/stable/array/slice.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/slice'); diff --git a/core-js/stable/array/some.js b/core-js/stable/array/some.js new file mode 100644 index 0000000000..ce62873e9b --- /dev/null +++ b/core-js/stable/array/some.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/some'); diff --git a/core-js/stable/array/sort.js b/core-js/stable/array/sort.js new file mode 100644 index 0000000000..4a58b24490 --- /dev/null +++ b/core-js/stable/array/sort.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/sort'); diff --git a/core-js/stable/array/splice.js b/core-js/stable/array/splice.js new file mode 100644 index 0000000000..898b964a36 --- /dev/null +++ b/core-js/stable/array/splice.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/splice'); diff --git a/core-js/stable/array/values.js b/core-js/stable/array/values.js new file mode 100644 index 0000000000..6e8956c4b1 --- /dev/null +++ b/core-js/stable/array/values.js @@ -0,0 +1 @@ +module.exports = require('../../es/array/values'); diff --git a/core-js/stable/array/virtual/concat.js b/core-js/stable/array/virtual/concat.js new file mode 100644 index 0000000000..e4aad47ecf --- /dev/null +++ b/core-js/stable/array/virtual/concat.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/concat'); diff --git a/core-js/stable/array/virtual/copy-within.js b/core-js/stable/array/virtual/copy-within.js new file mode 100644 index 0000000000..3bb56c0d99 --- /dev/null +++ b/core-js/stable/array/virtual/copy-within.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/copy-within'); diff --git a/core-js/stable/array/virtual/entries.js b/core-js/stable/array/virtual/entries.js new file mode 100644 index 0000000000..561c358c17 --- /dev/null +++ b/core-js/stable/array/virtual/entries.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/entries'); diff --git a/core-js/stable/array/virtual/every.js b/core-js/stable/array/virtual/every.js new file mode 100644 index 0000000000..9b22ec88d9 --- /dev/null +++ b/core-js/stable/array/virtual/every.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/every'); diff --git a/core-js/stable/array/virtual/fill.js b/core-js/stable/array/virtual/fill.js new file mode 100644 index 0000000000..2a2ae7628b --- /dev/null +++ b/core-js/stable/array/virtual/fill.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/fill'); diff --git a/core-js/stable/array/virtual/filter.js b/core-js/stable/array/virtual/filter.js new file mode 100644 index 0000000000..bc98bd19c5 --- /dev/null +++ b/core-js/stable/array/virtual/filter.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/filter'); diff --git a/core-js/stable/array/virtual/find-index.js b/core-js/stable/array/virtual/find-index.js new file mode 100644 index 0000000000..dc352bd974 --- /dev/null +++ b/core-js/stable/array/virtual/find-index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/find-index'); diff --git a/core-js/stable/array/virtual/find.js b/core-js/stable/array/virtual/find.js new file mode 100644 index 0000000000..54ebe1d788 --- /dev/null +++ b/core-js/stable/array/virtual/find.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/find'); diff --git a/core-js/stable/array/virtual/flat-map.js b/core-js/stable/array/virtual/flat-map.js new file mode 100644 index 0000000000..08c9be00b3 --- /dev/null +++ b/core-js/stable/array/virtual/flat-map.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/flat-map'); diff --git a/core-js/stable/array/virtual/flat.js b/core-js/stable/array/virtual/flat.js new file mode 100644 index 0000000000..c53d93f4b5 --- /dev/null +++ b/core-js/stable/array/virtual/flat.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/flat'); diff --git a/core-js/stable/array/virtual/for-each.js b/core-js/stable/array/virtual/for-each.js new file mode 100644 index 0000000000..9b3880f299 --- /dev/null +++ b/core-js/stable/array/virtual/for-each.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/for-each'); diff --git a/core-js/stable/array/virtual/includes.js b/core-js/stable/array/virtual/includes.js new file mode 100644 index 0000000000..e5623fc7a1 --- /dev/null +++ b/core-js/stable/array/virtual/includes.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/includes'); diff --git a/core-js/stable/array/virtual/index-of.js b/core-js/stable/array/virtual/index-of.js new file mode 100644 index 0000000000..e819d9b18e --- /dev/null +++ b/core-js/stable/array/virtual/index-of.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/index-of'); diff --git a/core-js/stable/array/virtual/index.js b/core-js/stable/array/virtual/index.js new file mode 100644 index 0000000000..e6bff15e76 --- /dev/null +++ b/core-js/stable/array/virtual/index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual'); diff --git a/core-js/stable/array/virtual/iterator.js b/core-js/stable/array/virtual/iterator.js new file mode 100644 index 0000000000..f99a1a05a3 --- /dev/null +++ b/core-js/stable/array/virtual/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/iterator'); diff --git a/core-js/stable/array/virtual/join.js b/core-js/stable/array/virtual/join.js new file mode 100644 index 0000000000..0fb295ed63 --- /dev/null +++ b/core-js/stable/array/virtual/join.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/join'); diff --git a/core-js/stable/array/virtual/keys.js b/core-js/stable/array/virtual/keys.js new file mode 100644 index 0000000000..efc2d88b10 --- /dev/null +++ b/core-js/stable/array/virtual/keys.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/keys'); diff --git a/core-js/stable/array/virtual/last-index-of.js b/core-js/stable/array/virtual/last-index-of.js new file mode 100644 index 0000000000..cc4ba59778 --- /dev/null +++ b/core-js/stable/array/virtual/last-index-of.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/last-index-of'); diff --git a/core-js/stable/array/virtual/map.js b/core-js/stable/array/virtual/map.js new file mode 100644 index 0000000000..bdd7e52335 --- /dev/null +++ b/core-js/stable/array/virtual/map.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/map'); diff --git a/core-js/stable/array/virtual/reduce-right.js b/core-js/stable/array/virtual/reduce-right.js new file mode 100644 index 0000000000..e00d5391a7 --- /dev/null +++ b/core-js/stable/array/virtual/reduce-right.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/reduce-right'); diff --git a/core-js/stable/array/virtual/reduce.js b/core-js/stable/array/virtual/reduce.js new file mode 100644 index 0000000000..47a30bac4e --- /dev/null +++ b/core-js/stable/array/virtual/reduce.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/reduce'); diff --git a/core-js/stable/array/virtual/reverse.js b/core-js/stable/array/virtual/reverse.js new file mode 100644 index 0000000000..780cd09b78 --- /dev/null +++ b/core-js/stable/array/virtual/reverse.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/reverse'); diff --git a/core-js/stable/array/virtual/slice.js b/core-js/stable/array/virtual/slice.js new file mode 100644 index 0000000000..4d65726f58 --- /dev/null +++ b/core-js/stable/array/virtual/slice.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/slice'); diff --git a/core-js/stable/array/virtual/some.js b/core-js/stable/array/virtual/some.js new file mode 100644 index 0000000000..cb86d9e373 --- /dev/null +++ b/core-js/stable/array/virtual/some.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/some'); diff --git a/core-js/stable/array/virtual/sort.js b/core-js/stable/array/virtual/sort.js new file mode 100644 index 0000000000..5008b036b7 --- /dev/null +++ b/core-js/stable/array/virtual/sort.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/sort'); diff --git a/core-js/stable/array/virtual/splice.js b/core-js/stable/array/virtual/splice.js new file mode 100644 index 0000000000..feace09451 --- /dev/null +++ b/core-js/stable/array/virtual/splice.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/splice'); diff --git a/core-js/stable/array/virtual/values.js b/core-js/stable/array/virtual/values.js new file mode 100644 index 0000000000..7aa326fb0a --- /dev/null +++ b/core-js/stable/array/virtual/values.js @@ -0,0 +1 @@ +module.exports = require('../../../es/array/virtual/values'); diff --git a/core-js/stable/clear-immediate.js b/core-js/stable/clear-immediate.js new file mode 100644 index 0000000000..b5a6d4ae12 --- /dev/null +++ b/core-js/stable/clear-immediate.js @@ -0,0 +1,3 @@ +require('../modules/web.immediate'); + +module.exports = require('../internals/path').clearImmediate; diff --git a/core-js/stable/data-view/index.js b/core-js/stable/data-view/index.js new file mode 100644 index 0000000000..7a754971ca --- /dev/null +++ b/core-js/stable/data-view/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/data-view'); diff --git a/core-js/stable/date/index.js b/core-js/stable/date/index.js new file mode 100644 index 0000000000..5ff65b85b2 --- /dev/null +++ b/core-js/stable/date/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/date'); diff --git a/core-js/stable/date/now.js b/core-js/stable/date/now.js new file mode 100644 index 0000000000..e196b5f3ca --- /dev/null +++ b/core-js/stable/date/now.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/now'); diff --git a/core-js/stable/date/to-iso-string.js b/core-js/stable/date/to-iso-string.js new file mode 100644 index 0000000000..c9348195f5 --- /dev/null +++ b/core-js/stable/date/to-iso-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-iso-string'); diff --git a/core-js/stable/date/to-json.js b/core-js/stable/date/to-json.js new file mode 100644 index 0000000000..9966af465b --- /dev/null +++ b/core-js/stable/date/to-json.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-json'); diff --git a/core-js/stable/date/to-primitive.js b/core-js/stable/date/to-primitive.js new file mode 100644 index 0000000000..f9f11e47cb --- /dev/null +++ b/core-js/stable/date/to-primitive.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-primitive'); diff --git a/core-js/stable/date/to-string.js b/core-js/stable/date/to-string.js new file mode 100644 index 0000000000..055f26c439 --- /dev/null +++ b/core-js/stable/date/to-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/date/to-string'); diff --git a/core-js/stable/dom-collections/for-each.js b/core-js/stable/dom-collections/for-each.js new file mode 100644 index 0000000000..c251fedf31 --- /dev/null +++ b/core-js/stable/dom-collections/for-each.js @@ -0,0 +1,3 @@ +require('../../modules/web.dom-collections.for-each'); + +module.exports = require('../../internals/array-for-each'); diff --git a/core-js/stable/dom-collections/index.js b/core-js/stable/dom-collections/index.js new file mode 100644 index 0000000000..7d262cb636 --- /dev/null +++ b/core-js/stable/dom-collections/index.js @@ -0,0 +1,12 @@ +require('../../modules/web.dom-collections.for-each'); +require('../../modules/web.dom-collections.iterator'); +var ArrayIterators = require('../../modules/es.array.iterator'); +var forEach = require('../../internals/array-for-each'); + +module.exports = { + keys: ArrayIterators.keys, + values: ArrayIterators.values, + entries: ArrayIterators.entries, + iterator: ArrayIterators.values, + forEach: forEach +}; diff --git a/core-js/stable/dom-collections/iterator.js b/core-js/stable/dom-collections/iterator.js new file mode 100644 index 0000000000..3bc1e900e8 --- /dev/null +++ b/core-js/stable/dom-collections/iterator.js @@ -0,0 +1,4 @@ +require('../../modules/web.dom-collections.iterator'); +var entryUnbind = require('../../internals/entry-unbind'); + +module.exports = entryUnbind('Array', 'values'); diff --git a/core-js/stable/function/bind.js b/core-js/stable/function/bind.js new file mode 100644 index 0000000000..108a677315 --- /dev/null +++ b/core-js/stable/function/bind.js @@ -0,0 +1 @@ +module.exports = require('../../es/function/bind'); diff --git a/core-js/stable/function/has-instance.js b/core-js/stable/function/has-instance.js new file mode 100644 index 0000000000..eac5999193 --- /dev/null +++ b/core-js/stable/function/has-instance.js @@ -0,0 +1 @@ +module.exports = require('../../es/function/has-instance'); diff --git a/core-js/stable/function/index.js b/core-js/stable/function/index.js new file mode 100644 index 0000000000..3bed0f56b7 --- /dev/null +++ b/core-js/stable/function/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/function'); diff --git a/core-js/stable/function/name.js b/core-js/stable/function/name.js new file mode 100644 index 0000000000..b4fe6766cc --- /dev/null +++ b/core-js/stable/function/name.js @@ -0,0 +1 @@ +module.exports = require('../../es/function/name'); diff --git a/core-js/stable/function/virtual/bind.js b/core-js/stable/function/virtual/bind.js new file mode 100644 index 0000000000..2820ffb11d --- /dev/null +++ b/core-js/stable/function/virtual/bind.js @@ -0,0 +1 @@ +module.exports = require('../../../es/function/virtual/bind'); diff --git a/core-js/stable/function/virtual/index.js b/core-js/stable/function/virtual/index.js new file mode 100644 index 0000000000..3234d9d071 --- /dev/null +++ b/core-js/stable/function/virtual/index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/function/virtual'); diff --git a/core-js/stable/global-this.js b/core-js/stable/global-this.js new file mode 100644 index 0000000000..b6c15b3930 --- /dev/null +++ b/core-js/stable/global-this.js @@ -0,0 +1,3 @@ +require('../modules/esnext.global-this'); + +module.exports = require('../internals/path').globalThis; diff --git a/core-js/stable/index.js b/core-js/stable/index.js new file mode 100644 index 0000000000..39527b41bf --- /dev/null +++ b/core-js/stable/index.js @@ -0,0 +1,4 @@ +require('../es'); +require('../web'); + +module.exports = require('../internals/path'); diff --git a/core-js/stable/instance/bind.js b/core-js/stable/instance/bind.js new file mode 100644 index 0000000000..7f168092f6 --- /dev/null +++ b/core-js/stable/instance/bind.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/bind'); diff --git a/core-js/stable/instance/code-point-at.js b/core-js/stable/instance/code-point-at.js new file mode 100644 index 0000000000..f353ea3e83 --- /dev/null +++ b/core-js/stable/instance/code-point-at.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/code-point-at'); diff --git a/core-js/stable/instance/concat.js b/core-js/stable/instance/concat.js new file mode 100644 index 0000000000..1387932eba --- /dev/null +++ b/core-js/stable/instance/concat.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/concat'); diff --git a/core-js/stable/instance/copy-within.js b/core-js/stable/instance/copy-within.js new file mode 100644 index 0000000000..15e9d29ca2 --- /dev/null +++ b/core-js/stable/instance/copy-within.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/copy-within'); diff --git a/core-js/stable/instance/ends-with.js b/core-js/stable/instance/ends-with.js new file mode 100644 index 0000000000..72a0380408 --- /dev/null +++ b/core-js/stable/instance/ends-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/ends-with'); diff --git a/core-js/stable/instance/entries.js b/core-js/stable/instance/entries.js new file mode 100644 index 0000000000..080b814354 --- /dev/null +++ b/core-js/stable/instance/entries.js @@ -0,0 +1,16 @@ +require('../../modules/web.dom-collections.iterator'); +var entries = require('../array/virtual/entries'); +var classof = require('../../internals/classof'); +var ArrayPrototype = Array.prototype; + +var DOMIterables = { + DOMTokenList: true, + NodeList: true +}; + +module.exports = function (it) { + var own = it.entries; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.entries) + // eslint-disable-next-line no-prototype-builtins + || DOMIterables.hasOwnProperty(classof(it)) ? entries : own; +}; diff --git a/core-js/stable/instance/every.js b/core-js/stable/instance/every.js new file mode 100644 index 0000000000..9b285d51ae --- /dev/null +++ b/core-js/stable/instance/every.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/every'); diff --git a/core-js/stable/instance/fill.js b/core-js/stable/instance/fill.js new file mode 100644 index 0000000000..884763c3c8 --- /dev/null +++ b/core-js/stable/instance/fill.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/fill'); diff --git a/core-js/stable/instance/filter.js b/core-js/stable/instance/filter.js new file mode 100644 index 0000000000..94b2339649 --- /dev/null +++ b/core-js/stable/instance/filter.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/filter'); diff --git a/core-js/stable/instance/find-index.js b/core-js/stable/instance/find-index.js new file mode 100644 index 0000000000..79e4118375 --- /dev/null +++ b/core-js/stable/instance/find-index.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/find-index'); diff --git a/core-js/stable/instance/find.js b/core-js/stable/instance/find.js new file mode 100644 index 0000000000..9edd5736ea --- /dev/null +++ b/core-js/stable/instance/find.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/find'); diff --git a/core-js/stable/instance/flags.js b/core-js/stable/instance/flags.js new file mode 100644 index 0000000000..e3bfaa720c --- /dev/null +++ b/core-js/stable/instance/flags.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/flags'); diff --git a/core-js/stable/instance/flat-map.js b/core-js/stable/instance/flat-map.js new file mode 100644 index 0000000000..a98bebd71e --- /dev/null +++ b/core-js/stable/instance/flat-map.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/flat-map'); diff --git a/core-js/stable/instance/flat.js b/core-js/stable/instance/flat.js new file mode 100644 index 0000000000..bc46540952 --- /dev/null +++ b/core-js/stable/instance/flat.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/flat'); diff --git a/core-js/stable/instance/for-each.js b/core-js/stable/instance/for-each.js new file mode 100644 index 0000000000..1254e9f041 --- /dev/null +++ b/core-js/stable/instance/for-each.js @@ -0,0 +1,16 @@ +require('../../modules/web.dom-collections.iterator'); +var forEach = require('../array/virtual/for-each'); +var classof = require('../../internals/classof'); +var ArrayPrototype = Array.prototype; + +var DOMIterables = { + DOMTokenList: true, + NodeList: true +}; + +module.exports = function (it) { + var own = it.forEach; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach) + // eslint-disable-next-line no-prototype-builtins + || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own; +}; diff --git a/core-js/stable/instance/includes.js b/core-js/stable/instance/includes.js new file mode 100644 index 0000000000..6d13532177 --- /dev/null +++ b/core-js/stable/instance/includes.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/includes'); diff --git a/core-js/stable/instance/index-of.js b/core-js/stable/instance/index-of.js new file mode 100644 index 0000000000..8700e0e2c0 --- /dev/null +++ b/core-js/stable/instance/index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/index-of'); diff --git a/core-js/stable/instance/keys.js b/core-js/stable/instance/keys.js new file mode 100644 index 0000000000..b83acb7810 --- /dev/null +++ b/core-js/stable/instance/keys.js @@ -0,0 +1,16 @@ +require('../../modules/web.dom-collections.iterator'); +var keys = require('../array/virtual/keys'); +var classof = require('../../internals/classof'); +var ArrayPrototype = Array.prototype; + +var DOMIterables = { + DOMTokenList: true, + NodeList: true +}; + +module.exports = function (it) { + var own = it.keys; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.keys) + // eslint-disable-next-line no-prototype-builtins + || DOMIterables.hasOwnProperty(classof(it)) ? keys : own; +}; diff --git a/core-js/stable/instance/last-index-of.js b/core-js/stable/instance/last-index-of.js new file mode 100644 index 0000000000..b99739ef8a --- /dev/null +++ b/core-js/stable/instance/last-index-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/last-index-of'); diff --git a/core-js/stable/instance/map.js b/core-js/stable/instance/map.js new file mode 100644 index 0000000000..bfb6be1b28 --- /dev/null +++ b/core-js/stable/instance/map.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/map'); diff --git a/core-js/stable/instance/match-all.js b/core-js/stable/instance/match-all.js new file mode 100644 index 0000000000..2decf588e9 --- /dev/null +++ b/core-js/stable/instance/match-all.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/match-all'); diff --git a/core-js/stable/instance/pad-end.js b/core-js/stable/instance/pad-end.js new file mode 100644 index 0000000000..16ed95a01a --- /dev/null +++ b/core-js/stable/instance/pad-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/pad-end'); diff --git a/core-js/stable/instance/pad-start.js b/core-js/stable/instance/pad-start.js new file mode 100644 index 0000000000..01925ffbba --- /dev/null +++ b/core-js/stable/instance/pad-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/pad-start'); diff --git a/core-js/stable/instance/reduce-right.js b/core-js/stable/instance/reduce-right.js new file mode 100644 index 0000000000..2810409d94 --- /dev/null +++ b/core-js/stable/instance/reduce-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/reduce-right'); diff --git a/core-js/stable/instance/reduce.js b/core-js/stable/instance/reduce.js new file mode 100644 index 0000000000..ecee1c959a --- /dev/null +++ b/core-js/stable/instance/reduce.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/reduce'); diff --git a/core-js/stable/instance/repeat.js b/core-js/stable/instance/repeat.js new file mode 100644 index 0000000000..c0a7ec87a6 --- /dev/null +++ b/core-js/stable/instance/repeat.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/repeat'); diff --git a/core-js/stable/instance/reverse.js b/core-js/stable/instance/reverse.js new file mode 100644 index 0000000000..9983586581 --- /dev/null +++ b/core-js/stable/instance/reverse.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/reverse'); diff --git a/core-js/stable/instance/slice.js b/core-js/stable/instance/slice.js new file mode 100644 index 0000000000..1755c4191b --- /dev/null +++ b/core-js/stable/instance/slice.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/slice'); diff --git a/core-js/stable/instance/some.js b/core-js/stable/instance/some.js new file mode 100644 index 0000000000..b32c903b30 --- /dev/null +++ b/core-js/stable/instance/some.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/some'); diff --git a/core-js/stable/instance/sort.js b/core-js/stable/instance/sort.js new file mode 100644 index 0000000000..8891434c22 --- /dev/null +++ b/core-js/stable/instance/sort.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/sort'); diff --git a/core-js/stable/instance/splice.js b/core-js/stable/instance/splice.js new file mode 100644 index 0000000000..1d20660f06 --- /dev/null +++ b/core-js/stable/instance/splice.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/splice'); diff --git a/core-js/stable/instance/starts-with.js b/core-js/stable/instance/starts-with.js new file mode 100644 index 0000000000..4c8905255a --- /dev/null +++ b/core-js/stable/instance/starts-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/starts-with'); diff --git a/core-js/stable/instance/trim-end.js b/core-js/stable/instance/trim-end.js new file mode 100644 index 0000000000..eb75cde145 --- /dev/null +++ b/core-js/stable/instance/trim-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-end'); diff --git a/core-js/stable/instance/trim-left.js b/core-js/stable/instance/trim-left.js new file mode 100644 index 0000000000..5bef37ab77 --- /dev/null +++ b/core-js/stable/instance/trim-left.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-left'); diff --git a/core-js/stable/instance/trim-right.js b/core-js/stable/instance/trim-right.js new file mode 100644 index 0000000000..c425c7bf7b --- /dev/null +++ b/core-js/stable/instance/trim-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-right'); diff --git a/core-js/stable/instance/trim-start.js b/core-js/stable/instance/trim-start.js new file mode 100644 index 0000000000..88616985fa --- /dev/null +++ b/core-js/stable/instance/trim-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim-start'); diff --git a/core-js/stable/instance/trim.js b/core-js/stable/instance/trim.js new file mode 100644 index 0000000000..61c69d5030 --- /dev/null +++ b/core-js/stable/instance/trim.js @@ -0,0 +1 @@ +module.exports = require('../../es/instance/trim'); diff --git a/core-js/stable/instance/values.js b/core-js/stable/instance/values.js new file mode 100644 index 0000000000..febcba3330 --- /dev/null +++ b/core-js/stable/instance/values.js @@ -0,0 +1,16 @@ +require('../../modules/web.dom-collections.iterator'); +var values = require('../array/virtual/values'); +var classof = require('../../internals/classof'); +var ArrayPrototype = Array.prototype; + +var DOMIterables = { + DOMTokenList: true, + NodeList: true +}; + +module.exports = function (it) { + var own = it.values; + return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.values) + // eslint-disable-next-line no-prototype-builtins + || DOMIterables.hasOwnProperty(classof(it)) ? values : own; +}; diff --git a/core-js/stable/json/index.js b/core-js/stable/json/index.js new file mode 100644 index 0000000000..c0b897ff78 --- /dev/null +++ b/core-js/stable/json/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/json'); diff --git a/core-js/stable/json/stringify.js b/core-js/stable/json/stringify.js new file mode 100644 index 0000000000..20cf890355 --- /dev/null +++ b/core-js/stable/json/stringify.js @@ -0,0 +1 @@ +module.exports = require('../../es/json/stringify'); diff --git a/core-js/stable/json/to-string-tag.js b/core-js/stable/json/to-string-tag.js new file mode 100644 index 0000000000..9e9567295b --- /dev/null +++ b/core-js/stable/json/to-string-tag.js @@ -0,0 +1 @@ +module.exports = require('../../es/json/to-string-tag'); diff --git a/core-js/stable/map/index.js b/core-js/stable/map/index.js new file mode 100644 index 0000000000..1ccbaf974f --- /dev/null +++ b/core-js/stable/map/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/map'); diff --git a/core-js/stable/math/acosh.js b/core-js/stable/math/acosh.js new file mode 100644 index 0000000000..dd8ba00261 --- /dev/null +++ b/core-js/stable/math/acosh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/acosh'); diff --git a/core-js/stable/math/asinh.js b/core-js/stable/math/asinh.js new file mode 100644 index 0000000000..f811e075c7 --- /dev/null +++ b/core-js/stable/math/asinh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/asinh'); diff --git a/core-js/stable/math/atanh.js b/core-js/stable/math/atanh.js new file mode 100644 index 0000000000..b063d11c0a --- /dev/null +++ b/core-js/stable/math/atanh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/atanh'); diff --git a/core-js/stable/math/cbrt.js b/core-js/stable/math/cbrt.js new file mode 100644 index 0000000000..a0679fc9cd --- /dev/null +++ b/core-js/stable/math/cbrt.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/cbrt'); diff --git a/core-js/stable/math/clz32.js b/core-js/stable/math/clz32.js new file mode 100644 index 0000000000..e6460540e4 --- /dev/null +++ b/core-js/stable/math/clz32.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/clz32'); diff --git a/core-js/stable/math/cosh.js b/core-js/stable/math/cosh.js new file mode 100644 index 0000000000..a2be861ee0 --- /dev/null +++ b/core-js/stable/math/cosh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/cosh'); diff --git a/core-js/stable/math/expm1.js b/core-js/stable/math/expm1.js new file mode 100644 index 0000000000..a268bf3185 --- /dev/null +++ b/core-js/stable/math/expm1.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/expm1'); diff --git a/core-js/stable/math/fround.js b/core-js/stable/math/fround.js new file mode 100644 index 0000000000..1dc91bb680 --- /dev/null +++ b/core-js/stable/math/fround.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/fround'); diff --git a/core-js/stable/math/hypot.js b/core-js/stable/math/hypot.js new file mode 100644 index 0000000000..e6d0e640b1 --- /dev/null +++ b/core-js/stable/math/hypot.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/hypot'); diff --git a/core-js/stable/math/imul.js b/core-js/stable/math/imul.js new file mode 100644 index 0000000000..8cca8ef8ff --- /dev/null +++ b/core-js/stable/math/imul.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/imul'); diff --git a/core-js/stable/math/index.js b/core-js/stable/math/index.js new file mode 100644 index 0000000000..d9c722fc99 --- /dev/null +++ b/core-js/stable/math/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/math'); diff --git a/core-js/stable/math/log10.js b/core-js/stable/math/log10.js new file mode 100644 index 0000000000..272e219074 --- /dev/null +++ b/core-js/stable/math/log10.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/log10'); diff --git a/core-js/stable/math/log1p.js b/core-js/stable/math/log1p.js new file mode 100644 index 0000000000..8974895c6d --- /dev/null +++ b/core-js/stable/math/log1p.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/log1p'); diff --git a/core-js/stable/math/log2.js b/core-js/stable/math/log2.js new file mode 100644 index 0000000000..792eb936fe --- /dev/null +++ b/core-js/stable/math/log2.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/log2'); diff --git a/core-js/stable/math/sign.js b/core-js/stable/math/sign.js new file mode 100644 index 0000000000..1fd8f83005 --- /dev/null +++ b/core-js/stable/math/sign.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/sign'); diff --git a/core-js/stable/math/sinh.js b/core-js/stable/math/sinh.js new file mode 100644 index 0000000000..0314605140 --- /dev/null +++ b/core-js/stable/math/sinh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/sinh'); diff --git a/core-js/stable/math/tanh.js b/core-js/stable/math/tanh.js new file mode 100644 index 0000000000..d5bbc71216 --- /dev/null +++ b/core-js/stable/math/tanh.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/tanh'); diff --git a/core-js/stable/math/to-string-tag.js b/core-js/stable/math/to-string-tag.js new file mode 100644 index 0000000000..081cf92548 --- /dev/null +++ b/core-js/stable/math/to-string-tag.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/to-string-tag'); diff --git a/core-js/stable/math/trunc.js b/core-js/stable/math/trunc.js new file mode 100644 index 0000000000..08da6bfded --- /dev/null +++ b/core-js/stable/math/trunc.js @@ -0,0 +1 @@ +module.exports = require('../../es/math/trunc'); diff --git a/core-js/stable/number/constructor.js b/core-js/stable/number/constructor.js new file mode 100644 index 0000000000..2564b5428c --- /dev/null +++ b/core-js/stable/number/constructor.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/constructor'); diff --git a/core-js/stable/number/epsilon.js b/core-js/stable/number/epsilon.js new file mode 100644 index 0000000000..c655aea68b --- /dev/null +++ b/core-js/stable/number/epsilon.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/epsilon'); diff --git a/core-js/stable/number/index.js b/core-js/stable/number/index.js new file mode 100644 index 0000000000..ac9a5b2530 --- /dev/null +++ b/core-js/stable/number/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/number'); diff --git a/core-js/stable/number/is-finite.js b/core-js/stable/number/is-finite.js new file mode 100644 index 0000000000..4df7cee02f --- /dev/null +++ b/core-js/stable/number/is-finite.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-finite'); diff --git a/core-js/stable/number/is-integer.js b/core-js/stable/number/is-integer.js new file mode 100644 index 0000000000..703130788b --- /dev/null +++ b/core-js/stable/number/is-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-integer'); diff --git a/core-js/stable/number/is-nan.js b/core-js/stable/number/is-nan.js new file mode 100644 index 0000000000..93b4a6a522 --- /dev/null +++ b/core-js/stable/number/is-nan.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-nan'); diff --git a/core-js/stable/number/is-safe-integer.js b/core-js/stable/number/is-safe-integer.js new file mode 100644 index 0000000000..260215b8a9 --- /dev/null +++ b/core-js/stable/number/is-safe-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/is-safe-integer'); diff --git a/core-js/stable/number/max-safe-integer.js b/core-js/stable/number/max-safe-integer.js new file mode 100644 index 0000000000..2bd9174710 --- /dev/null +++ b/core-js/stable/number/max-safe-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/max-safe-integer'); diff --git a/core-js/stable/number/min-safe-integer.js b/core-js/stable/number/min-safe-integer.js new file mode 100644 index 0000000000..bcfe57e771 --- /dev/null +++ b/core-js/stable/number/min-safe-integer.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/min-safe-integer'); diff --git a/core-js/stable/number/parse-float.js b/core-js/stable/number/parse-float.js new file mode 100644 index 0000000000..bd9e1c61d2 --- /dev/null +++ b/core-js/stable/number/parse-float.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/parse-float'); diff --git a/core-js/stable/number/parse-int.js b/core-js/stable/number/parse-int.js new file mode 100644 index 0000000000..06473b8aa2 --- /dev/null +++ b/core-js/stable/number/parse-int.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/parse-int'); diff --git a/core-js/stable/number/to-fixed.js b/core-js/stable/number/to-fixed.js new file mode 100644 index 0000000000..a63c47aba9 --- /dev/null +++ b/core-js/stable/number/to-fixed.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/to-fixed'); diff --git a/core-js/stable/number/to-precision.js b/core-js/stable/number/to-precision.js new file mode 100644 index 0000000000..94c0c0bb4f --- /dev/null +++ b/core-js/stable/number/to-precision.js @@ -0,0 +1 @@ +module.exports = require('../../es/number/to-precision'); diff --git a/core-js/stable/number/virtual/index.js b/core-js/stable/number/virtual/index.js new file mode 100644 index 0000000000..538fb741a9 --- /dev/null +++ b/core-js/stable/number/virtual/index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/number/virtual'); diff --git a/core-js/stable/number/virtual/to-fixed.js b/core-js/stable/number/virtual/to-fixed.js new file mode 100644 index 0000000000..34a6e3d9de --- /dev/null +++ b/core-js/stable/number/virtual/to-fixed.js @@ -0,0 +1 @@ +module.exports = require('../../../es/number/virtual/to-fixed'); diff --git a/core-js/stable/number/virtual/to-precision.js b/core-js/stable/number/virtual/to-precision.js new file mode 100644 index 0000000000..34d15ac152 --- /dev/null +++ b/core-js/stable/number/virtual/to-precision.js @@ -0,0 +1 @@ +module.exports = require('../../../es/number/virtual/to-precision'); diff --git a/core-js/stable/object/assign.js b/core-js/stable/object/assign.js new file mode 100644 index 0000000000..71bb520708 --- /dev/null +++ b/core-js/stable/object/assign.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/assign'); diff --git a/core-js/stable/object/create.js b/core-js/stable/object/create.js new file mode 100644 index 0000000000..c8c535c776 --- /dev/null +++ b/core-js/stable/object/create.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/create'); diff --git a/core-js/stable/object/define-getter.js b/core-js/stable/object/define-getter.js new file mode 100644 index 0000000000..9dcc7dce99 --- /dev/null +++ b/core-js/stable/object/define-getter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-getter'); diff --git a/core-js/stable/object/define-properties.js b/core-js/stable/object/define-properties.js new file mode 100644 index 0000000000..df17acf962 --- /dev/null +++ b/core-js/stable/object/define-properties.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-properties'); diff --git a/core-js/stable/object/define-property.js b/core-js/stable/object/define-property.js new file mode 100644 index 0000000000..0d3d32bbc2 --- /dev/null +++ b/core-js/stable/object/define-property.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-property'); diff --git a/core-js/stable/object/define-setter.js b/core-js/stable/object/define-setter.js new file mode 100644 index 0000000000..51eba85f1b --- /dev/null +++ b/core-js/stable/object/define-setter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/define-setter'); diff --git a/core-js/stable/object/entries.js b/core-js/stable/object/entries.js new file mode 100644 index 0000000000..a0720ef4d5 --- /dev/null +++ b/core-js/stable/object/entries.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/entries'); diff --git a/core-js/stable/object/freeze.js b/core-js/stable/object/freeze.js new file mode 100644 index 0000000000..fb649bba6d --- /dev/null +++ b/core-js/stable/object/freeze.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/freeze'); diff --git a/core-js/stable/object/from-entries.js b/core-js/stable/object/from-entries.js new file mode 100644 index 0000000000..8b8ae99043 --- /dev/null +++ b/core-js/stable/object/from-entries.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/from-entries'); diff --git a/core-js/stable/object/get-own-property-descriptor.js b/core-js/stable/object/get-own-property-descriptor.js new file mode 100644 index 0000000000..b0404d86dd --- /dev/null +++ b/core-js/stable/object/get-own-property-descriptor.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-descriptor'); diff --git a/core-js/stable/object/get-own-property-descriptors.js b/core-js/stable/object/get-own-property-descriptors.js new file mode 100644 index 0000000000..2cec864d83 --- /dev/null +++ b/core-js/stable/object/get-own-property-descriptors.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-descriptors'); diff --git a/core-js/stable/object/get-own-property-names.js b/core-js/stable/object/get-own-property-names.js new file mode 100644 index 0000000000..13d60c0cd7 --- /dev/null +++ b/core-js/stable/object/get-own-property-names.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-names'); diff --git a/core-js/stable/object/get-own-property-symbols.js b/core-js/stable/object/get-own-property-symbols.js new file mode 100644 index 0000000000..301e00a9cf --- /dev/null +++ b/core-js/stable/object/get-own-property-symbols.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-own-property-symbols'); diff --git a/core-js/stable/object/get-prototype-of.js b/core-js/stable/object/get-prototype-of.js new file mode 100644 index 0000000000..27d2631e2b --- /dev/null +++ b/core-js/stable/object/get-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/get-prototype-of'); diff --git a/core-js/stable/object/index.js b/core-js/stable/object/index.js new file mode 100644 index 0000000000..ce38cc2695 --- /dev/null +++ b/core-js/stable/object/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/object'); diff --git a/core-js/stable/object/is-extensible.js b/core-js/stable/object/is-extensible.js new file mode 100644 index 0000000000..c228ed7a28 --- /dev/null +++ b/core-js/stable/object/is-extensible.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is-extensible'); diff --git a/core-js/stable/object/is-frozen.js b/core-js/stable/object/is-frozen.js new file mode 100644 index 0000000000..67bfab7201 --- /dev/null +++ b/core-js/stable/object/is-frozen.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is-frozen'); diff --git a/core-js/stable/object/is-sealed.js b/core-js/stable/object/is-sealed.js new file mode 100644 index 0000000000..f4b1b13981 --- /dev/null +++ b/core-js/stable/object/is-sealed.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is-sealed'); diff --git a/core-js/stable/object/is.js b/core-js/stable/object/is.js new file mode 100644 index 0000000000..70fd5bd5f8 --- /dev/null +++ b/core-js/stable/object/is.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/is'); diff --git a/core-js/stable/object/keys.js b/core-js/stable/object/keys.js new file mode 100644 index 0000000000..076a4dbec3 --- /dev/null +++ b/core-js/stable/object/keys.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/keys'); diff --git a/core-js/stable/object/lookup-getter.js b/core-js/stable/object/lookup-getter.js new file mode 100644 index 0000000000..77c189c83f --- /dev/null +++ b/core-js/stable/object/lookup-getter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/lookup-getter'); diff --git a/core-js/stable/object/lookup-setter.js b/core-js/stable/object/lookup-setter.js new file mode 100644 index 0000000000..c81418c26d --- /dev/null +++ b/core-js/stable/object/lookup-setter.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/lookup-setter'); diff --git a/core-js/stable/object/prevent-extensions.js b/core-js/stable/object/prevent-extensions.js new file mode 100644 index 0000000000..45e224eaee --- /dev/null +++ b/core-js/stable/object/prevent-extensions.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/prevent-extensions'); diff --git a/core-js/stable/object/seal.js b/core-js/stable/object/seal.js new file mode 100644 index 0000000000..9982772e45 --- /dev/null +++ b/core-js/stable/object/seal.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/seal'); diff --git a/core-js/stable/object/set-prototype-of.js b/core-js/stable/object/set-prototype-of.js new file mode 100644 index 0000000000..829f3a1b99 --- /dev/null +++ b/core-js/stable/object/set-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/set-prototype-of'); diff --git a/core-js/stable/object/to-string.js b/core-js/stable/object/to-string.js new file mode 100644 index 0000000000..cd78944a1c --- /dev/null +++ b/core-js/stable/object/to-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/to-string'); diff --git a/core-js/stable/object/values.js b/core-js/stable/object/values.js new file mode 100644 index 0000000000..20c13ee08e --- /dev/null +++ b/core-js/stable/object/values.js @@ -0,0 +1 @@ +module.exports = require('../../es/object/values'); diff --git a/core-js/stable/parse-float.js b/core-js/stable/parse-float.js new file mode 100644 index 0000000000..8fa047145b --- /dev/null +++ b/core-js/stable/parse-float.js @@ -0,0 +1 @@ +module.exports = require('../es/parse-float'); diff --git a/core-js/stable/parse-int.js b/core-js/stable/parse-int.js new file mode 100644 index 0000000000..5ca5602343 --- /dev/null +++ b/core-js/stable/parse-int.js @@ -0,0 +1 @@ +module.exports = require('../es/parse-int'); diff --git a/core-js/stable/promise/all-settled.js b/core-js/stable/promise/all-settled.js new file mode 100644 index 0000000000..135cc0905c --- /dev/null +++ b/core-js/stable/promise/all-settled.js @@ -0,0 +1 @@ +module.exports = require('../../es/promise/all-settled'); diff --git a/core-js/stable/promise/finally.js b/core-js/stable/promise/finally.js new file mode 100644 index 0000000000..33a51d4e3f --- /dev/null +++ b/core-js/stable/promise/finally.js @@ -0,0 +1 @@ +module.exports = require('../../es/promise/finally'); diff --git a/core-js/stable/promise/index.js b/core-js/stable/promise/index.js new file mode 100644 index 0000000000..83fd728605 --- /dev/null +++ b/core-js/stable/promise/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/promise'); diff --git a/core-js/stable/queue-microtask.js b/core-js/stable/queue-microtask.js new file mode 100644 index 0000000000..515a390bb4 --- /dev/null +++ b/core-js/stable/queue-microtask.js @@ -0,0 +1 @@ +module.exports = require('../web/queue-microtask'); diff --git a/core-js/stable/reflect/apply.js b/core-js/stable/reflect/apply.js new file mode 100644 index 0000000000..d7b952067d --- /dev/null +++ b/core-js/stable/reflect/apply.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/apply'); diff --git a/core-js/stable/reflect/construct.js b/core-js/stable/reflect/construct.js new file mode 100644 index 0000000000..0f286a32e0 --- /dev/null +++ b/core-js/stable/reflect/construct.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/construct'); diff --git a/core-js/stable/reflect/define-property.js b/core-js/stable/reflect/define-property.js new file mode 100644 index 0000000000..d19b9265d3 --- /dev/null +++ b/core-js/stable/reflect/define-property.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/define-property'); diff --git a/core-js/stable/reflect/delete-property.js b/core-js/stable/reflect/delete-property.js new file mode 100644 index 0000000000..d79e29b3fe --- /dev/null +++ b/core-js/stable/reflect/delete-property.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/delete-property'); diff --git a/core-js/stable/reflect/get-own-property-descriptor.js b/core-js/stable/reflect/get-own-property-descriptor.js new file mode 100644 index 0000000000..0483bca36b --- /dev/null +++ b/core-js/stable/reflect/get-own-property-descriptor.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/get-own-property-descriptor'); diff --git a/core-js/stable/reflect/get-prototype-of.js b/core-js/stable/reflect/get-prototype-of.js new file mode 100644 index 0000000000..cd6d7e0ba3 --- /dev/null +++ b/core-js/stable/reflect/get-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/get-prototype-of'); diff --git a/core-js/stable/reflect/get.js b/core-js/stable/reflect/get.js new file mode 100644 index 0000000000..ee78111138 --- /dev/null +++ b/core-js/stable/reflect/get.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/get'); diff --git a/core-js/stable/reflect/has.js b/core-js/stable/reflect/has.js new file mode 100644 index 0000000000..94ab23b957 --- /dev/null +++ b/core-js/stable/reflect/has.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/has'); diff --git a/core-js/stable/reflect/index.js b/core-js/stable/reflect/index.js new file mode 100644 index 0000000000..81a847792e --- /dev/null +++ b/core-js/stable/reflect/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect'); diff --git a/core-js/stable/reflect/is-extensible.js b/core-js/stable/reflect/is-extensible.js new file mode 100644 index 0000000000..79eee47a47 --- /dev/null +++ b/core-js/stable/reflect/is-extensible.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/is-extensible'); diff --git a/core-js/stable/reflect/own-keys.js b/core-js/stable/reflect/own-keys.js new file mode 100644 index 0000000000..d2690afcd7 --- /dev/null +++ b/core-js/stable/reflect/own-keys.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/own-keys'); diff --git a/core-js/stable/reflect/prevent-extensions.js b/core-js/stable/reflect/prevent-extensions.js new file mode 100644 index 0000000000..7f536b2fc4 --- /dev/null +++ b/core-js/stable/reflect/prevent-extensions.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/prevent-extensions'); diff --git a/core-js/stable/reflect/set-prototype-of.js b/core-js/stable/reflect/set-prototype-of.js new file mode 100644 index 0000000000..334b24f7f3 --- /dev/null +++ b/core-js/stable/reflect/set-prototype-of.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/set-prototype-of'); diff --git a/core-js/stable/reflect/set.js b/core-js/stable/reflect/set.js new file mode 100644 index 0000000000..fb8326924e --- /dev/null +++ b/core-js/stable/reflect/set.js @@ -0,0 +1 @@ +module.exports = require('../../es/reflect/set'); diff --git a/core-js/stable/regexp/constructor.js b/core-js/stable/regexp/constructor.js new file mode 100644 index 0000000000..39f94c96b1 --- /dev/null +++ b/core-js/stable/regexp/constructor.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/constructor'); diff --git a/core-js/stable/regexp/flags.js b/core-js/stable/regexp/flags.js new file mode 100644 index 0000000000..c8cca6a53f --- /dev/null +++ b/core-js/stable/regexp/flags.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/flags'); diff --git a/core-js/stable/regexp/index.js b/core-js/stable/regexp/index.js new file mode 100644 index 0000000000..232877ca9e --- /dev/null +++ b/core-js/stable/regexp/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp'); diff --git a/core-js/stable/regexp/match.js b/core-js/stable/regexp/match.js new file mode 100644 index 0000000000..18c58a6259 --- /dev/null +++ b/core-js/stable/regexp/match.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/match'); diff --git a/core-js/stable/regexp/replace.js b/core-js/stable/regexp/replace.js new file mode 100644 index 0000000000..7164a238d5 --- /dev/null +++ b/core-js/stable/regexp/replace.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/replace'); diff --git a/core-js/stable/regexp/search.js b/core-js/stable/regexp/search.js new file mode 100644 index 0000000000..6b0635152d --- /dev/null +++ b/core-js/stable/regexp/search.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/search'); diff --git a/core-js/stable/regexp/split.js b/core-js/stable/regexp/split.js new file mode 100644 index 0000000000..4739453e69 --- /dev/null +++ b/core-js/stable/regexp/split.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/split'); diff --git a/core-js/stable/regexp/to-string.js b/core-js/stable/regexp/to-string.js new file mode 100644 index 0000000000..4d7834251e --- /dev/null +++ b/core-js/stable/regexp/to-string.js @@ -0,0 +1 @@ +module.exports = require('../../es/regexp/to-string'); diff --git a/core-js/stable/set-immediate.js b/core-js/stable/set-immediate.js new file mode 100644 index 0000000000..a9e4396710 --- /dev/null +++ b/core-js/stable/set-immediate.js @@ -0,0 +1,3 @@ +require('../modules/web.immediate'); + +module.exports = require('../internals/path').setImmediate; diff --git a/core-js/stable/set-interval.js b/core-js/stable/set-interval.js new file mode 100644 index 0000000000..51a60789ff --- /dev/null +++ b/core-js/stable/set-interval.js @@ -0,0 +1,3 @@ +require('../modules/web.timers'); + +module.exports = require('../internals/path').setInterval; diff --git a/core-js/stable/set-timeout.js b/core-js/stable/set-timeout.js new file mode 100644 index 0000000000..b7bc7d7343 --- /dev/null +++ b/core-js/stable/set-timeout.js @@ -0,0 +1,3 @@ +require('../modules/web.timers'); + +module.exports = require('../internals/path').setTimeout; diff --git a/core-js/stable/set/index.js b/core-js/stable/set/index.js new file mode 100644 index 0000000000..48226afb8c --- /dev/null +++ b/core-js/stable/set/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/set'); diff --git a/core-js/stable/string/anchor.js b/core-js/stable/string/anchor.js new file mode 100644 index 0000000000..4705d8e0e9 --- /dev/null +++ b/core-js/stable/string/anchor.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/anchor'); diff --git a/core-js/stable/string/big.js b/core-js/stable/string/big.js new file mode 100644 index 0000000000..8bcf44148f --- /dev/null +++ b/core-js/stable/string/big.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/big'); diff --git a/core-js/stable/string/blink.js b/core-js/stable/string/blink.js new file mode 100644 index 0000000000..334f4a1dc8 --- /dev/null +++ b/core-js/stable/string/blink.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/blink'); diff --git a/core-js/stable/string/bold.js b/core-js/stable/string/bold.js new file mode 100644 index 0000000000..6dbf233088 --- /dev/null +++ b/core-js/stable/string/bold.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/bold'); diff --git a/core-js/stable/string/code-point-at.js b/core-js/stable/string/code-point-at.js new file mode 100644 index 0000000000..fb74eaee91 --- /dev/null +++ b/core-js/stable/string/code-point-at.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/code-point-at'); diff --git a/core-js/stable/string/ends-with.js b/core-js/stable/string/ends-with.js new file mode 100644 index 0000000000..89dfe343bb --- /dev/null +++ b/core-js/stable/string/ends-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/ends-with'); diff --git a/core-js/stable/string/fixed.js b/core-js/stable/string/fixed.js new file mode 100644 index 0000000000..450d466c56 --- /dev/null +++ b/core-js/stable/string/fixed.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/fixed'); diff --git a/core-js/stable/string/fontcolor.js b/core-js/stable/string/fontcolor.js new file mode 100644 index 0000000000..0d1033b1d0 --- /dev/null +++ b/core-js/stable/string/fontcolor.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/fontcolor'); diff --git a/core-js/stable/string/fontsize.js b/core-js/stable/string/fontsize.js new file mode 100644 index 0000000000..2167503c08 --- /dev/null +++ b/core-js/stable/string/fontsize.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/fontsize'); diff --git a/core-js/stable/string/from-code-point.js b/core-js/stable/string/from-code-point.js new file mode 100644 index 0000000000..2ac7d708f7 --- /dev/null +++ b/core-js/stable/string/from-code-point.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/from-code-point'); diff --git a/core-js/stable/string/includes.js b/core-js/stable/string/includes.js new file mode 100644 index 0000000000..62baf5c7ac --- /dev/null +++ b/core-js/stable/string/includes.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/includes'); diff --git a/core-js/stable/string/index.js b/core-js/stable/string/index.js new file mode 100644 index 0000000000..0f992c3210 --- /dev/null +++ b/core-js/stable/string/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/string'); diff --git a/core-js/stable/string/italics.js b/core-js/stable/string/italics.js new file mode 100644 index 0000000000..0bca65552f --- /dev/null +++ b/core-js/stable/string/italics.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/italics'); diff --git a/core-js/stable/string/iterator.js b/core-js/stable/string/iterator.js new file mode 100644 index 0000000000..06e162ca0e --- /dev/null +++ b/core-js/stable/string/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/iterator'); diff --git a/core-js/stable/string/link.js b/core-js/stable/string/link.js new file mode 100644 index 0000000000..d2ff7b9f3d --- /dev/null +++ b/core-js/stable/string/link.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/link'); diff --git a/core-js/stable/string/match-all.js b/core-js/stable/string/match-all.js new file mode 100644 index 0000000000..ff63633d8b --- /dev/null +++ b/core-js/stable/string/match-all.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/match-all'); diff --git a/core-js/stable/string/match.js b/core-js/stable/string/match.js new file mode 100644 index 0000000000..7e56b7777e --- /dev/null +++ b/core-js/stable/string/match.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/match'); diff --git a/core-js/stable/string/pad-end.js b/core-js/stable/string/pad-end.js new file mode 100644 index 0000000000..ef266cb5c3 --- /dev/null +++ b/core-js/stable/string/pad-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/pad-end'); diff --git a/core-js/stable/string/pad-start.js b/core-js/stable/string/pad-start.js new file mode 100644 index 0000000000..45f47934f6 --- /dev/null +++ b/core-js/stable/string/pad-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/pad-start'); diff --git a/core-js/stable/string/raw.js b/core-js/stable/string/raw.js new file mode 100644 index 0000000000..6bbc950aee --- /dev/null +++ b/core-js/stable/string/raw.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/raw'); diff --git a/core-js/stable/string/repeat.js b/core-js/stable/string/repeat.js new file mode 100644 index 0000000000..b9b9939bbc --- /dev/null +++ b/core-js/stable/string/repeat.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/repeat'); diff --git a/core-js/stable/string/replace.js b/core-js/stable/string/replace.js new file mode 100644 index 0000000000..25cfcf730a --- /dev/null +++ b/core-js/stable/string/replace.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/replace'); diff --git a/core-js/stable/string/search.js b/core-js/stable/string/search.js new file mode 100644 index 0000000000..629c7a5542 --- /dev/null +++ b/core-js/stable/string/search.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/search'); diff --git a/core-js/stable/string/small.js b/core-js/stable/string/small.js new file mode 100644 index 0000000000..da002780cf --- /dev/null +++ b/core-js/stable/string/small.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/small'); diff --git a/core-js/stable/string/split.js b/core-js/stable/string/split.js new file mode 100644 index 0000000000..1ec2611975 --- /dev/null +++ b/core-js/stable/string/split.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/split'); diff --git a/core-js/stable/string/starts-with.js b/core-js/stable/string/starts-with.js new file mode 100644 index 0000000000..6b4598b5c7 --- /dev/null +++ b/core-js/stable/string/starts-with.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/starts-with'); diff --git a/core-js/stable/string/strike.js b/core-js/stable/string/strike.js new file mode 100644 index 0000000000..6e2154628d --- /dev/null +++ b/core-js/stable/string/strike.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/strike'); diff --git a/core-js/stable/string/sub.js b/core-js/stable/string/sub.js new file mode 100644 index 0000000000..0f5d2e37e7 --- /dev/null +++ b/core-js/stable/string/sub.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/sub'); diff --git a/core-js/stable/string/sup.js b/core-js/stable/string/sup.js new file mode 100644 index 0000000000..9e6d1fff69 --- /dev/null +++ b/core-js/stable/string/sup.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/sup'); diff --git a/core-js/stable/string/trim-end.js b/core-js/stable/string/trim-end.js new file mode 100644 index 0000000000..3fe1209064 --- /dev/null +++ b/core-js/stable/string/trim-end.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-end'); diff --git a/core-js/stable/string/trim-left.js b/core-js/stable/string/trim-left.js new file mode 100644 index 0000000000..2260e53ec9 --- /dev/null +++ b/core-js/stable/string/trim-left.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-left'); diff --git a/core-js/stable/string/trim-right.js b/core-js/stable/string/trim-right.js new file mode 100644 index 0000000000..5ec4c3b29b --- /dev/null +++ b/core-js/stable/string/trim-right.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-right'); diff --git a/core-js/stable/string/trim-start.js b/core-js/stable/string/trim-start.js new file mode 100644 index 0000000000..75e8212f6a --- /dev/null +++ b/core-js/stable/string/trim-start.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim-start'); diff --git a/core-js/stable/string/trim.js b/core-js/stable/string/trim.js new file mode 100644 index 0000000000..8231ac80bc --- /dev/null +++ b/core-js/stable/string/trim.js @@ -0,0 +1 @@ +module.exports = require('../../es/string/trim'); diff --git a/core-js/stable/string/virtual/anchor.js b/core-js/stable/string/virtual/anchor.js new file mode 100644 index 0000000000..1d3b8b8764 --- /dev/null +++ b/core-js/stable/string/virtual/anchor.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/anchor'); diff --git a/core-js/stable/string/virtual/big.js b/core-js/stable/string/virtual/big.js new file mode 100644 index 0000000000..cb8c788448 --- /dev/null +++ b/core-js/stable/string/virtual/big.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/big'); diff --git a/core-js/stable/string/virtual/blink.js b/core-js/stable/string/virtual/blink.js new file mode 100644 index 0000000000..d4ad1b8239 --- /dev/null +++ b/core-js/stable/string/virtual/blink.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/blink'); diff --git a/core-js/stable/string/virtual/bold.js b/core-js/stable/string/virtual/bold.js new file mode 100644 index 0000000000..58ff2fa275 --- /dev/null +++ b/core-js/stable/string/virtual/bold.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/bold'); diff --git a/core-js/stable/string/virtual/code-point-at.js b/core-js/stable/string/virtual/code-point-at.js new file mode 100644 index 0000000000..a23f0a7913 --- /dev/null +++ b/core-js/stable/string/virtual/code-point-at.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/code-point-at'); diff --git a/core-js/stable/string/virtual/ends-with.js b/core-js/stable/string/virtual/ends-with.js new file mode 100644 index 0000000000..e7c2d360c4 --- /dev/null +++ b/core-js/stable/string/virtual/ends-with.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/ends-with'); diff --git a/core-js/stable/string/virtual/fixed.js b/core-js/stable/string/virtual/fixed.js new file mode 100644 index 0000000000..adcae23a3b --- /dev/null +++ b/core-js/stable/string/virtual/fixed.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/fixed'); diff --git a/core-js/stable/string/virtual/fontcolor.js b/core-js/stable/string/virtual/fontcolor.js new file mode 100644 index 0000000000..c0435a264e --- /dev/null +++ b/core-js/stable/string/virtual/fontcolor.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/fontcolor'); diff --git a/core-js/stable/string/virtual/fontsize.js b/core-js/stable/string/virtual/fontsize.js new file mode 100644 index 0000000000..0952c468bd --- /dev/null +++ b/core-js/stable/string/virtual/fontsize.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/fontsize'); diff --git a/core-js/stable/string/virtual/includes.js b/core-js/stable/string/virtual/includes.js new file mode 100644 index 0000000000..671747b853 --- /dev/null +++ b/core-js/stable/string/virtual/includes.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/includes'); diff --git a/core-js/stable/string/virtual/index.js b/core-js/stable/string/virtual/index.js new file mode 100644 index 0000000000..0d9bc2972d --- /dev/null +++ b/core-js/stable/string/virtual/index.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual'); diff --git a/core-js/stable/string/virtual/italics.js b/core-js/stable/string/virtual/italics.js new file mode 100644 index 0000000000..b7e72cdbaf --- /dev/null +++ b/core-js/stable/string/virtual/italics.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/italics'); diff --git a/core-js/stable/string/virtual/iterator.js b/core-js/stable/string/virtual/iterator.js new file mode 100644 index 0000000000..f52320e511 --- /dev/null +++ b/core-js/stable/string/virtual/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/iterator'); diff --git a/core-js/stable/string/virtual/link.js b/core-js/stable/string/virtual/link.js new file mode 100644 index 0000000000..20fe8ab879 --- /dev/null +++ b/core-js/stable/string/virtual/link.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/link'); diff --git a/core-js/stable/string/virtual/match-all.js b/core-js/stable/string/virtual/match-all.js new file mode 100644 index 0000000000..59960bbcc6 --- /dev/null +++ b/core-js/stable/string/virtual/match-all.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/match-all'); diff --git a/core-js/stable/string/virtual/pad-end.js b/core-js/stable/string/virtual/pad-end.js new file mode 100644 index 0000000000..128a7ee403 --- /dev/null +++ b/core-js/stable/string/virtual/pad-end.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/pad-end'); diff --git a/core-js/stable/string/virtual/pad-start.js b/core-js/stable/string/virtual/pad-start.js new file mode 100644 index 0000000000..a5e86e81f5 --- /dev/null +++ b/core-js/stable/string/virtual/pad-start.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/pad-start'); diff --git a/core-js/stable/string/virtual/repeat.js b/core-js/stable/string/virtual/repeat.js new file mode 100644 index 0000000000..591cbfdbff --- /dev/null +++ b/core-js/stable/string/virtual/repeat.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/repeat'); diff --git a/core-js/stable/string/virtual/small.js b/core-js/stable/string/virtual/small.js new file mode 100644 index 0000000000..4c5373075b --- /dev/null +++ b/core-js/stable/string/virtual/small.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/small'); diff --git a/core-js/stable/string/virtual/starts-with.js b/core-js/stable/string/virtual/starts-with.js new file mode 100644 index 0000000000..9722995139 --- /dev/null +++ b/core-js/stable/string/virtual/starts-with.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/starts-with'); diff --git a/core-js/stable/string/virtual/strike.js b/core-js/stable/string/virtual/strike.js new file mode 100644 index 0000000000..3570027d84 --- /dev/null +++ b/core-js/stable/string/virtual/strike.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/strike'); diff --git a/core-js/stable/string/virtual/sub.js b/core-js/stable/string/virtual/sub.js new file mode 100644 index 0000000000..d3a9c6e534 --- /dev/null +++ b/core-js/stable/string/virtual/sub.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/sub'); diff --git a/core-js/stable/string/virtual/sup.js b/core-js/stable/string/virtual/sup.js new file mode 100644 index 0000000000..a2fe71dff0 --- /dev/null +++ b/core-js/stable/string/virtual/sup.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/sup'); diff --git a/core-js/stable/string/virtual/trim-end.js b/core-js/stable/string/virtual/trim-end.js new file mode 100644 index 0000000000..f450167c55 --- /dev/null +++ b/core-js/stable/string/virtual/trim-end.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-end'); diff --git a/core-js/stable/string/virtual/trim-left.js b/core-js/stable/string/virtual/trim-left.js new file mode 100644 index 0000000000..515e7e507c --- /dev/null +++ b/core-js/stable/string/virtual/trim-left.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-left'); diff --git a/core-js/stable/string/virtual/trim-right.js b/core-js/stable/string/virtual/trim-right.js new file mode 100644 index 0000000000..8823454fa3 --- /dev/null +++ b/core-js/stable/string/virtual/trim-right.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-right'); diff --git a/core-js/stable/string/virtual/trim-start.js b/core-js/stable/string/virtual/trim-start.js new file mode 100644 index 0000000000..3afb6eff83 --- /dev/null +++ b/core-js/stable/string/virtual/trim-start.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim-start'); diff --git a/core-js/stable/string/virtual/trim.js b/core-js/stable/string/virtual/trim.js new file mode 100644 index 0000000000..12a266abbf --- /dev/null +++ b/core-js/stable/string/virtual/trim.js @@ -0,0 +1 @@ +module.exports = require('../../../es/string/virtual/trim'); diff --git a/core-js/stable/symbol/async-iterator.js b/core-js/stable/symbol/async-iterator.js new file mode 100644 index 0000000000..2d69e19ca2 --- /dev/null +++ b/core-js/stable/symbol/async-iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/async-iterator'); diff --git a/core-js/stable/symbol/description.js b/core-js/stable/symbol/description.js new file mode 100644 index 0000000000..7bb4b2bc9c --- /dev/null +++ b/core-js/stable/symbol/description.js @@ -0,0 +1 @@ +require('../../modules/es.symbol.description'); diff --git a/core-js/stable/symbol/for.js b/core-js/stable/symbol/for.js new file mode 100644 index 0000000000..58633a4ba9 --- /dev/null +++ b/core-js/stable/symbol/for.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/for'); diff --git a/core-js/stable/symbol/has-instance.js b/core-js/stable/symbol/has-instance.js new file mode 100644 index 0000000000..82bca7ec27 --- /dev/null +++ b/core-js/stable/symbol/has-instance.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/has-instance'); diff --git a/core-js/stable/symbol/index.js b/core-js/stable/symbol/index.js new file mode 100644 index 0000000000..317092735a --- /dev/null +++ b/core-js/stable/symbol/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol'); diff --git a/core-js/stable/symbol/is-concat-spreadable.js b/core-js/stable/symbol/is-concat-spreadable.js new file mode 100644 index 0000000000..ce3514e1a2 --- /dev/null +++ b/core-js/stable/symbol/is-concat-spreadable.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/is-concat-spreadable'); diff --git a/core-js/stable/symbol/iterator.js b/core-js/stable/symbol/iterator.js new file mode 100644 index 0000000000..1a102a6c57 --- /dev/null +++ b/core-js/stable/symbol/iterator.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/iterator'); diff --git a/core-js/stable/symbol/key-for.js b/core-js/stable/symbol/key-for.js new file mode 100644 index 0000000000..c66cab7e90 --- /dev/null +++ b/core-js/stable/symbol/key-for.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/key-for'); diff --git a/core-js/stable/symbol/match-all.js b/core-js/stable/symbol/match-all.js new file mode 100644 index 0000000000..66730fe290 --- /dev/null +++ b/core-js/stable/symbol/match-all.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/match-all'); diff --git a/core-js/stable/symbol/match.js b/core-js/stable/symbol/match.js new file mode 100644 index 0000000000..66c5805a5e --- /dev/null +++ b/core-js/stable/symbol/match.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/match'); diff --git a/core-js/stable/symbol/replace.js b/core-js/stable/symbol/replace.js new file mode 100644 index 0000000000..85324c9231 --- /dev/null +++ b/core-js/stable/symbol/replace.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/replace'); diff --git a/core-js/stable/symbol/search.js b/core-js/stable/symbol/search.js new file mode 100644 index 0000000000..33772f66be --- /dev/null +++ b/core-js/stable/symbol/search.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/search'); diff --git a/core-js/stable/symbol/species.js b/core-js/stable/symbol/species.js new file mode 100644 index 0000000000..87979c67e3 --- /dev/null +++ b/core-js/stable/symbol/species.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/species'); diff --git a/core-js/stable/symbol/split.js b/core-js/stable/symbol/split.js new file mode 100644 index 0000000000..c3855a3005 --- /dev/null +++ b/core-js/stable/symbol/split.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/split'); diff --git a/core-js/stable/symbol/to-primitive.js b/core-js/stable/symbol/to-primitive.js new file mode 100644 index 0000000000..1fbb427471 --- /dev/null +++ b/core-js/stable/symbol/to-primitive.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/to-primitive'); diff --git a/core-js/stable/symbol/to-string-tag.js b/core-js/stable/symbol/to-string-tag.js new file mode 100644 index 0000000000..eeeb3a1354 --- /dev/null +++ b/core-js/stable/symbol/to-string-tag.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/to-string-tag'); diff --git a/core-js/stable/symbol/unscopables.js b/core-js/stable/symbol/unscopables.js new file mode 100644 index 0000000000..7ae091b300 --- /dev/null +++ b/core-js/stable/symbol/unscopables.js @@ -0,0 +1 @@ +module.exports = require('../../es/symbol/unscopables'); diff --git a/core-js/stable/typed-array/copy-within.js b/core-js/stable/typed-array/copy-within.js new file mode 100644 index 0000000000..1352cec72f --- /dev/null +++ b/core-js/stable/typed-array/copy-within.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.copy-within'); diff --git a/core-js/stable/typed-array/entries.js b/core-js/stable/typed-array/entries.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/stable/typed-array/entries.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/stable/typed-array/every.js b/core-js/stable/typed-array/every.js new file mode 100644 index 0000000000..681164be00 --- /dev/null +++ b/core-js/stable/typed-array/every.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.every'); diff --git a/core-js/stable/typed-array/fill.js b/core-js/stable/typed-array/fill.js new file mode 100644 index 0000000000..4d92ac6654 --- /dev/null +++ b/core-js/stable/typed-array/fill.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.fill'); diff --git a/core-js/stable/typed-array/filter.js b/core-js/stable/typed-array/filter.js new file mode 100644 index 0000000000..7d0a630ffa --- /dev/null +++ b/core-js/stable/typed-array/filter.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.filter'); diff --git a/core-js/stable/typed-array/find-index.js b/core-js/stable/typed-array/find-index.js new file mode 100644 index 0000000000..039cd5edde --- /dev/null +++ b/core-js/stable/typed-array/find-index.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.find-index'); diff --git a/core-js/stable/typed-array/find.js b/core-js/stable/typed-array/find.js new file mode 100644 index 0000000000..b3251b9a04 --- /dev/null +++ b/core-js/stable/typed-array/find.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.find'); diff --git a/core-js/stable/typed-array/float32-array.js b/core-js/stable/typed-array/float32-array.js new file mode 100644 index 0000000000..78c91f0a78 --- /dev/null +++ b/core-js/stable/typed-array/float32-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/float32-array'); diff --git a/core-js/stable/typed-array/float64-array.js b/core-js/stable/typed-array/float64-array.js new file mode 100644 index 0000000000..cb90104de0 --- /dev/null +++ b/core-js/stable/typed-array/float64-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/float64-array'); diff --git a/core-js/stable/typed-array/for-each.js b/core-js/stable/typed-array/for-each.js new file mode 100644 index 0000000000..defe03a8dc --- /dev/null +++ b/core-js/stable/typed-array/for-each.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.for-each'); diff --git a/core-js/stable/typed-array/from.js b/core-js/stable/typed-array/from.js new file mode 100644 index 0000000000..e0f34441d1 --- /dev/null +++ b/core-js/stable/typed-array/from.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.from'); diff --git a/core-js/stable/typed-array/includes.js b/core-js/stable/typed-array/includes.js new file mode 100644 index 0000000000..5ff65f9645 --- /dev/null +++ b/core-js/stable/typed-array/includes.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.includes'); diff --git a/core-js/stable/typed-array/index-of.js b/core-js/stable/typed-array/index-of.js new file mode 100644 index 0000000000..87081c0f2b --- /dev/null +++ b/core-js/stable/typed-array/index-of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.index-of'); diff --git a/core-js/stable/typed-array/index.js b/core-js/stable/typed-array/index.js new file mode 100644 index 0000000000..f3ded39d59 --- /dev/null +++ b/core-js/stable/typed-array/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array'); diff --git a/core-js/stable/typed-array/int16-array.js b/core-js/stable/typed-array/int16-array.js new file mode 100644 index 0000000000..d083357db0 --- /dev/null +++ b/core-js/stable/typed-array/int16-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/int16-array'); diff --git a/core-js/stable/typed-array/int32-array.js b/core-js/stable/typed-array/int32-array.js new file mode 100644 index 0000000000..365a971501 --- /dev/null +++ b/core-js/stable/typed-array/int32-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/int32-array'); diff --git a/core-js/stable/typed-array/int8-array.js b/core-js/stable/typed-array/int8-array.js new file mode 100644 index 0000000000..0b9f28c6e1 --- /dev/null +++ b/core-js/stable/typed-array/int8-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/int8-array'); diff --git a/core-js/stable/typed-array/iterator.js b/core-js/stable/typed-array/iterator.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/stable/typed-array/iterator.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/stable/typed-array/join.js b/core-js/stable/typed-array/join.js new file mode 100644 index 0000000000..431129c92f --- /dev/null +++ b/core-js/stable/typed-array/join.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.join'); diff --git a/core-js/stable/typed-array/keys.js b/core-js/stable/typed-array/keys.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/stable/typed-array/keys.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/stable/typed-array/last-index-of.js b/core-js/stable/typed-array/last-index-of.js new file mode 100644 index 0000000000..5682bf44ea --- /dev/null +++ b/core-js/stable/typed-array/last-index-of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.last-index-of'); diff --git a/core-js/stable/typed-array/map.js b/core-js/stable/typed-array/map.js new file mode 100644 index 0000000000..db08fed371 --- /dev/null +++ b/core-js/stable/typed-array/map.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.map'); diff --git a/core-js/stable/typed-array/of.js b/core-js/stable/typed-array/of.js new file mode 100644 index 0000000000..121bf5e2d6 --- /dev/null +++ b/core-js/stable/typed-array/of.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.of'); diff --git a/core-js/stable/typed-array/reduce-right.js b/core-js/stable/typed-array/reduce-right.js new file mode 100644 index 0000000000..cbd321fc62 --- /dev/null +++ b/core-js/stable/typed-array/reduce-right.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reduce-right'); diff --git a/core-js/stable/typed-array/reduce.js b/core-js/stable/typed-array/reduce.js new file mode 100644 index 0000000000..e2a6f28283 --- /dev/null +++ b/core-js/stable/typed-array/reduce.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reduce'); diff --git a/core-js/stable/typed-array/reverse.js b/core-js/stable/typed-array/reverse.js new file mode 100644 index 0000000000..14995f497b --- /dev/null +++ b/core-js/stable/typed-array/reverse.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.reverse'); diff --git a/core-js/stable/typed-array/set.js b/core-js/stable/typed-array/set.js new file mode 100644 index 0000000000..5330e22983 --- /dev/null +++ b/core-js/stable/typed-array/set.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.set'); diff --git a/core-js/stable/typed-array/slice.js b/core-js/stable/typed-array/slice.js new file mode 100644 index 0000000000..37fb8c141a --- /dev/null +++ b/core-js/stable/typed-array/slice.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.slice'); diff --git a/core-js/stable/typed-array/some.js b/core-js/stable/typed-array/some.js new file mode 100644 index 0000000000..495c322f7d --- /dev/null +++ b/core-js/stable/typed-array/some.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.some'); diff --git a/core-js/stable/typed-array/sort.js b/core-js/stable/typed-array/sort.js new file mode 100644 index 0000000000..d6c7e30b99 --- /dev/null +++ b/core-js/stable/typed-array/sort.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.sort'); diff --git a/core-js/stable/typed-array/subarray.js b/core-js/stable/typed-array/subarray.js new file mode 100644 index 0000000000..dbad4ca2d6 --- /dev/null +++ b/core-js/stable/typed-array/subarray.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.subarray'); diff --git a/core-js/stable/typed-array/to-locale-string.js b/core-js/stable/typed-array/to-locale-string.js new file mode 100644 index 0000000000..12c809e233 --- /dev/null +++ b/core-js/stable/typed-array/to-locale-string.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.to-locale-string'); diff --git a/core-js/stable/typed-array/to-string.js b/core-js/stable/typed-array/to-string.js new file mode 100644 index 0000000000..bf9416079f --- /dev/null +++ b/core-js/stable/typed-array/to-string.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.to-string'); diff --git a/core-js/stable/typed-array/uint16-array.js b/core-js/stable/typed-array/uint16-array.js new file mode 100644 index 0000000000..5ef2cb4977 --- /dev/null +++ b/core-js/stable/typed-array/uint16-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint16-array'); diff --git a/core-js/stable/typed-array/uint32-array.js b/core-js/stable/typed-array/uint32-array.js new file mode 100644 index 0000000000..f84c728f6d --- /dev/null +++ b/core-js/stable/typed-array/uint32-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint32-array'); diff --git a/core-js/stable/typed-array/uint8-array.js b/core-js/stable/typed-array/uint8-array.js new file mode 100644 index 0000000000..29dbfd6f92 --- /dev/null +++ b/core-js/stable/typed-array/uint8-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint8-array'); diff --git a/core-js/stable/typed-array/uint8-clamped-array.js b/core-js/stable/typed-array/uint8-clamped-array.js new file mode 100644 index 0000000000..8fcc6497ab --- /dev/null +++ b/core-js/stable/typed-array/uint8-clamped-array.js @@ -0,0 +1 @@ +module.exports = require('../../es/typed-array/uint8-clamped-array'); diff --git a/core-js/stable/typed-array/values.js b/core-js/stable/typed-array/values.js new file mode 100644 index 0000000000..66cc6dca13 --- /dev/null +++ b/core-js/stable/typed-array/values.js @@ -0,0 +1 @@ +require('../../modules/es.typed-array.iterator'); diff --git a/core-js/stable/url-search-params/index.js b/core-js/stable/url-search-params/index.js new file mode 100644 index 0000000000..e14322b1b4 --- /dev/null +++ b/core-js/stable/url-search-params/index.js @@ -0,0 +1 @@ +module.exports = require('../../web/url-search-params'); diff --git a/core-js/stable/url/index.js b/core-js/stable/url/index.js new file mode 100644 index 0000000000..755eb2ffe9 --- /dev/null +++ b/core-js/stable/url/index.js @@ -0,0 +1 @@ +module.exports = require('../../web/url'); diff --git a/core-js/stable/url/to-json.js b/core-js/stable/url/to-json.js new file mode 100644 index 0000000000..0d841b68ef --- /dev/null +++ b/core-js/stable/url/to-json.js @@ -0,0 +1 @@ +require('../../modules/web.url.to-json'); diff --git a/core-js/stable/weak-map/index.js b/core-js/stable/weak-map/index.js new file mode 100644 index 0000000000..482af14bcb --- /dev/null +++ b/core-js/stable/weak-map/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/weak-map'); diff --git a/core-js/stable/weak-set/index.js b/core-js/stable/weak-set/index.js new file mode 100644 index 0000000000..a0a3d64f74 --- /dev/null +++ b/core-js/stable/weak-set/index.js @@ -0,0 +1 @@ +module.exports = require('../../es/weak-set'); diff --git a/core-js/stage/0.js b/core-js/stage/0.js new file mode 100644 index 0000000000..4f720f194a --- /dev/null +++ b/core-js/stage/0.js @@ -0,0 +1,5 @@ +require('../proposals/efficient-64-bit-arithmetic'); +require('../proposals/string-at'); +require('../proposals/url'); + +module.exports = require('./1'); diff --git a/core-js/stage/1.js b/core-js/stage/1.js new file mode 100644 index 0000000000..98b215ce52 --- /dev/null +++ b/core-js/stage/1.js @@ -0,0 +1,15 @@ +require('../proposals/array-last'); +require('../proposals/collection-methods'); +require('../proposals/collection-of-from'); +require('../proposals/keys-composition'); +require('../proposals/map-update-or-insert'); +require('../proposals/math-extensions'); +require('../proposals/math-signbit'); +require('../proposals/number-from-string'); +require('../proposals/observable'); +require('../proposals/pattern-matching'); +require('../proposals/promise-try'); +require('../proposals/seeded-random'); +require('../proposals/string-code-points'); + +module.exports = require('./2'); diff --git a/core-js/stage/2.js b/core-js/stage/2.js new file mode 100644 index 0000000000..b2a8b4d2a5 --- /dev/null +++ b/core-js/stage/2.js @@ -0,0 +1,7 @@ +require('../proposals/array-is-template-object'); +require('../proposals/promise-any'); +require('../proposals/set-methods'); +require('../proposals/string-replace-all'); +require('../proposals/using-statement'); + +module.exports = require('./3'); diff --git a/core-js/stage/3.js b/core-js/stage/3.js new file mode 100644 index 0000000000..b90990f5c1 --- /dev/null +++ b/core-js/stage/3.js @@ -0,0 +1,3 @@ +require('../proposals/global-this'); + +module.exports = require('./4'); diff --git a/core-js/stage/4.js b/core-js/stage/4.js new file mode 100644 index 0000000000..ecd7460487 --- /dev/null +++ b/core-js/stage/4.js @@ -0,0 +1,4 @@ +require('../proposals/promise-all-settled'); +require('../proposals/string-match-all'); + +module.exports = require('../internals/path'); diff --git a/core-js/stage/README.md b/core-js/stage/README.md new file mode 100644 index 0000000000..0da7eaef6c --- /dev/null +++ b/core-js/stage/README.md @@ -0,0 +1 @@ +This folder contains entry points for [ECMAScript proposals](https://github.com/zloirock/core-js/tree/v3#ecmascript-proposals) with dependencies. diff --git a/core-js/stage/index.js b/core-js/stage/index.js new file mode 100644 index 0000000000..24dcf2e564 --- /dev/null +++ b/core-js/stage/index.js @@ -0,0 +1 @@ +module.exports = require('./pre'); diff --git a/core-js/stage/pre.js b/core-js/stage/pre.js new file mode 100644 index 0000000000..bc939d1637 --- /dev/null +++ b/core-js/stage/pre.js @@ -0,0 +1,3 @@ +require('../proposals/reflect-metadata'); + +module.exports = require('./0'); diff --git a/core-js/web/README.md b/core-js/web/README.md new file mode 100644 index 0000000000..40ff72acf3 --- /dev/null +++ b/core-js/web/README.md @@ -0,0 +1 @@ +This folder contains entry points for features from [WHATWG / W3C](https://github.com/zloirock/core-js/tree/v3#web-standards) with dependencies. diff --git a/core-js/web/dom-collections.js b/core-js/web/dom-collections.js new file mode 100644 index 0000000000..601c1ce660 --- /dev/null +++ b/core-js/web/dom-collections.js @@ -0,0 +1,4 @@ +require('../modules/web.dom-collections.for-each'); +require('../modules/web.dom-collections.iterator'); + +module.exports = require('../internals/path'); diff --git a/core-js/web/immediate.js b/core-js/web/immediate.js new file mode 100644 index 0000000000..19bb0f75da --- /dev/null +++ b/core-js/web/immediate.js @@ -0,0 +1,3 @@ +require('../modules/web.immediate'); + +module.exports = require('../internals/path'); diff --git a/core-js/web/index.js b/core-js/web/index.js new file mode 100644 index 0000000000..f1ea3aba97 --- /dev/null +++ b/core-js/web/index.js @@ -0,0 +1,10 @@ +require('../modules/web.dom-collections.for-each'); +require('../modules/web.dom-collections.iterator'); +require('../modules/web.immediate'); +require('../modules/web.queue-microtask'); +require('../modules/web.timers'); +require('../modules/web.url'); +require('../modules/web.url.to-json'); +require('../modules/web.url-search-params'); + +module.exports = require('../internals/path'); diff --git a/core-js/web/queue-microtask.js b/core-js/web/queue-microtask.js new file mode 100644 index 0000000000..10f9f30348 --- /dev/null +++ b/core-js/web/queue-microtask.js @@ -0,0 +1,4 @@ +require('../modules/web.queue-microtask'); +var path = require('../internals/path'); + +module.exports = path.queueMicrotask; diff --git a/core-js/web/timers.js b/core-js/web/timers.js new file mode 100644 index 0000000000..bf93612545 --- /dev/null +++ b/core-js/web/timers.js @@ -0,0 +1,3 @@ +require('../modules/web.timers'); + +module.exports = require('../internals/path'); diff --git a/core-js/web/url-search-params.js b/core-js/web/url-search-params.js new file mode 100644 index 0000000000..9434608bbb --- /dev/null +++ b/core-js/web/url-search-params.js @@ -0,0 +1,4 @@ +require('../modules/web.url-search-params'); +var path = require('../internals/path'); + +module.exports = path.URLSearchParams; diff --git a/core-js/web/url.js b/core-js/web/url.js new file mode 100644 index 0000000000..2faed2eddc --- /dev/null +++ b/core-js/web/url.js @@ -0,0 +1,6 @@ +require('../modules/web.url'); +require('../modules/web.url.to-json'); +require('../modules/web.url-search-params'); +var path = require('../internals/path'); + +module.exports = path.URL;