Skip to content
This repository has been archived by the owner on May 2, 2019. It is now read-only.

Commit

Permalink
little update for #30
Browse files Browse the repository at this point in the history
  • Loading branch information
hay committed Feb 8, 2013
1 parent 0a9c480 commit bf0b8ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions index.html
Expand Up @@ -1272,6 +1272,8 @@ <h3 id="m-history">History</h3>
<li><small>Bugfix</small> Fixed the todos examples, thanks <a href="http://slopesidecreative.com/">Erik</a>!</li>
<li><small>Bugfix</small> Fixed events in subclasses. (issue <a href="https://github.com/hay/stapes/pull/29">#29</a>),
thanks <a href="https://github.com/ericchaves">Eric</a>!</li>
<li><small>Bugfix</small> Fixed a problem where unbinding an event would throw an error in some rare cases
(<a href="https://github.com/hay/stapes/pull/30">issue #30</a>). Thanks <a href="https://github.com/wellcaffeinated">Jasper</a>!</li>
</ul>
<li>0.7.0 - January 14th 2013</li>
<ul>
Expand Down
7 changes: 4 additions & 3 deletions stapes.js
Expand Up @@ -179,9 +179,10 @@
emitEvents : function(type, data, explicitType, explicitGuid) {
explicitType = explicitType || false;
explicitGuid = explicitGuid || this._guid;

// make a local copy of the array
var handlers = Array.prototype.concat.apply(_.eventHandlers[explicitGuid][type]);

// #30: make a local copy of handlers to prevent problems with
// unbinding the event while unwinding the loop
var handlers = slice.call(_.eventHandlers[explicitGuid][type]);

for (var i = 0, l = handlers.length; i < l; i++) {
// Clone the event to prevent issue #19
Expand Down

0 comments on commit bf0b8ba

Please sign in to comment.