From 5b77ec33de4d5f01865e2353a038110fe87f9750 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 4 Dec 2013 18:01:52 +0200 Subject: [PATCH] optimize fire event in V8 when there are no context listeners --- src/core/Events.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/Events.js b/src/core/Events.js index cd8b17af..982dec58 100644 --- a/src/core/Events.js +++ b/src/core/Events.js @@ -143,6 +143,8 @@ L.Mixin.Events = { // fire event for the context-indexed listeners as well typeIndex = events[type + '_idx']; + if (!typeIndex) { return this; } + for (contextId in typeIndex) { listeners = typeIndex[contextId].slice();