From: Alexander Ebert Date: Fri, 6 Nov 2020 16:44:33 +0000 (+0100) Subject: Use `WeakSet` to track elements X-Git-Tag: 5.4.0_Alpha_1~624^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff22f370f0f2782355e441c3f9c06cea18de0201;p=GitHub%2FWoltLab%2FWCF.git Use `WeakSet` to track elements --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Edit.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Edit.js index 74f0e07d8f..3b067686dc 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Edit.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Edit.js @@ -23,7 +23,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Dom/Ch */ constructor(container) { this._activeElement = null; - this._comments = new Set(); + this._comments = new WeakSet(); this._editorContainer = null; this._container = container; this.rebuild(); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Response/Edit.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Response/Edit.js index c65c8fa963..3092a373ad 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Response/Edit.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Response/Edit.js @@ -22,7 +22,7 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Core", "../../ */ constructor(container) { super(container); - this._responses = new Set(); + this._responses = new WeakSet(); this.rebuildResponses(); Listener_1.default.add("Ui/Comment/Response/Edit_" + Util_1.default.identify(this._container), () => this.rebuildResponses()); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Edit.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Edit.ts index 662333b38e..4646f8aad7 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Edit.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Edit.ts @@ -29,7 +29,7 @@ interface AjaxResponse { class UiCommentEdit { protected _activeElement: HTMLElement | null = null; - protected readonly _comments = new Set(); + protected readonly _comments = new WeakSet(); protected readonly _container: HTMLElement; protected _editorContainer: HTMLElement | null = null; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Response/Edit.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Response/Edit.ts index f28f11ef16..95d5b3768f 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Response/Edit.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Comment/Response/Edit.ts @@ -24,7 +24,7 @@ interface AjaxResponse { } class UiCommentResponseEdit extends UiCommentEdit { - protected readonly _responses = new Set(); + protected readonly _responses = new WeakSet(); /** * Initializes the comment edit manager.