mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 982322 - Part 4: Save paths on each node. r=ochameau
This commit is contained in:
parent
c1ba262c38
commit
8ccc9f5e7c
@ -142,14 +142,16 @@ Template.prototype = {
|
||||
},
|
||||
|
||||
_unregisterNodes: function(nodes) {
|
||||
for (let [registeredPath, set] of this._nodeListeners) {
|
||||
for (let e of nodes) {
|
||||
for (let registeredPath of e.registeredPaths) {
|
||||
let set = this._nodeListeners.get(registeredPath);
|
||||
set.delete(e);
|
||||
}
|
||||
if (set.size == 0) {
|
||||
if (set.size === 0) {
|
||||
this._nodeListeners.delete(registeredPath);
|
||||
}
|
||||
}
|
||||
e.registeredPaths = null;
|
||||
}
|
||||
},
|
||||
|
||||
_registerLoop: function(path, element) {
|
||||
@ -240,6 +242,8 @@ Template.prototype = {
|
||||
this._registerNode(path, e);
|
||||
}
|
||||
}
|
||||
// Store all the paths on the node, to speed up unregistering later
|
||||
e.registeredPaths = paths;
|
||||
} catch(exception) {
|
||||
console.error("Invalid template: " + e.outerHTML + " (" + exception + ")");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user