Open
Description
const items = new DefineList({ i: 1 });
items.on('length', () => {
console.log(items.sort());
});
items.splice(0, 1);
This code causes an infinite loop. I had a similar thing in component with a calls sort
in its source list. E.g:
list: {
get(lastSetValue) {
return lastSetValue.sort(comparator);
}
}
I wonder if DefineList.sort
should not fire the event and early return if the list is empty.