bitovi/canjs — pull request #439 by andykant (2013-06-27 15:37:52+00:00)
Title: Preloaded recursive views fail to render their recursions

Whenever a recursive **can.view** is stolen (or preloaded via production build) prior to being used in the page, it will only render the top level pass, ignoring all recursions.

This will fail (where indirect1 and indirect2 recursively call each other inside their templates):

``` javascript
steal(
'view/ejs/test/indirect1.ejs',
'view/ejs/test/indirect2.ejs',
function() {
var unordered = new can.Observe.List([
{ ol: [
{ ul: [
{ ol: [1, 2, 3] }
]}
]}
]);
can.view.cache = false;
var div = document.createElement('div');
div.appendChild(can.view(can.test.path('view/ejs/test/indirect1.ejs'), {unordered: unordered}));
document.getElementById('qunit-test-area').appendChild(div);
var el = can.$('#qunit-test-area ul > li > ol > li > ul > li > ol > li')[0];
ok(!!el && can.trim(el.innerHTML) === "1", "Uncached indirectly recursive EJS working.");

can.view.cache = true;
div.appendChild(can.view(can.test.path('view/ejs/test/indirect1.ejs'), {unordered: unordered}));
el = can.$('#qunit-test-area ul + ul > li > ol > li > ul > li > ol > li')[0];
ok(!!el && can.trim(el.innerHTML) === "1", "Cached indirectly recursive EJS working.");
document.getElementById('qunit-test-area').removeChild(div);
}
);
```

I will be checking in a fix shortly.