Skip to content

Commit

Permalink
unit test for issue afeld#86
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopereiraTT committed Sep 18, 2013
1 parent 605a1d1 commit 0c1716e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/nested-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,15 @@ $(document).ready(function() {
sinon.assert.called(change);
});

test("stack overflow on circular references after assignment", function(){
var father = {name: 'bob'};
var child = {name: 'danny', father: father};
father.children = [child];
var family = new Backbone.NestedModel({lastName: 'Smith', head: father});
family.set({'head.name': 'Rob'});
// ==> RangeError: Maximum call stack size exceeded
});

test("change event doesn't fire on silent", function() {
var change = sinon.spy();
var changeName = sinon.spy();
Expand Down

0 comments on commit 0c1716e

Please sign in to comment.