twitter / hogan.js

A compiler for the Mustache templating language
http://twitter.github.io/hogan.js
Apache License 2.0
5.14k stars 431 forks source link

Clean partials instance before returning cache #162

Closed nemtsov closed 10 years ago

nemtsov commented 10 years ago

This fixes the issue @dtb pointed out in #161.

The problem was that hogan did not clean-up the template .instance it created for the "specialized partial"; so on the first run it created the instance and on subsequent calls the cache returned the old instances; which contained old data from the previous run.

This PR cleans up the instances before returning the template cache to the client in .compile()