equal
deleted
inserted
replaced
29 |
29 |
30 local recent_wildcard_events, max_cached_wildcard_events = {}, 10000; |
30 local recent_wildcard_events, max_cached_wildcard_events = {}, 10000; |
31 |
31 |
32 local event_map = events._event_map; |
32 local event_map = events._event_map; |
33 setmetatable(events._handlers, { |
33 setmetatable(events._handlers, { |
|
34 -- Called when firing an event that doesn't exist (but may match a wildcard handler) |
34 __index = function (handlers, curr_event) |
35 __index = function (handlers, curr_event) |
35 if is_wildcard_event(curr_event) then return; end -- Wildcard events cannot be fired |
36 if is_wildcard_event(curr_event) then return; end -- Wildcard events cannot be fired |
36 -- Find all handlers that could match this event, sort them |
37 -- Find all handlers that could match this event, sort them |
37 -- and then put the array into handlers[curr_event] (and return it) |
38 -- and then put the array into handlers[curr_event] (and return it) |
38 local matching_handlers_set = {}; |
39 local matching_handlers_set = {}; |