Here is a breaking test case:
- test("Max Callstack Exceeded", function() {Policy = can.Model({id: 'name',attributes: {cacheDetails: 'Cache.model'},findAll: "GET /policies",destroy: "DELETE /policies/{id}"}, {});Cache = can.Model({id: 'name',attributes: {dataVolumes: 'Volume.models'}}, {});Volume = can.Model({id: 'name',attributes: {cacheDetails: 'Cache.model'},findOne: "GET /volumes/{id}",destroy: "DELETE /volumes/{id}"}, {getName: function() {}});var VOLUME = {"name": "Water","cacheDetails": {"name": "Cache 0"}};var POLICIES = [{"name": "S3 cached","cacheDetails": {"name": "Cache 0","dataVolumes": [{"name": "S3 volume",},{"name": "Water",}]},"volumes": [{"name": "S3 volume"},{"name": "Water"}]}];can.fixture('GET /policies', function() { return POLICIES; });can.fixture('GET /volumes/{id}', function() { return VOLUME; });can.fixture('DELETE /volumes/{id}', function() { return 1; });can.view.ejs("ejs","name: <%= v.attr('name') %>")var self = this;stop();Volume.findOne({id: 'Water'}).then(function(v) {console.dir(v);window.v = v;// Comment this line out and no maximum call stack errorcan.$('#dummy').append(can.view('ejs', {v: v}))// Second call to Policy.findAll is what seems to trigger the issue// Comment this line out and no maximum call stack errorPolicy.findAll().then(function() {v.destroy().then(function() {start();equal(1,1, "We made it here so all good!");})});});});