From 26fa49f4b0aa658d65a21fffe828f39e78302573 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 17:46:58 +0800 Subject: [PATCH] Revert "Update#139889 [ 快速篩選 ] 年資文案調整" --- PAMapp/node_modules/core-js/modules/es.string.split.js | 39 +++++++++++++++++++++++---------------- 1 files changed, 23 insertions(+), 16 deletions(-) diff --git a/PAMapp/node_modules/core-js/modules/es.string.split.js b/PAMapp/node_modules/core-js/modules/es.string.split.js index 2b45da0..849f4e2 100644 --- a/PAMapp/node_modules/core-js/modules/es.string.split.js +++ b/PAMapp/node_modules/core-js/modules/es.string.split.js @@ -1,4 +1,7 @@ 'use strict'; +var apply = require('../internals/function-apply'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); var isRegExp = require('../internals/is-regexp'); var anObject = require('../internals/an-object'); @@ -8,15 +11,19 @@ var toLength = require('../internals/to-length'); var toString = require('../internals/to-string'); var getMethod = require('../internals/get-method'); +var arraySlice = require('../internals/array-slice-simple'); var callRegExpExec = require('../internals/regexp-exec-abstract'); var regexpExec = require('../internals/regexp-exec'); var stickyHelpers = require('../internals/regexp-sticky-helpers'); var fails = require('../internals/fails'); var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; -var arrayPush = [].push; -var min = Math.min; var MAX_UINT32 = 0xFFFFFFFF; +var min = Math.min; +var $push = [].push; +var exec = uncurryThis(/./.exec); +var push = uncurryThis($push); +var stringSlice = uncurryThis(''.slice); // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper @@ -50,7 +57,7 @@ if (separator === undefined) return [string]; // If `separator` is not a regex, use native split if (!isRegExp(separator)) { - return nativeSplit.call(string, separator, lim); + return call(nativeSplit, string, separator, lim); } var output = []; var flags = (separator.ignoreCase ? 'i' : '') + @@ -61,11 +68,11 @@ // 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)) { + while (match = call(regexpExec, 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)); + push(output, stringSlice(string, lastLastIndex, match.index)); + if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1)); lastLength = match[0].length; lastLastIndex = lastIndex; if (output.length >= lim) break; @@ -73,14 +80,14 @@ 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; + if (lastLength || !exec(separatorCopy, '')) push(output, ''); + } else push(output, stringSlice(string, lastLastIndex)); + return output.length > lim ? arraySlice(output, 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); + return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit); }; } else internalSplit = nativeSplit; @@ -91,8 +98,8 @@ var O = requireObjectCoercible(this); var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT); return splitter - ? splitter.call(separator, O, limit) - : internalSplit.call(toString(O), separator, limit); + ? call(splitter, separator, O, limit) + : call(internalSplit, toString(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split @@ -125,7 +132,7 @@ var A = []; while (q < S.length) { splitter.lastIndex = UNSUPPORTED_Y ? 0 : q; - var z = callRegExpExec(splitter, UNSUPPORTED_Y ? S.slice(q) : S); + var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S); var e; if ( z === null || @@ -133,16 +140,16 @@ ) { q = advanceStringIndex(S, q, unicodeMatching); } else { - A.push(S.slice(p, q)); + push(A, stringSlice(S, p, q)); if (A.length === lim) return A; for (var i = 1; i <= z.length - 1; i++) { - A.push(z[i]); + push(A, z[i]); if (A.length === lim) return A; } q = p = e; } } - A.push(S.slice(p)); + push(A, stringSlice(S, p)); return A; } ]; -- Gitblit v1.8.0