Browse Source

REPORT-114436 fix: 同步Dep回收优化到release

research/test
Sylar 8 months ago
parent
commit
89eb72ab4f
  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