From ecc10cb6041b908342a757f5437f96c9d27cfe0e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 11 Jun 2020 18:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20replaceAll?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/func/string.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/func/string.js b/src/core/func/string.js index c2d5aeb14..e4b613f6d 100644 --- a/src/core/func/string.js +++ b/src/core/func/string.js @@ -81,7 +81,7 @@ _.extend(BI, { * @returns {String} 替换后的字符串 */ replaceAll: function (str, s1, s2) { - return BI.isNull(str) ? str : str.replace(new RegExp(s1, "gm"), s2); + return BI.isString(str) ? str.replace(new RegExp(s1, "gm"), s2) : str; }, /** * 总是让字符串以指定的字符开头