Skip to content

Commit

Permalink
fix AEntity.is for when state is 0th index
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Jan 26, 2016
1 parent 8b5d995 commit 4699078
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/a-entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ var proto = Object.create(ANode.prototype, {
value: function (state) {
var is = false;
this.states.forEach(function (elState, index) {
if (elState === state) { is = index; }
if (elState === state) { is = true; }
});
return is;
}
Expand Down

2 comments on commit 4699078

@CodeRhymesLife
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ngokevin,

I think this change breaks removestate. removestate expects is to return the index of the state, or false if it doesn't exist. After this change, removestate does is not able to remove the proper state because it doesn't know its index. I opened #1107 to track this issue.

@dmarcos
Copy link
Member

@dmarcos dmarcos commented on 4699078 Mar 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drryanjames good catch!

Please sign in to comment.