You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/02/09 17:26:54 UTC

[GitHub] [cordova-js] raphinesse commented on a change in pull request #245: Handle event listener functions more gracefully

raphinesse commented on a change in pull request #245:
URL: https://github.com/apache/cordova-js/pull/245#discussion_r802914372



##########
File path: src/cordova.js
##########
@@ -44,7 +44,7 @@ var documentEventHandlers = {};
 var windowEventHandlers = {};
 
 document.addEventListener = function (evt, handler, capture) {
-    var e = evt.toLowerCase();
+    var e = typeof evt === 'string' ? evt.toLowerCase() : evt;

Review comment:
       ```suggestion
       var e = String(evt).toLowerCase();
   ```
   
   Nit: Maybe that would be even more straightforward. What do you think, @jpike88?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org