X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Fmodules%2Fes.array.slice.js;h=287b1ec69c2ca00086d1807fe5d7c9d2aa2f8545;hp=3cf306a8ec83f93075ef01346ef669aa7e56f51a;hb=3be0a9efc698a9570a44456009afc6014812625a;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088 diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.array.slice.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.array.slice.js index 3cf306a8..287b1ec6 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.array.slice.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.array.slice.js @@ -1,18 +1,21 @@ 'use strict'; var $ = require('../internals/export'); -var isObject = require('../internals/is-object'); +var global = require('../internals/global'); var isArray = require('../internals/is-array'); +var isConstructor = require('../internals/is-constructor'); +var isObject = require('../internals/is-object'); var toAbsoluteIndex = require('../internals/to-absolute-index'); -var toLength = require('../internals/to-length'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); var toIndexedObject = require('../internals/to-indexed-object'); var createProperty = require('../internals/create-property'); var wellKnownSymbol = require('../internals/well-known-symbol'); var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); +var un$Slice = require('../internals/array-slice'); var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); var SPECIES = wellKnownSymbol('species'); -var nativeSlice = [].slice; +var Array = global.Array; var max = Math.max; // `Array.prototype.slice` method @@ -21,7 +24,7 @@ var max = Math.max; $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { slice: function slice(start, end) { var O = toIndexedObject(this); - var length = toLength(O.length); + var length = lengthOfArrayLike(O); var k = toAbsoluteIndex(start, length); var fin = toAbsoluteIndex(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible @@ -29,14 +32,14 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { if (isArray(O)) { Constructor = O.constructor; // cross-realm fallback - if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { + if (isConstructor(Constructor) && (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); + return un$Slice(O, k, fin); } } result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));