Browse Source

Pull request #269986: REPORT-114436 fix: 同步Dep回收优化到release

Merge in DEC/fineui from ~SYLAR/fineui:release/11.0 to release/11.0

* commit '89eb72ab4fd8607498445701640c465e2521a2b6':
  REPORT-114436 fix: 同步Dep回收优化到release
research/test
Sylar-黄山 9 months ago
parent
commit
ea8c70402f
  1. 1
      packages/fineui/src/fix/fix.compact.js
  2. 10
      packages/fineui/src/fix/fix.js

1
packages/fineui/src/fix/fix.compact.js

@ -204,6 +204,7 @@ Widget.prototype.__destroy = function() {
unwatch(); unwatch();
}); });
}); });
Fix.cleanupDeps();
this._watchers && (this._watchers = []); this._watchers && (this._watchers = []);
if (this.store) { if (this.store) {
this.store._parent && (this.store._parent = null); this.store._parent && (this.store._parent = null);

10
packages/fineui/src/fix/fix.js

@ -110,7 +110,15 @@ function isExtensible(obj) {
function remove(arr, item) { function remove(arr, item) {
if (arr && arr.length) { if (!arr) {
return;
}
const len = arr.length;
if (len) {
if (item === arr[len - 1]) {
arr.length = len - 1;
return;
}
const index = arr.indexOf(item); const index = arr.indexOf(item);
if (index > -1) { if (index > -1) {
return arr.splice(index, 1); return arr.splice(index, 1);

Loading…
Cancel
Save