Present-to-absent check is necessary in assertion removal handler
This commit is contained in:
parent
c26186f871
commit
2a806da35c
|
@ -204,12 +204,15 @@ function add_to_handler(h, vs) {
|
|||
function del_from_cont(c, v) { c.cachedAssertions = c.cachedAssertions.remove(v); }
|
||||
function del_from_leaf(l, v) { l.cachedAssertions = l.cachedAssertions.remove(v); }
|
||||
function del_from_handler(h, vs) {
|
||||
h.cachedCaptures = Bag.change(h.cachedCaptures, vs, -1).bag;
|
||||
let net;
|
||||
({bag: h.cachedCaptures, net: net} = Bag.change(h.cachedCaptures, vs, -1));
|
||||
if (net === Bag.PRESENT_TO_ABSENT) {
|
||||
h.callbacks.forEach((cb) => {
|
||||
cb(EVENT_REMOVED, vs);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Index.prototype.adjustAssertion = function(outerValue, delta) {
|
||||
let net;
|
||||
|
|
Loading…
Reference in New Issue