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.string.match-all.js;h=e5762782e469b0e50c8efd6754bf85b7727e73e2;hp=fe1e94a8d969de0a29f1bf965fca74795af845dc;hb=3be0a9efc698a9570a44456009afc6014812625a;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088 diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.match-all.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.match-all.js index fe1e94a8..e5762782 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.match-all.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.match-all.js @@ -1,18 +1,25 @@ 'use strict'; +/* eslint-disable es/no-string-prototype-matchall -- safe */ var $ = require('../internals/export'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); 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 toString = require('../internals/to-string'); var anObject = require('../internals/an-object'); var classof = require('../internals/classof-raw'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); var isRegExp = require('../internals/is-regexp'); -var getRegExpFlags = require('../internals/regexp-flags'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var regExpFlags = require('../internals/regexp-flags'); +var getMethod = require('../internals/get-method'); +var redefine = require('../internals/redefine'); var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var speciesConstructor = require('../internals/species-constructor'); var advanceStringIndex = require('../internals/advance-string-index'); +var regExpExec = require('../internals/regexp-exec-abstract'); var InternalStateModule = require('../internals/internal-state'); var IS_PURE = require('../internals/is-pure'); @@ -22,30 +29,21 @@ 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 nativeMatchAll = ''.matchAll; +var TypeError = global.TypeError; +var getFlags = uncurryThis(regExpFlags); +var stringIndexOf = uncurryThis(''.indexOf); +var un$MatchAll = uncurryThis(''.matchAll); -var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function () { - 'a'.matchAll(/./); +var WORKS_WITH_NON_GLOBAL_REGEX = !!un$MatchAll && !fails(function () { + un$MatchAll('a', /./); }); -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 -- ignore -var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) { +var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, $global, fullUnicode) { setInternalState(this, { type: REGEXP_STRING_ITERATOR, regexp: regexp, string: string, - global: global, + global: $global, unicode: fullUnicode, done: false }); @@ -57,7 +55,7 @@ var $RegExpStringIterator = createIteratorConstructor(function RegExpStringItera 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); + if (toString(match[0]) === '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode); return { value: match, done: false }; } state.done = true; @@ -66,19 +64,19 @@ var $RegExpStringIterator = createIteratorConstructor(function RegExpStringItera var $matchAll = function (string) { var R = anObject(this); - var S = String(string); - var C, flagsValue, flags, matcher, global, fullUnicode; + var S = toString(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 = getRegExpFlags.call(R); + if (flagsValue === undefined && isPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype)) { + flagsValue = getFlags(R); } - flags = flagsValue === undefined ? '' : String(flagsValue); + flags = flagsValue === undefined ? '' : toString(flagsValue); matcher = new C(C === RegExp ? R.source : R, flags); - global = !!~flags.indexOf('g'); - fullUnicode = !!~flags.indexOf('u'); + $global = !!~stringIndexOf(flags, 'g'); + fullUnicode = !!~stringIndexOf(flags, 'u'); matcher.lastIndex = toLength(R.lastIndex); - return new $RegExpStringIterator(matcher, S, global, fullUnicode); + return new $RegExpStringIterator(matcher, S, $global, fullUnicode); }; // `String.prototype.matchAll` method @@ -89,21 +87,21 @@ $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { var flags, S, matcher, rx; if (regexp != null) { if (isRegExp(regexp)) { - flags = String(requireObjectCoercible('flags' in RegExpPrototype + flags = toString(requireObjectCoercible('flags' in RegExpPrototype ? regexp.flags - : getRegExpFlags.call(regexp) + : getFlags(regexp) )); - if (!~flags.indexOf('g')) throw TypeError('`.matchAll` does not allow non-global regexes'); + if (!~stringIndexOf(flags, 'g')) throw TypeError('`.matchAll` does not allow non-global regexes'); } - if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments); - matcher = regexp[MATCH_ALL]; + if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp); + matcher = getMethod(regexp, MATCH_ALL); if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll; - if (matcher != null) return aFunction(matcher).call(regexp, O); - } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments); - S = String(O); + if (matcher) return call(matcher, regexp, O); + } else if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp); + S = toString(O); rx = new RegExp(regexp, 'g'); - return IS_PURE ? $matchAll.call(rx, S) : rx[MATCH_ALL](S); + return IS_PURE ? call($matchAll, rx, S) : rx[MATCH_ALL](S); } }); -IS_PURE || MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll); +IS_PURE || MATCH_ALL in RegExpPrototype || redefine(RegExpPrototype, MATCH_ALL, $matchAll);