From 9c68a77abfa351a06fb7add82ffe92c7861cd53f Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 25 Apr 2022 10:20:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20BI.remove=20=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=94=AF=E6=8C=81=E5=87=BD=E6=95=B0=E5=BD=A2?= =?UTF-8?q?=E5=BC=8F=E7=9A=84predicate=E5=92=8Cvalue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/2.base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/2.base.js b/src/core/2.base.js index 512a948a2..ba2d9ec77 100644 --- a/src/core/2.base.js +++ b/src/core/2.base.js @@ -281,13 +281,13 @@ var i; if (BI.isArray(obj)) { for (i = 0; i < obj.length; i++) { - if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) { + if ((isFunction && (target === obj[i] || target.apply(context, [i, obj[i]]) === true)) || (!isFunction && BI.contains(target, obj[i]))) { obj.splice(i--, 1); } } } else { BI.each(obj, function (i, v) { - if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) { + if ((isFunction && (target === obj[i] || target.apply(context, [i, obj[i]]) === true)) || (!isFunction && BI.contains(target, obj[i]))) { delete obj[i]; } });