Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Fixed bug where ancestors would not be properly computed in function …
Browse files Browse the repository at this point in the history
…getAncestors.
  • Loading branch information
jbeard4 committed Apr 18, 2012
1 parent 71568e8 commit 674836a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/scxml/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ module.exports = {
getAncestors: function(s, root) {
var ancestors, index, state;
if (s.ancestors) {
if (_.contains(s.ancestors,root)) {
index = _.indexOf(s.ancestors,root);
if (index > -1) {
return s.ancestors.slice(0, index);
} else {
return s.ancestors;
Expand Down

0 comments on commit 674836a

Please sign in to comment.