summaryrefslogtreecommitdiffstats
path: root/spec/subexpressions.js
Commit message (Collapse)AuthorAgeFilesLines
* Remove stringParams and trackIds modemachty2015-12-101-44/+0
| | | | Closes #1145
* Add full support for es6kpdecker2015-04-161-81/+79
| | | | | | | | Converts the tool chain to use babel, eslint, and webpack vs. the previous proprietary solutions. Additionally begins enforcing additional linting concerns as well as updates the code to reflect these rules. Fixes #855 Fixes #993
* Update subexpression and hash AST constructskpdecker2014-11-271-5/+5
|
* Replace DataNode and IdNode with PathNodekpdecker2014-11-261-2/+2
| | | This is a breaking change for string mode users as there is no longer a distinct type for data parameters. Instead data consumers should look for the @ prefix value.
* added test multiple subexpressions in a hash with contextMarko Zabcic2014-08-231-0/+24
|
* Add test case for Issue #800kpdecker2014-05-271-0/+18
| | | This isn’t failing in master but this is a useful test to prevent regressions.
* Remove log in testkpdecker2014-03-051-1/+0
|
* Fix evaluation of paths and subexprskpdecker2014-03-051-0/+16
| | | Fixes #743
* properly handle multiple subexpressions in the same hash, fixes #748Jon Jensen2014-02-201-0/+17
| | | | | push all hash params before popping any so as to avoid the last stackN var stomping previous ones
* Fix multiple hash handling in subexpressionskpdecker2013-12-311-1/+1
|
* Added support for subexpressionsmachty2013-12-301-0/+166
Handlebars now supports subexpressions. {{foo (bar 3)}} Subexpressions are always evaluated as helpers; if `3` were omitted from the above example, `bar` would be invoked as a param-less helper, even though a top-levell `{{bar}}` would be considered ambiguous. The return value of a subexpression helper is passed in as a parameter of a parent subexpression helper, even in string params mode. Their type, as listed in `options.types` or `options.hashTypes` in string params mode, is "sexpr". The main conceptual change in the Handlebars code is that there is a new AST.SexprNode that manages the params/hash passed into a mustache, as well as the logic that governs whether that mustache is a helper invocation, property lookup, etc. MustacheNode, which used to manage this stuff, still exists, but only manages things like white-space stripping and whether the mustache is escaped or not. So, a MustacheNode _has_ a SexprNode. The introduction of subexpressions is fully backwards compatible, but a few things needed to change about the compiled output of a template in order to support subexpressions. The main one is that the options hash is no longer stashed in a local `options` var before being passed to either the helper being invoked or the `helperMissing` fallback. Rather, the options object is inlined in these cases. This does mean compiled template sizes will be a little bit larger, even those that don't make use of subexpressions, but shouldn't have any noticeable impact on performance when actually rendering templates as only one of these inlined objects will actually get evaluated.