diff --git a/karma.conf.js b/karma.conf.js index a54a552bb..8c1c2e24d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -58,7 +58,7 @@ module.exports = function (config) { "src/core/alias.js": "coverage", "src/core/base.js": "coverage", "src/core/func/date.js": "coverage", - "src/base/**/*.js": "coverage" + "src/base/**/!(*.test).js": "coverage" }, diff --git a/src/core/platform/web/jquery/fn.js b/src/core/platform/web/jquery/fn.js index 5ecf47eed..a18ad38a6 100644 --- a/src/core/platform/web/jquery/fn.js +++ b/src/core/platform/web/jquery/fn.js @@ -84,7 +84,9 @@ if (jQuery) { py = BI.toUpperCase(py); } this.empty(); - while (true) { + // BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串 + // 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0 + while (py.length > 0 && textLeft.length > 0) { var tidx = BI.toUpperCase(textLeft).indexOf(keyword); var pidx = null; if (py != null) {