coresmart / persistencejs

persistence.js is an asynchronous Javascript database mapper library. You can use it in the browser, as well on the server (and you can share data models between them).
http://persistencejs.org
1.72k stars 240 forks source link

Fixed arrayRemove() helper function #88

Closed superquadratic closed 12 years ago

superquadratic commented 12 years ago

The function was broken in a way that when it actually removed an item from the array, it would run over the end of the array, throwing an exception trying to work with a null element. Fixed by returning directly after deleting an element. This is OK since the method is only used for arrays without duplicate elements.

Also added a test case that uses arrayRemove() (indirectly).

zefhemel commented 12 years ago

Thanks!