derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 116 forks source link

Fix Contexts#unloadAll to account for addition of toJSON method #294

Closed ericyhwang closed 1 year ago

ericyhwang commented 1 year ago

https://github.com/derbyjs/racer/pull/293 meant that the for..in Contexts#unloadAll would loop over the new toJSON method as well.

Add a hasOwnProperty guard to skip over the toJSON method and any future ones that may be added.