Skip to content

Commit

Permalink
initialize empty arrays in some more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jldailey committed Apr 4, 2012
1 parent 1c5d357 commit 5d1c8df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bling.coffee
Expand Up @@ -1951,6 +1951,7 @@ Object.Extend Event,
archive[e].push(args)
if archive[e].length > archive_limit
archive[e].splice(0, archive_trim)
subscribers[e] ?= []
for func in subscribers[e]
func.apply null, args
@
Expand All @@ -1959,6 +1960,7 @@ Object.Extend Event,
subscribers[e] ?= []
subscribers[e].push(func)
if replay # replay the publish archive
archive[e] ?= []
for args in archive[e]
$.log "replayed: #{e}", args
func.apply null, args
Expand Down

0 comments on commit 5d1c8df

Please sign in to comment.