Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix localsAsTemplateData when caching is enabled
When a template is rendered from the cache, the extra options object (containing the data property) isn't being passed in to the render function. Thus, any functionality that depends on this will fail. The code has been refactored to create a single handlebars options object for each (main) template render, which is then passed in all scenarios (cache, template, layout template). The code also cleans up the use of parent-scope variables for the render context, and avoids a circular reference to the "_locals" object from itself in favor of an instance-based boolean to determine whether the locals should be passed as template data. Tests have also been added to test for this scenario. fixes #101
- Loading branch information
Showing
3 changed files
with
70 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters