Skip to content

Commit 1cc362c

Browse files
authored
Merge pull request #294 from derbyjs/fix-contexts-unloadAll
Fix Contexts#unloadAll to account for addition of toJSON method
2 parents 2d74771 + 9b4833b commit 1cc362c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: lib/Model/contexts.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ Model.prototype.unload = function(id) {
3434
Model.prototype.unloadAll = function() {
3535
var contexts = this.root._contexts;
3636
for (var key in contexts) {
37-
contexts[key].unload();
37+
if (contexts.hasOwnProperty(key)) {
38+
contexts[key].unload();
39+
}
3840
}
3941
};
4042

0 commit comments

Comments
 (0)