From 0664def54e151515b4da5e57e3675338a2544272 Mon Sep 17 00:00:00 2001 From: "Oliver.Ke" Date: Tue, 22 Oct 2024 20:37:12 +0800 Subject: [PATCH] =?UTF-8?q?BI-155367=20fix:=20=E5=85=9C=E5=BA=95=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=B8=80=E4=B8=8B=EF=BC=8C=E9=81=BF=E5=85=8D=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E4=BA=8B=E4=BB=B6=E5=9B=9E=E8=B0=83=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E5=90=8C=E6=AD=A5=E7=A7=BB=E9=99=A4=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=90=8E=E7=BB=AD=E9=81=8D=E5=8E=86?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/controller/controller.broadcast.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fineui/src/core/controller/controller.broadcast.js b/packages/fineui/src/core/controller/controller.broadcast.js index 3f1eb3035..0ce6406b6 100644 --- a/packages/fineui/src/core/controller/controller.broadcast.js +++ b/packages/fineui/src/core/controller/controller.broadcast.js @@ -16,13 +16,13 @@ export class BroadcastController extends Controller { this._broadcasts[name] = []; } this._broadcasts[name].push(fn); - + return () => this.remove(name, fn); } send(name) { const args = [].slice.call(arguments, 1); - each(this._broadcasts[name], (i, fn) => fn(...args)); + each(this._broadcasts[name]?.slice?.(), (i, fn) => fn(...args)); } remove(name, fn) { @@ -34,7 +34,7 @@ export class BroadcastController extends Controller { } else { delete this._broadcasts[name]; } - + return this; } }