Bug 1412538 - Optimize discovery of React listeners in inspector. r?tromey draft
authorAdrian Wielgosik <adrian.wielgosik@gmail.com>
Sat, 28 Oct 2017 18:36:55 +0200
changeset 688169 0e4ea85b6246754c1122d848378708b0e59ab4b7
parent 688168 f1645faece2d246fd0a6de464a523838b728f003
child 737802 d2f5bf6b04435c005cc5430b5cf11fa2bcc23c40
push id86676
push userbmo:adrian.wielgosik@gmail.com
push dateSat, 28 Oct 2017 16:37:27 +0000
reviewerstromey
bugs1412538
milestone58.0a1
Bug 1412538 - Optimize discovery of React listeners in inspector. r?tromey MozReview-Commit-ID: LgJzQHWmLOl
devtools/server/event-parsers.js
--- a/devtools/server/event-parsers.js
+++ b/devtools/server/event-parsers.js
@@ -264,17 +264,17 @@ var parsers = [
 
       return handlerDO;
     }
   },
 ];
 
 function reactGetListeners(node, boolOnEventFound) {
   function getProps() {
-    for (let key in node) {
+    for (let key of Object.keys(node)) {
       if (key.startsWith("__reactInternalInstance$")) {
         return node[key]._currentElement.props;
       }
     }
     return null;
   }
 
   node = node.wrappedJSObject || node;