stopObservingElement() raises exception 'responder is null or not an object' in IE8:
function stopObservingElement(element) {
var registry = getRegistryForElement(element); // creates empty registry {element: element}
destroyRegistryForElement(element);
var entries, i;
for (var eventName in registry) { // property `element` is enumerated
entries = registry[eventName]; // entries = registry['element'] == e.g. HTMLCommentElement
i = entries.length; // element has non-zero length
while (i--)
removeEvent(element, eventName, entries[i].responder); // error: entries[i] is undefined!
}
}
I am invoking Element#update(), it collects child elements (and comments in IE!) and calls purgeElement() for each element.
Then purgeElement() calls stopObservingElement() for comment element.
Prototype unnecessarily creates new registry (here may be performance improvement for all browsers) with {element: element}, property element of registry is successfully enumerated in for ... in loop, and comment element has non-zero length property, but indexed access returns undefined.
Resume:
There is no need to create new empty registry and create for loop when element has no registry.
There should be some additional checks for element in for loop.
previous lighthouse ticket #1329 by Victor
stopObservingElement()
raises exception 'responder is null or not an object' in IE8:Element#update()
, it collects child elements (and comments in IE!) and callspurgeElement()
for each element.purgeElement()
callsstopObservingElement()
for comment element.Resume: