fix the first 100 prefer-const errors

This commit is contained in:
Thomas Grainger 2017-05-03 00:40:39 +01:00
parent 0a3233d289
commit b365ce3195
No known key found for this signature in database
GPG key ID: 995EA0A029283160
10 changed files with 141 additions and 146 deletions

View file

@ -261,15 +261,16 @@ Manager.prototype.addDynamicListener = function(selector, eventType, callback, s
* @param {Event} e - The event to be handled
*/
Manager.prototype.dynamicListenerHandler = function(e) {
let handlers = this.dynamicHandlers[e.type],
matches = e.target.matches ||
e.target.webkitMatchesSelector ||
e.target.mozMatchesSelector ||
e.target.msMatchesSelector ||
e.target.oMatchesSelector;
const { type, target } = e;
const handlers = this.dynamicHandlers[type];
const matches = target.matches ||
target.webkitMatchesSelector ||
target.mozMatchesSelector ||
target.msMatchesSelector ||
target.oMatchesSelector;
for (let i = 0; i < handlers.length; i++) {
if (matches && e.target[matches.name](handlers[i].selector)) {
if (matches && matches.call(target, handlers[i].selector)) {
handlers[i].callback(e);
}
}