core-js 3.6.5 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +3 -2
- package/es/aggregate-error.js +6 -0
- package/es/array/virtual/filter-out.js +4 -0
- package/es/index.js +33 -29
- package/es/instance/replace-all.js +9 -0
- package/es/object/index.js +2 -1
- package/es/object/to-string.js +3 -2
- package/es/promise/all-settled.js +2 -0
- package/es/promise/any.js +14 -0
- package/es/promise/index.js +4 -2
- package/es/reflect/index.js +1 -0
- package/es/reflect/to-string-tag.js +3 -0
- package/es/string/index.js +1 -0
- package/es/string/replace-all.js +4 -0
- package/es/string/virtual/index.js +1 -0
- package/es/string/virtual/replace-all.js +4 -0
- package/es/symbol/index.js +2 -1
- package/es/symbol/to-string-tag.js +2 -1
- package/features/aggregate-error.js +4 -4
- package/features/array/at.js +4 -0
- package/features/array/filter-out.js +4 -0
- package/features/array/index.js +4 -0
- package/features/array/unique-by.js +5 -0
- package/features/array/virtual/at.js +4 -0
- package/features/array/virtual/filter-out.js +4 -0
- package/features/array/virtual/index.js +3 -0
- package/features/array/virtual/unique-by.js +5 -0
- package/features/bigint/index.js +4 -0
- package/features/bigint/range.js +4 -0
- package/features/instance/at.js +7 -3
- package/features/instance/filter-out.js +8 -0
- package/features/instance/replace-all.js +2 -8
- package/features/instance/unique-by.js +8 -0
- package/features/map/emplace.js +5 -0
- package/features/map/index.js +2 -0
- package/features/number/index.js +1 -0
- package/features/number/range.js +4 -0
- package/features/promise/any.js +4 -9
- package/features/reflect/to-string-tag.js +3 -0
- package/features/string/index.js +2 -0
- package/features/string/replace-all.js +4 -2
- package/features/string/virtual/index.js +2 -0
- package/features/string/virtual/replace-all.js +4 -2
- package/features/typed-array/at.js +1 -0
- package/features/typed-array/filter-out.js +1 -0
- package/features/typed-array/index.js +2 -0
- package/features/weak-map/emplace.js +5 -0
- package/features/weak-map/index.js +2 -0
- package/internals/add-to-unscopables.js +1 -1
- package/internals/advance-string-index.js +1 -1
- package/internals/array-buffer-view-core.js +13 -2
- package/internals/array-copy-within.js +1 -1
- package/internals/array-fill.js +1 -1
- package/internals/array-for-each.js +1 -1
- package/internals/array-from.js +1 -1
- package/internals/array-includes.js +2 -2
- package/internals/array-iteration.js +18 -11
- package/internals/array-last-index-of.js +1 -1
- package/internals/array-reduce.js +2 -2
- package/internals/array-species-create.js +1 -1
- package/internals/async-iterator-iteration.js +25 -6
- package/internals/call-with-safe-iteration-closing.js +2 -2
- package/internals/collection-from.js +5 -5
- package/internals/collection-strong.js +1 -1
- package/internals/collection-weak.js +1 -1
- package/internals/collection.js +1 -1
- package/internals/correct-is-regexp-logic.js +2 -2
- package/internals/create-html.js +1 -1
- package/internals/date-to-iso-string.js +1 -1
- package/internals/descriptors.js +1 -1
- package/internals/engine-is-node.js +4 -0
- package/internals/engine-is-webos-webkit.js +3 -0
- package/internals/function-bind.js +1 -1
- package/internals/get-substitution.js +40 -0
- package/internals/global.js +1 -1
- package/internals/internal-state.js +4 -1
- package/internals/is-array.js +1 -1
- package/internals/is-integer.js +1 -1
- package/internals/is-regexp.js +1 -1
- package/internals/iterate.js +26 -11
- package/internals/iterator-close.js +8 -0
- package/internals/iterators-core.js +1 -1
- package/internals/map-emplace.js +13 -0
- package/internals/math-expm1.js +1 -1
- package/internals/math-fround.js +1 -1
- package/internals/math-log1p.js +1 -1
- package/internals/math-sign.js +1 -1
- package/internals/microtask.js +10 -8
- package/internals/number-is-finite.js +1 -1
- package/internals/number-parse-float.js +1 -1
- package/internals/number-parse-int.js +1 -1
- package/internals/object-assign.js +1 -1
- package/internals/object-create.js +1 -1
- package/internals/object-define-properties.js +1 -1
- package/internals/object-define-property.js +1 -1
- package/internals/object-get-own-property-descriptor.js +1 -1
- package/internals/object-get-own-property-names.js +1 -1
- package/internals/object-get-prototype-of.js +1 -1
- package/internals/object-keys.js +1 -1
- package/internals/object-property-is-enumerable.js +1 -1
- package/internals/object-set-prototype-of.js +1 -1
- package/internals/object-to-array.js +2 -2
- package/internals/object-to-string.js +1 -1
- package/internals/range-iterator.js +102 -0
- package/internals/redefine.js +8 -2
- package/internals/regexp-exec-abstract.js +1 -1
- package/internals/regexp-flags.js +1 -1
- package/internals/require-object-coercible.js +1 -1
- package/internals/same-value-zero.js +1 -1
- package/internals/same-value.js +1 -1
- package/internals/shared.js +2 -2
- package/internals/species-constructor.js +1 -1
- package/internals/string-multibyte.js +1 -1
- package/internals/string-pad.js +2 -2
- package/internals/string-repeat.js +1 -1
- package/internals/string-trim.js +3 -3
- package/internals/task.js +4 -4
- package/internals/this-number-value.js +1 -1
- package/internals/to-index.js +1 -1
- package/internals/to-integer.js +1 -1
- package/internals/to-length.js +1 -1
- package/internals/to-object.js +1 -1
- package/internals/to-primitive.js +1 -1
- package/modules/es.aggregate-error.js +34 -0
- package/modules/es.array-buffer.constructor.js +1 -1
- package/modules/es.array-buffer.is-view.js +1 -1
- package/modules/es.array-buffer.slice.js +1 -1
- package/modules/es.array.concat.js +1 -1
- package/modules/es.array.copy-within.js +2 -2
- package/modules/es.array.every.js +1 -1
- package/modules/es.array.fill.js +2 -2
- package/modules/es.array.filter.js +1 -1
- package/modules/es.array.find-index.js +2 -2
- package/modules/es.array.find.js +2 -2
- package/modules/es.array.flat-map.js +1 -1
- package/modules/es.array.flat.js +1 -1
- package/modules/es.array.for-each.js +1 -1
- package/modules/es.array.from.js +1 -1
- package/modules/es.array.includes.js +2 -2
- package/modules/es.array.index-of.js +1 -1
- package/modules/es.array.is-array.js +1 -1
- package/modules/es.array.iterator.js +9 -9
- package/modules/es.array.join.js +1 -1
- package/modules/es.array.last-index-of.js +1 -1
- package/modules/es.array.map.js +1 -1
- package/modules/es.array.of.js +1 -1
- package/modules/es.array.reduce-right.js +7 -2
- package/modules/es.array.reduce.js +7 -2
- package/modules/es.array.reverse.js +1 -1
- package/modules/es.array.slice.js +1 -1
- package/modules/es.array.some.js +1 -1
- package/modules/es.array.sort.js +1 -1
- package/modules/es.array.species.js +1 -1
- package/modules/es.array.splice.js +1 -1
- package/modules/es.array.unscopables.flat-map.js +1 -0
- package/modules/es.array.unscopables.flat.js +1 -0
- package/modules/es.data-view.js +1 -1
- package/modules/es.date.now.js +1 -1
- package/modules/es.date.to-iso-string.js +1 -1
- package/modules/es.date.to-json.js +1 -1
- package/modules/es.date.to-primitive.js +1 -1
- package/modules/es.date.to-string.js +1 -1
- package/modules/es.function.bind.js +1 -1
- package/modules/es.function.has-instance.js +1 -1
- package/modules/es.function.name.js +1 -1
- package/modules/es.global-this.js +1 -1
- package/modules/es.json.stringify.js +2 -0
- package/modules/es.json.to-string-tag.js +1 -1
- package/modules/es.map.js +1 -1
- package/modules/es.math.acosh.js +1 -1
- package/modules/es.math.asinh.js +1 -1
- package/modules/es.math.atanh.js +1 -1
- package/modules/es.math.cbrt.js +1 -1
- package/modules/es.math.clz32.js +1 -1
- package/modules/es.math.cosh.js +1 -1
- package/modules/es.math.expm1.js +1 -1
- package/modules/es.math.fround.js +1 -1
- package/modules/es.math.hypot.js +1 -1
- package/modules/es.math.imul.js +1 -1
- package/modules/es.math.log10.js +1 -1
- package/modules/es.math.log1p.js +1 -1
- package/modules/es.math.log2.js +1 -1
- package/modules/es.math.sign.js +1 -1
- package/modules/es.math.sinh.js +1 -1
- package/modules/es.math.tanh.js +1 -1
- package/modules/es.math.to-string-tag.js +1 -1
- package/modules/es.math.trunc.js +1 -1
- package/modules/es.number.constructor.js +5 -3
- package/modules/es.number.epsilon.js +1 -1
- package/modules/es.number.is-finite.js +1 -1
- package/modules/es.number.is-integer.js +1 -1
- package/modules/es.number.is-nan.js +1 -1
- package/modules/es.number.is-safe-integer.js +1 -1
- package/modules/es.number.max-safe-integer.js +1 -1
- package/modules/es.number.min-safe-integer.js +1 -1
- package/modules/es.number.parse-float.js +1 -1
- package/modules/es.number.parse-int.js +1 -1
- package/modules/es.number.to-fixed.js +1 -1
- package/modules/es.number.to-precision.js +1 -1
- package/modules/es.object.assign.js +1 -1
- package/modules/es.object.create.js +1 -1
- package/modules/es.object.define-getter.js +1 -1
- package/modules/es.object.define-properties.js +1 -1
- package/modules/es.object.define-property.js +1 -1
- package/modules/es.object.define-setter.js +1 -1
- package/modules/es.object.entries.js +1 -1
- package/modules/es.object.freeze.js +1 -1
- package/modules/es.object.from-entries.js +1 -1
- package/modules/es.object.get-own-property-descriptor.js +1 -1
- package/modules/es.object.get-own-property-descriptors.js +1 -1
- package/modules/es.object.get-own-property-names.js +1 -1
- package/modules/es.object.get-prototype-of.js +1 -1
- package/modules/es.object.is-extensible.js +1 -1
- package/modules/es.object.is-frozen.js +1 -1
- package/modules/es.object.is-sealed.js +1 -1
- package/modules/es.object.is.js +1 -1
- package/modules/es.object.keys.js +1 -1
- package/modules/es.object.lookup-getter.js +1 -1
- package/modules/es.object.lookup-setter.js +1 -1
- package/modules/es.object.prevent-extensions.js +1 -1
- package/modules/es.object.seal.js +1 -1
- package/modules/es.object.set-prototype-of.js +1 -1
- package/modules/es.object.to-string.js +1 -1
- package/modules/es.object.values.js +1 -1
- package/modules/es.parse-float.js +1 -1
- package/modules/es.parse-int.js +1 -1
- package/modules/es.promise.all-settled.js +3 -3
- package/modules/es.promise.any.js +46 -0
- package/modules/es.promise.finally.js +1 -1
- package/modules/es.promise.js +33 -31
- package/modules/es.reflect.apply.js +1 -1
- package/modules/es.reflect.construct.js +1 -1
- package/modules/es.reflect.define-property.js +1 -1
- package/modules/es.reflect.delete-property.js +1 -1
- package/modules/es.reflect.get-own-property-descriptor.js +1 -1
- package/modules/es.reflect.get-prototype-of.js +1 -1
- package/modules/es.reflect.get.js +1 -1
- package/modules/es.reflect.has.js +1 -1
- package/modules/es.reflect.is-extensible.js +1 -1
- package/modules/es.reflect.own-keys.js +1 -1
- package/modules/es.reflect.prevent-extensions.js +1 -1
- package/modules/es.reflect.set-prototype-of.js +1 -1
- package/modules/es.reflect.set.js +4 -3
- package/modules/es.reflect.to-string-tag.js +9 -0
- package/modules/es.regexp.constructor.js +2 -2
- package/modules/es.regexp.exec.js +2 -0
- package/modules/es.regexp.flags.js +1 -1
- package/modules/es.regexp.sticky.js +1 -0
- package/modules/es.regexp.test.js +2 -0
- package/modules/es.regexp.to-string.js +1 -1
- package/modules/es.set.js +1 -1
- package/modules/es.string.anchor.js +1 -1
- package/modules/es.string.big.js +1 -1
- package/modules/es.string.blink.js +1 -1
- package/modules/es.string.bold.js +1 -1
- package/modules/es.string.code-point-at.js +1 -1
- package/modules/es.string.ends-with.js +1 -1
- package/modules/es.string.fixed.js +1 -1
- package/modules/es.string.fontcolor.js +1 -1
- package/modules/es.string.fontsize.js +1 -1
- package/modules/es.string.from-code-point.js +1 -1
- package/modules/es.string.includes.js +1 -1
- package/modules/es.string.italics.js +1 -1
- package/modules/es.string.iterator.js +2 -2
- package/modules/es.string.link.js +1 -1
- package/modules/es.string.match-all.js +1 -1
- package/modules/es.string.match.js +2 -2
- package/modules/es.string.pad-end.js +1 -1
- package/modules/es.string.pad-start.js +1 -1
- package/modules/es.string.raw.js +1 -1
- package/modules/es.string.repeat.js +1 -1
- package/modules/es.string.replace-all.js +67 -0
- package/modules/es.string.replace.js +3 -40
- package/modules/es.string.search.js +2 -2
- package/modules/es.string.small.js +1 -1
- package/modules/es.string.split.js +2 -2
- package/modules/es.string.starts-with.js +1 -1
- package/modules/es.string.strike.js +1 -1
- package/modules/es.string.sub.js +1 -1
- package/modules/es.string.sup.js +1 -1
- package/modules/es.string.trim-end.js +2 -1
- package/modules/es.string.trim-start.js +2 -1
- package/modules/es.string.trim.js +1 -1
- package/modules/es.symbol.async-iterator.js +1 -1
- package/modules/es.symbol.description.js +1 -1
- package/modules/es.symbol.has-instance.js +1 -1
- package/modules/es.symbol.is-concat-spreadable.js +1 -1
- package/modules/es.symbol.iterator.js +1 -1
- package/modules/es.symbol.js +12 -12
- package/modules/es.symbol.match-all.js +1 -0
- package/modules/es.symbol.match.js +1 -1
- package/modules/es.symbol.replace.js +1 -1
- package/modules/es.symbol.search.js +1 -1
- package/modules/es.symbol.species.js +1 -1
- package/modules/es.symbol.split.js +1 -1
- package/modules/es.symbol.to-primitive.js +1 -1
- package/modules/es.symbol.to-string-tag.js +1 -1
- package/modules/es.symbol.unscopables.js +1 -1
- package/modules/es.typed-array.copy-within.js +1 -1
- package/modules/es.typed-array.every.js +1 -1
- package/modules/es.typed-array.fill.js +1 -1
- package/modules/es.typed-array.filter.js +1 -1
- package/modules/es.typed-array.find-index.js +1 -1
- package/modules/es.typed-array.find.js +1 -1
- package/modules/es.typed-array.float32-array.js +1 -1
- package/modules/es.typed-array.float64-array.js +1 -1
- package/modules/es.typed-array.for-each.js +1 -1
- package/modules/es.typed-array.from.js +1 -1
- package/modules/es.typed-array.includes.js +1 -1
- package/modules/es.typed-array.index-of.js +1 -1
- package/modules/es.typed-array.int16-array.js +1 -1
- package/modules/es.typed-array.int32-array.js +1 -1
- package/modules/es.typed-array.int8-array.js +1 -1
- package/modules/es.typed-array.iterator.js +4 -4
- package/modules/es.typed-array.join.js +1 -1
- package/modules/es.typed-array.last-index-of.js +1 -1
- package/modules/es.typed-array.map.js +1 -1
- package/modules/es.typed-array.of.js +1 -1
- package/modules/es.typed-array.reduce-right.js +1 -1
- package/modules/es.typed-array.reduce.js +1 -1
- package/modules/es.typed-array.reverse.js +1 -1
- package/modules/es.typed-array.set.js +1 -1
- package/modules/es.typed-array.slice.js +1 -1
- package/modules/es.typed-array.some.js +1 -1
- package/modules/es.typed-array.sort.js +1 -1
- package/modules/es.typed-array.subarray.js +1 -1
- package/modules/es.typed-array.to-locale-string.js +1 -1
- package/modules/es.typed-array.to-string.js +1 -1
- package/modules/es.typed-array.uint16-array.js +1 -1
- package/modules/es.typed-array.uint32-array.js +1 -1
- package/modules/es.typed-array.uint8-array.js +1 -1
- package/modules/es.typed-array.uint8-clamped-array.js +1 -1
- package/modules/es.weak-map.js +1 -1
- package/modules/es.weak-set.js +1 -1
- package/modules/esnext.aggregate-error.js +2 -45
- package/modules/esnext.array.at.js +20 -0
- package/modules/esnext.array.filter-out.js +14 -0
- package/modules/esnext.array.unique-by.js +38 -0
- package/modules/esnext.async-iterator.take.js +12 -3
- package/modules/esnext.bigint.range.js +14 -0
- package/modules/esnext.iterator.every.js +3 -3
- package/modules/esnext.iterator.find.js +3 -3
- package/modules/esnext.iterator.flat-map.js +21 -15
- package/modules/esnext.iterator.for-each.js +1 -1
- package/modules/esnext.iterator.reduce.js +1 -1
- package/modules/esnext.iterator.some.js +3 -3
- package/modules/esnext.iterator.take.js +4 -2
- package/modules/esnext.iterator.to-array.js +1 -1
- package/modules/esnext.map.emplace.js +10 -0
- package/modules/esnext.map.every.js +3 -3
- package/modules/esnext.map.filter.js +1 -1
- package/modules/esnext.map.find-key.js +3 -3
- package/modules/esnext.map.find.js +3 -3
- package/modules/esnext.map.includes.js +3 -3
- package/modules/esnext.map.key-of.js +3 -3
- package/modules/esnext.map.map-keys.js +1 -1
- package/modules/esnext.map.map-values.js +1 -1
- package/modules/esnext.map.merge.js +1 -1
- package/modules/esnext.map.reduce.js +1 -1
- package/modules/esnext.map.some.js +3 -3
- package/modules/esnext.map.update-or-insert.js +1 -1
- package/modules/esnext.map.upsert.js +2 -1
- package/modules/esnext.number.range.js +11 -0
- package/modules/esnext.observable.js +3 -3
- package/modules/esnext.promise.any.js +2 -46
- package/modules/esnext.reflect.get-metadata-keys.js +1 -1
- package/modules/esnext.set.every.js +3 -3
- package/modules/esnext.set.filter.js +1 -1
- package/modules/esnext.set.find.js +3 -3
- package/modules/esnext.set.is-disjoint-from.js +3 -3
- package/modules/esnext.set.is-subset-of.js +3 -3
- package/modules/esnext.set.is-superset-of.js +3 -3
- package/modules/esnext.set.join.js +1 -1
- package/modules/esnext.set.map.js +1 -1
- package/modules/esnext.set.reduce.js +1 -1
- package/modules/esnext.set.some.js +3 -3
- package/modules/esnext.set.union.js +1 -1
- package/modules/esnext.string.at-alternative.js +23 -0
- package/modules/esnext.string.at.js +6 -1
- package/modules/esnext.string.replace-all.js +2 -50
- package/modules/esnext.typed-array.at.js +17 -0
- package/modules/esnext.typed-array.filter-out.js +20 -0
- package/modules/esnext.weak-map.emplace.js +10 -0
- package/modules/esnext.weak-map.upsert.js +3 -2
- package/modules/web.queue-microtask.js +2 -3
- package/modules/web.url-search-params.js +1 -1
- package/package.json +1 -1
- package/proposals/array-filtering.js +3 -0
- package/proposals/array-unique.js +3 -0
- package/proposals/efficient-64-bit-arithmetic.js +1 -0
- package/proposals/map-upsert.js +4 -0
- package/proposals/number-range.js +3 -0
- package/proposals/object-iteration.js +1 -0
- package/proposals/relative-indexing-method.js +5 -0
- package/stable/aggregate-error.js +6 -0
- package/stable/instance/replace-all.js +3 -0
- package/stable/promise/any.js +3 -0
- package/stable/reflect/to-string-tag.js +3 -0
- package/stable/string/replace-all.js +3 -0
- package/stable/string/virtual/replace-all.js +3 -0
- package/stage/1.js +3 -0
- package/stage/3.js +1 -2
- package/stage/4.js +2 -0
|
@@ -10,14 +10,14 @@ var regExpExec = require('../internals/regexp-exec-abstract');
|
|
|
10
10
|
fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
|
11
11
|
return [
|
|
12
12
|
// `String.prototype.match` method
|
|
13
|
-
// https://tc39.
|
|
13
|
+
// https://tc39.es/ecma262/#sec-string.prototype.match
|
|
14
14
|
function match(regexp) {
|
|
15
15
|
var O = requireObjectCoercible(this);
|
|
16
16
|
var matcher = regexp == undefined ? undefined : regexp[MATCH];
|
|
17
17
|
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
|
18
18
|
},
|
|
19
19
|
// `RegExp.prototype[@@match]` method
|
|
20
|
-
// https://tc39.
|
|
20
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
|
|
21
21
|
function (regexp) {
|
|
22
22
|
var res = maybeCallNative(nativeMatch, regexp, this);
|
|
23
23
|
if (res.done) return res.value;
|
|
@@ -4,7 +4,7 @@ var $padEnd = require('../internals/string-pad').end;
|
|
|
4
4
|
var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');
|
|
5
5
|
|
|
6
6
|
// `String.prototype.padEnd` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-string.prototype.padend
|
|
8
8
|
$({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
|
|
9
9
|
padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
|
|
10
10
|
return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
|
|
@@ -4,7 +4,7 @@ var $padStart = require('../internals/string-pad').start;
|
|
|
4
4
|
var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');
|
|
5
5
|
|
|
6
6
|
// `String.prototype.padStart` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-string.prototype.padstart
|
|
8
8
|
$({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
|
|
9
9
|
padStart: function padStart(maxLength /* , fillString = ' ' */) {
|
|
10
10
|
return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
|
package/modules/es.string.raw.js
CHANGED
|
@@ -3,7 +3,7 @@ var toIndexedObject = require('../internals/to-indexed-object');
|
|
|
3
3
|
var toLength = require('../internals/to-length');
|
|
4
4
|
|
|
5
5
|
// `String.raw` method
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-string.raw
|
|
7
7
|
$({ target: 'String', stat: true }, {
|
|
8
8
|
raw: function raw(template) {
|
|
9
9
|
var rawTemplate = toIndexedObject(template.raw);
|
|
@@ -2,7 +2,7 @@ var $ = require('../internals/export');
|
|
|
2
2
|
var repeat = require('../internals/string-repeat');
|
|
3
3
|
|
|
4
4
|
// `String.prototype.repeat` method
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-string.prototype.repeat
|
|
6
6
|
$({ target: 'String', proto: true }, {
|
|
7
7
|
repeat: repeat
|
|
8
8
|
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var $ = require('../internals/export');
|
|
3
|
+
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
4
|
+
var isRegExp = require('../internals/is-regexp');
|
|
5
|
+
var getRegExpFlags = require('../internals/regexp-flags');
|
|
6
|
+
var getSubstitution = require('../internals/get-substitution');
|
|
7
|
+
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
8
|
+
var IS_PURE = require('../internals/is-pure');
|
|
9
|
+
|
|
10
|
+
var REPLACE = wellKnownSymbol('replace');
|
|
11
|
+
var RegExpPrototype = RegExp.prototype;
|
|
12
|
+
var max = Math.max;
|
|
13
|
+
|
|
14
|
+
var stringIndexOf = function (string, searchValue, fromIndex) {
|
|
15
|
+
if (fromIndex > string.length) return -1;
|
|
16
|
+
if (searchValue === '') return fromIndex;
|
|
17
|
+
return string.indexOf(searchValue, fromIndex);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// `String.prototype.replaceAll` method
|
|
21
|
+
// https://tc39.es/ecma262/#sec-string.prototype.replaceall
|
|
22
|
+
$({ target: 'String', proto: true }, {
|
|
23
|
+
replaceAll: function replaceAll(searchValue, replaceValue) {
|
|
24
|
+
var O = requireObjectCoercible(this);
|
|
25
|
+
var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
|
|
26
|
+
var position = 0;
|
|
27
|
+
var endOfLastMatch = 0;
|
|
28
|
+
var result = '';
|
|
29
|
+
if (searchValue != null) {
|
|
30
|
+
IS_REG_EXP = isRegExp(searchValue);
|
|
31
|
+
if (IS_REG_EXP) {
|
|
32
|
+
flags = String(requireObjectCoercible('flags' in RegExpPrototype
|
|
33
|
+
? searchValue.flags
|
|
34
|
+
: getRegExpFlags.call(searchValue)
|
|
35
|
+
));
|
|
36
|
+
if (!~flags.indexOf('g')) throw TypeError('`.replaceAll` does not allow non-global regexes');
|
|
37
|
+
}
|
|
38
|
+
replacer = searchValue[REPLACE];
|
|
39
|
+
if (replacer !== undefined) {
|
|
40
|
+
return replacer.call(searchValue, O, replaceValue);
|
|
41
|
+
} else if (IS_PURE && IS_REG_EXP) {
|
|
42
|
+
return String(O).replace(searchValue, replaceValue);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
string = String(O);
|
|
46
|
+
searchString = String(searchValue);
|
|
47
|
+
functionalReplace = typeof replaceValue === 'function';
|
|
48
|
+
if (!functionalReplace) replaceValue = String(replaceValue);
|
|
49
|
+
searchLength = searchString.length;
|
|
50
|
+
advanceBy = max(1, searchLength);
|
|
51
|
+
position = stringIndexOf(string, searchString, 0);
|
|
52
|
+
while (position !== -1) {
|
|
53
|
+
if (functionalReplace) {
|
|
54
|
+
replacement = String(replaceValue(searchString, position, string));
|
|
55
|
+
} else {
|
|
56
|
+
replacement = getSubstitution(searchString, string, position, [], undefined, replaceValue);
|
|
57
|
+
}
|
|
58
|
+
result += string.slice(endOfLastMatch, position) + replacement;
|
|
59
|
+
endOfLastMatch = position + searchLength;
|
|
60
|
+
position = stringIndexOf(string, searchString, position + advanceBy);
|
|
61
|
+
}
|
|
62
|
+
if (endOfLastMatch < string.length) {
|
|
63
|
+
result += string.slice(endOfLastMatch);
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');
|
|
3
3
|
var anObject = require('../internals/an-object');
|
|
4
|
-
var toObject = require('../internals/to-object');
|
|
5
4
|
var toLength = require('../internals/to-length');
|
|
6
5
|
var toInteger = require('../internals/to-integer');
|
|
7
6
|
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
8
7
|
var advanceStringIndex = require('../internals/advance-string-index');
|
|
8
|
+
var getSubstitution = require('../internals/get-substitution');
|
|
9
9
|
var regExpExec = require('../internals/regexp-exec-abstract');
|
|
10
10
|
|
|
11
11
|
var max = Math.max;
|
|
12
12
|
var min = Math.min;
|
|
13
|
-
var floor = Math.floor;
|
|
14
|
-
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
|
15
|
-
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
|
16
13
|
|
|
17
14
|
var maybeToString = function (it) {
|
|
18
15
|
return it === undefined ? it : String(it);
|
|
@@ -26,7 +23,7 @@ fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, ma
|
|
|
26
23
|
|
|
27
24
|
return [
|
|
28
25
|
// `String.prototype.replace` method
|
|
29
|
-
// https://tc39.
|
|
26
|
+
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
30
27
|
function replace(searchValue, replaceValue) {
|
|
31
28
|
var O = requireObjectCoercible(this);
|
|
32
29
|
var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
|
@@ -35,7 +32,7 @@ fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, ma
|
|
|
35
32
|
: nativeReplace.call(String(O), searchValue, replaceValue);
|
|
36
33
|
},
|
|
37
34
|
// `RegExp.prototype[@@replace]` method
|
|
38
|
-
// https://tc39.
|
|
35
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
39
36
|
function (regexp, replaceValue) {
|
|
40
37
|
if (
|
|
41
38
|
(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
|
|
@@ -98,38 +95,4 @@ fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, ma
|
|
|
98
95
|
return accumulatedResult + S.slice(nextSourcePosition);
|
|
99
96
|
}
|
|
100
97
|
];
|
|
101
|
-
|
|
102
|
-
// https://tc39.github.io/ecma262/#sec-getsubstitution
|
|
103
|
-
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
|
|
104
|
-
var tailPos = position + matched.length;
|
|
105
|
-
var m = captures.length;
|
|
106
|
-
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
107
|
-
if (namedCaptures !== undefined) {
|
|
108
|
-
namedCaptures = toObject(namedCaptures);
|
|
109
|
-
symbols = SUBSTITUTION_SYMBOLS;
|
|
110
|
-
}
|
|
111
|
-
return nativeReplace.call(replacement, symbols, function (match, ch) {
|
|
112
|
-
var capture;
|
|
113
|
-
switch (ch.charAt(0)) {
|
|
114
|
-
case '$': return '$';
|
|
115
|
-
case '&': return matched;
|
|
116
|
-
case '`': return str.slice(0, position);
|
|
117
|
-
case "'": return str.slice(tailPos);
|
|
118
|
-
case '<':
|
|
119
|
-
capture = namedCaptures[ch.slice(1, -1)];
|
|
120
|
-
break;
|
|
121
|
-
default: // \d\d?
|
|
122
|
-
var n = +ch;
|
|
123
|
-
if (n === 0) return match;
|
|
124
|
-
if (n > m) {
|
|
125
|
-
var f = floor(n / 10);
|
|
126
|
-
if (f === 0) return match;
|
|
127
|
-
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
|
128
|
-
return match;
|
|
129
|
-
}
|
|
130
|
-
capture = captures[n - 1];
|
|
131
|
-
}
|
|
132
|
-
return capture === undefined ? '' : capture;
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
98
|
});
|
|
@@ -9,14 +9,14 @@ var regExpExec = require('../internals/regexp-exec-abstract');
|
|
|
9
9
|
fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
|
10
10
|
return [
|
|
11
11
|
// `String.prototype.search` method
|
|
12
|
-
// https://tc39.
|
|
12
|
+
// https://tc39.es/ecma262/#sec-string.prototype.search
|
|
13
13
|
function search(regexp) {
|
|
14
14
|
var O = requireObjectCoercible(this);
|
|
15
15
|
var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
|
16
16
|
return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
|
17
17
|
},
|
|
18
18
|
// `RegExp.prototype[@@search]` method
|
|
19
|
-
// https://tc39.
|
|
19
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@search
|
|
20
20
|
function (regexp) {
|
|
21
21
|
var res = maybeCallNative(nativeSearch, regexp, this);
|
|
22
22
|
if (res.done) return res.value;
|
|
@@ -4,7 +4,7 @@ var createHTML = require('../internals/create-html');
|
|
|
4
4
|
var forcedStringHTMLMethod = require('../internals/string-html-forced');
|
|
5
5
|
|
|
6
6
|
// `String.prototype.small` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-string.prototype.small
|
|
8
8
|
$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('small') }, {
|
|
9
9
|
small: function small() {
|
|
10
10
|
return createHTML(this, 'small', '', '');
|
|
@@ -72,7 +72,7 @@ fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal
|
|
|
72
72
|
|
|
73
73
|
return [
|
|
74
74
|
// `String.prototype.split` method
|
|
75
|
-
// https://tc39.
|
|
75
|
+
// https://tc39.es/ecma262/#sec-string.prototype.split
|
|
76
76
|
function split(separator, limit) {
|
|
77
77
|
var O = requireObjectCoercible(this);
|
|
78
78
|
var splitter = separator == undefined ? undefined : separator[SPLIT];
|
|
@@ -81,7 +81,7 @@ fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal
|
|
|
81
81
|
: internalSplit.call(String(O), separator, limit);
|
|
82
82
|
},
|
|
83
83
|
// `RegExp.prototype[@@split]` method
|
|
84
|
-
// https://tc39.
|
|
84
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
|
|
85
85
|
//
|
|
86
86
|
// NOTE: This cannot be properly polyfilled in engines that don't support
|
|
87
87
|
// the 'y' flag.
|
|
@@ -18,7 +18,7 @@ var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
|
|
18
18
|
}();
|
|
19
19
|
|
|
20
20
|
// `String.prototype.startsWith` method
|
|
21
|
-
// https://tc39.
|
|
21
|
+
// https://tc39.es/ecma262/#sec-string.prototype.startswith
|
|
22
22
|
$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
|
23
23
|
startsWith: function startsWith(searchString /* , position = 0 */) {
|
|
24
24
|
var that = String(requireObjectCoercible(this));
|
|
@@ -4,7 +4,7 @@ var createHTML = require('../internals/create-html');
|
|
|
4
4
|
var forcedStringHTMLMethod = require('../internals/string-html-forced');
|
|
5
5
|
|
|
6
6
|
// `String.prototype.strike` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-string.prototype.strike
|
|
8
8
|
$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('strike') }, {
|
|
9
9
|
strike: function strike() {
|
|
10
10
|
return createHTML(this, 'strike', '', '');
|
package/modules/es.string.sub.js
CHANGED
|
@@ -4,7 +4,7 @@ var createHTML = require('../internals/create-html');
|
|
|
4
4
|
var forcedStringHTMLMethod = require('../internals/string-html-forced');
|
|
5
5
|
|
|
6
6
|
// `String.prototype.sub` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-string.prototype.sub
|
|
8
8
|
$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sub') }, {
|
|
9
9
|
sub: function sub() {
|
|
10
10
|
return createHTML(this, 'sub', '', '');
|
package/modules/es.string.sup.js
CHANGED
|
@@ -4,7 +4,7 @@ var createHTML = require('../internals/create-html');
|
|
|
4
4
|
var forcedStringHTMLMethod = require('../internals/string-html-forced');
|
|
5
5
|
|
|
6
6
|
// `String.prototype.sup` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-string.prototype.sup
|
|
8
8
|
$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, {
|
|
9
9
|
sup: function sup() {
|
|
10
10
|
return createHTML(this, 'sup', '', '');
|
|
@@ -10,7 +10,8 @@ var trimEnd = FORCED ? function trimEnd() {
|
|
|
10
10
|
} : ''.trimEnd;
|
|
11
11
|
|
|
12
12
|
// `String.prototype.{ trimEnd, trimRight }` methods
|
|
13
|
-
// https://
|
|
13
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
14
|
+
// https://tc39.es/ecma262/#String.prototype.trimright
|
|
14
15
|
$({ target: 'String', proto: true, forced: FORCED }, {
|
|
15
16
|
trimEnd: trimEnd,
|
|
16
17
|
trimRight: trimEnd
|
|
@@ -10,7 +10,8 @@ var trimStart = FORCED ? function trimStart() {
|
|
|
10
10
|
} : ''.trimStart;
|
|
11
11
|
|
|
12
12
|
// `String.prototype.{ trimStart, trimLeft }` methods
|
|
13
|
-
// https://
|
|
13
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
14
|
+
// https://tc39.es/ecma262/#String.prototype.trimleft
|
|
14
15
|
$({ target: 'String', proto: true, forced: FORCED }, {
|
|
15
16
|
trimStart: trimStart,
|
|
16
17
|
trimLeft: trimStart
|
|
@@ -4,7 +4,7 @@ var $trim = require('../internals/string-trim').trim;
|
|
|
4
4
|
var forcedStringTrimMethod = require('../internals/string-trim-forced');
|
|
5
5
|
|
|
6
6
|
// `String.prototype.trim` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
8
8
|
$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
9
9
|
trim: function trim() {
|
|
10
10
|
return $trim(this);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var defineWellKnownSymbol = require('../internals/define-well-known-symbol');
|
|
2
2
|
|
|
3
3
|
// `Symbol.asyncIterator` well-known symbol
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-symbol.asynciterator
|
|
5
5
|
defineWellKnownSymbol('asyncIterator');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// `Symbol.prototype.description` getter
|
|
2
|
-
// https://tc39.
|
|
2
|
+
// https://tc39.es/ecma262/#sec-symbol.prototype.description
|
|
3
3
|
'use strict';
|
|
4
4
|
var $ = require('../internals/export');
|
|
5
5
|
var DESCRIPTORS = require('../internals/descriptors');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var defineWellKnownSymbol = require('../internals/define-well-known-symbol');
|
|
2
2
|
|
|
3
3
|
// `Symbol.hasInstance` well-known symbol
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-symbol.hasinstance
|
|
5
5
|
defineWellKnownSymbol('hasInstance');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var defineWellKnownSymbol = require('../internals/define-well-known-symbol');
|
|
2
2
|
|
|
3
3
|
// `Symbol.isConcatSpreadable` well-known symbol
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
|
|
5
5
|
defineWellKnownSymbol('isConcatSpreadable');
|
package/modules/es.symbol.js
CHANGED
|
@@ -159,7 +159,7 @@ var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
|
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
// `Symbol` constructor
|
|
162
|
-
// https://tc39.
|
|
162
|
+
// https://tc39.es/ecma262/#sec-symbol-constructor
|
|
163
163
|
if (!NATIVE_SYMBOL) {
|
|
164
164
|
$Symbol = function Symbol() {
|
|
165
165
|
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
|
|
@@ -216,7 +216,7 @@ $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
|
|
216
216
|
|
|
217
217
|
$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
|
218
218
|
// `Symbol.for` method
|
|
219
|
-
// https://tc39.
|
|
219
|
+
// https://tc39.es/ecma262/#sec-symbol.for
|
|
220
220
|
'for': function (key) {
|
|
221
221
|
var string = String(key);
|
|
222
222
|
if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
|
@@ -226,7 +226,7 @@ $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
|
|
226
226
|
return symbol;
|
|
227
227
|
},
|
|
228
228
|
// `Symbol.keyFor` method
|
|
229
|
-
// https://tc39.
|
|
229
|
+
// https://tc39.es/ecma262/#sec-symbol.keyfor
|
|
230
230
|
keyFor: function keyFor(sym) {
|
|
231
231
|
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
|
232
232
|
if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
|
@@ -237,25 +237,25 @@ $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
|
|
237
237
|
|
|
238
238
|
$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
|
|
239
239
|
// `Object.create` method
|
|
240
|
-
// https://tc39.
|
|
240
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
241
241
|
create: $create,
|
|
242
242
|
// `Object.defineProperty` method
|
|
243
|
-
// https://tc39.
|
|
243
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
244
244
|
defineProperty: $defineProperty,
|
|
245
245
|
// `Object.defineProperties` method
|
|
246
|
-
// https://tc39.
|
|
246
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
247
247
|
defineProperties: $defineProperties,
|
|
248
248
|
// `Object.getOwnPropertyDescriptor` method
|
|
249
|
-
// https://tc39.
|
|
249
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
|
|
250
250
|
getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
|
251
251
|
});
|
|
252
252
|
|
|
253
253
|
$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
|
|
254
254
|
// `Object.getOwnPropertyNames` method
|
|
255
|
-
// https://tc39.
|
|
255
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
256
256
|
getOwnPropertyNames: $getOwnPropertyNames,
|
|
257
257
|
// `Object.getOwnPropertySymbols` method
|
|
258
|
-
// https://tc39.
|
|
258
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
|
|
259
259
|
getOwnPropertySymbols: $getOwnPropertySymbols
|
|
260
260
|
});
|
|
261
261
|
|
|
@@ -268,7 +268,7 @@ $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymb
|
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
// `JSON.stringify` method behavior with symbols
|
|
271
|
-
// https://tc39.
|
|
271
|
+
// https://tc39.es/ecma262/#sec-json.stringify
|
|
272
272
|
if ($stringify) {
|
|
273
273
|
var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
|
|
274
274
|
var symbol = $Symbol();
|
|
@@ -300,12 +300,12 @@ if ($stringify) {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
// `Symbol.prototype[@@toPrimitive]` method
|
|
303
|
-
// https://tc39.
|
|
303
|
+
// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
|
304
304
|
if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
|
|
305
305
|
createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
|
306
306
|
}
|
|
307
307
|
// `Symbol.prototype[@@toStringTag]` property
|
|
308
|
-
// https://tc39.
|
|
308
|
+
// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
|
|
309
309
|
setToStringTag($Symbol, SYMBOL);
|
|
310
310
|
|
|
311
311
|
hiddenKeys[HIDDEN] = true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var defineWellKnownSymbol = require('../internals/define-well-known-symbol');
|
|
2
2
|
|
|
3
3
|
// `Symbol.toPrimitive` well-known symbol
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-symbol.toprimitive
|
|
5
5
|
defineWellKnownSymbol('toPrimitive');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var defineWellKnownSymbol = require('../internals/define-well-known-symbol');
|
|
2
2
|
|
|
3
3
|
// `Symbol.toStringTag` well-known symbol
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-symbol.tostringtag
|
|
5
5
|
defineWellKnownSymbol('toStringTag');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var defineWellKnownSymbol = require('../internals/define-well-known-symbol');
|
|
2
2
|
|
|
3
3
|
// `Symbol.unscopables` well-known symbol
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-symbol.unscopables
|
|
5
5
|
defineWellKnownSymbol('unscopables');
|
|
@@ -6,7 +6,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
6
6
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
7
7
|
|
|
8
8
|
// `%TypedArray%.prototype.copyWithin` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin
|
|
10
10
|
exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {
|
|
11
11
|
return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
|
|
12
12
|
});
|
|
@@ -6,7 +6,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
6
6
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
7
7
|
|
|
8
8
|
// `%TypedArray%.prototype.every` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every
|
|
10
10
|
exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {
|
|
11
11
|
return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
12
12
|
});
|
|
@@ -6,7 +6,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
6
6
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
7
7
|
|
|
8
8
|
// `%TypedArray%.prototype.fill` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
|
|
10
10
|
// eslint-disable-next-line no-unused-vars
|
|
11
11
|
exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
|
|
12
12
|
return $fill.apply(aTypedArray(this), arguments);
|
|
@@ -8,7 +8,7 @@ var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
|
|
8
8
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
9
9
|
|
|
10
10
|
// `%TypedArray%.prototype.filter` method
|
|
11
|
-
// https://tc39.
|
|
11
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter
|
|
12
12
|
exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {
|
|
13
13
|
var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
14
14
|
var C = speciesConstructor(this, this.constructor);
|
|
@@ -6,7 +6,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
6
6
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
7
7
|
|
|
8
8
|
// `%TypedArray%.prototype.findIndex` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex
|
|
10
10
|
exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {
|
|
11
11
|
return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
|
12
12
|
});
|
|
@@ -6,7 +6,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
6
6
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
7
7
|
|
|
8
8
|
// `%TypedArray%.prototype.find` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find
|
|
10
10
|
exportTypedArrayMethod('find', function find(predicate /* , thisArg */) {
|
|
11
11
|
return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
|
12
12
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var createTypedArrayConstructor = require('../internals/typed-array-constructor');
|
|
2
2
|
|
|
3
3
|
// `Float32Array` constructor
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-typedarray-objects
|
|
5
5
|
createTypedArrayConstructor('Float32', function (init) {
|
|
6
6
|
return function Float32Array(data, byteOffset, length) {
|
|
7
7
|
return init(this, data, byteOffset, length);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var createTypedArrayConstructor = require('../internals/typed-array-constructor');
|
|
2
2
|
|
|
3
3
|
// `Float64Array` constructor
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-typedarray-objects
|
|
5
5
|
createTypedArrayConstructor('Float64', function (init) {
|
|
6
6
|
return function Float64Array(data, byteOffset, length) {
|
|
7
7
|
return init(this, data, byteOffset, length);
|
|
@@ -6,7 +6,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
6
6
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
7
7
|
|
|
8
8
|
// `%TypedArray%.prototype.forEach` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach
|
|
10
10
|
exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {
|
|
11
11
|
$forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
12
12
|
});
|
|
@@ -4,5 +4,5 @@ var exportTypedArrayStaticMethod = require('../internals/array-buffer-view-core'
|
|
|
4
4
|
var typedArrayFrom = require('../internals/typed-array-from');
|
|
5
5
|
|
|
6
6
|
// `%TypedArray%.from` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.from
|
|
8
8
|
exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
|