From 23b60dc1975db38c280d8a123aff97544d1673e0 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:34:21 +0800 Subject: [PATCH] TODO#139890 FAQ 常見問題 1-文案調整 --- PAMapp/node_modules/core-js/modules/es.unescape.js | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/PAMapp/node_modules/core-js/modules/es.unescape.js b/PAMapp/node_modules/core-js/modules/es.unescape.js index 0b0ac63..c23b68c 100644 --- a/PAMapp/node_modules/core-js/modules/es.unescape.js +++ b/PAMapp/node_modules/core-js/modules/es.unescape.js @@ -1,8 +1,13 @@ 'use strict'; var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); var toString = require('../internals/to-string'); var fromCharCode = String.fromCharCode; +var charAt = uncurryThis(''.charAt); +var exec = uncurryThis(/./.exec); +var stringSlice = uncurryThis(''.slice); + var hex2 = /^[\da-f]{2}$/i; var hex4 = /^[\da-f]{4}$/i; @@ -14,21 +19,21 @@ var result = ''; var length = str.length; var index = 0; - var chr, slice; + var chr, part; while (index < length) { - chr = str.charAt(index++); + chr = charAt(str, index++); if (chr === '%') { - if (str.charAt(index) === 'u') { - slice = str.slice(index + 1, index + 5); - if (hex4.test(slice)) { - result += fromCharCode(parseInt(slice, 16)); + if (charAt(str, index) === 'u') { + part = stringSlice(str, index + 1, index + 5); + if (exec(hex4, part)) { + result += fromCharCode(parseInt(part, 16)); index += 5; continue; } } else { - slice = str.slice(index, index + 2); - if (hex2.test(slice)) { - result += fromCharCode(parseInt(slice, 16)); + part = stringSlice(str, index, index + 2); + if (exec(hex2, part)) { + result += fromCharCode(parseInt(part, 16)); index += 2; continue; } -- Gitblit v1.8.0