File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 274274 if ( ! opts . silent && _ . isObject ( newValue ) && isNewValue ) {
275275 var visited = [ ] ;
276276 var checkChanges = function ( obj , prefix ) {
277- // Don't choke on circular references
278- if ( _ . indexOf ( visited , obj ) > - 1 ) {
277+ // Not checking changes on sub-Backbone.Models/Collection props
278+ // in order to avoid to put observers on potential heavy objects
279+ // (typically, Backbone.Models have _events properties which may have lots of things inside it, and
280+ // we should not put useless observers on it)
281+ if ( obj instanceof Backbone . Model || obj instanceof Backbone . Collection ) {
282+ return ;
283+ } else if ( _ . indexOf ( visited , obj ) > - 1 ) { // Don't choke on circular references
279284 return ;
280285 } else {
281286 visited . push ( obj ) ;
You can’t perform that action at this time.
0 commit comments