256
Old Bugs (1.x/2.x) / Re: List Game Attributes are empty[?]
« on: March 26, 2011, 07:30:47 am »
Yea, more searching shows that Array's indexOf method uses strict equality (===), which performs no type casting when comparing values. With strict equality, if the types are different, it will always return false. This is a problem with game attributes because a game attribute is casted from an Object into an Array. The values within the array are not casted, they are all still objects. So its basically searching through the list doing object === string comparisons, which since no type casting occur, always returns false.
The snippet list attribute is never cast, so its actually searching through the list comparing string === string.
Fix for bug: Do value searching in arrays manually in the ArrayUtil class using regular equality "==". I'll notify Jon and commit the fix.
The snippet list attribute is never cast, so its actually searching through the list comparing string === string.
Fix for bug: Do value searching in arrays manually in the ArrayUtil class using regular equality "==". I'll notify Jon and commit the fix.