Bug 1519597 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

It seems like the following changeset was meant to address these issues:
https://hg.mozilla.org/mozilla-central/rev/72d19d0827de
Bug 1060933 - Prevent jQuery Live event bubbles from throwing on invalid selector r=bgrins 

but we should display something better than a horizontal sliver of a pop-up label.

(Using catch in that way can also conceal coding errors in the code of the `try` block. It takes a lot more time to track down a coding error when you don't have a backtrace; when I find the `catch (e) {}`, I really feel like I've wasted my time. We should avoid this approach.)
It seems like the following changeset was meant to address these issues:
https://hg.mozilla.org/mozilla-central/rev/72d19d0827de
Bug 1060933 - Prevent jQuery Live event bubbles from throwing on invalid selector r=bgrins
```
+      try {
+        let eventInfos = getListeners(node);
+
+        if (!eventInfos) {
+          continue;
         }
 
-        this.processHandlerForEvent(node, events, dbg, eventInfo);
+        for (let eventInfo of eventInfos) {
+          if (normalizeHandler) {
+            eventInfo.normalizeHandler = normalizeHandler;
+          }
+
+          this.processHandlerForEvent(node, events, dbg, eventInfo);
+        }
+      } catch(e) {
+        // An object attached to the node looked like a listener but wasn't...
+        // do nothing.
       }
```

but we should display something better than a horizontal sliver of a pop-up label.

(Using catch in that way can also conceal coding errors in the code of the `try` block. It takes a lot more time to track down a coding error when you don't have a backtrace; when I find the `catch (e) {}`, I really feel like I've wasted my time. We should avoid this approach.)
It seems like the following changeset was meant to address these issues:
https://hg.mozilla.org/mozilla-central/rev/72d19d0827de
Bug 1060933 - Prevent jQuery Live event bubbles from throwing on invalid selector r=bgrins
```
+      try {
+        let eventInfos = getListeners(node);
+
+        if (!eventInfos) {
+          continue;
         }
 
-        this.processHandlerForEvent(node, events, dbg, eventInfo);
+        for (let eventInfo of eventInfos) {
+          if (normalizeHandler) {
+            eventInfo.normalizeHandler = normalizeHandler;
+          }
+
+          this.processHandlerForEvent(node, events, dbg, eventInfo);
+        }
+      } catch(e) {
+        // An object attached to the node looked like a listener but wasn't...
+        // do nothing.
       }
```

but we should display something better than a horizontal sliver of a pop-up label.

(Using catch in that way can also conceal coding errors in the code of the `try` block and anything it calls. It takes a lot more time to track down a coding error when you don't have a backtrace; when I find the `catch (e) {}`, I really feel like I've wasted my time. We should avoid this approach.)

Back to Bug 1519597 Comment 1