Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Throw exception if id tracking args are passed | kpdecker | 2015-12-26 | 1 | -26/+26 |
| | | | Fixes #1151 | ||||
* | Remove semi-documented _setup and _child APIs | kpdecker | 2015-12-12 | 1 | -14/+1 |
| | | | These were a bad idea to begin with and without the trackIds implementation they don’t make much sense. | ||||
* | Remove stringParams and trackIds mode | machty | 2015-12-10 | 1 | -45/+1 |
| | | | | Closes #1145 | ||||
* | Add explicitPartialContext compiler flag | kpdecker | 2015-09-01 | 1 | -1/+5 |
| | | | Fixes #1032 | ||||
* | Implement block decorators | kpdecker | 2015-08-22 | 1 | -0/+13 |
| | | | | These allow for a given block to be wrapped in helper methods or metadata and allow for more control over the current container and method before the code is run. | ||||
* | Implement partial blocks | kpdecker | 2015-08-22 | 1 | -2/+12 |
| | | | | | | This allows for failover for missing partials as well as limited templating ability through the `{{> @partial-block }}` partial special case. Partial fix for #1018 | ||||
* | Improve sanity checks in compiler and visitor | kpdecker | 2015-08-22 | 1 | -0/+5 |
| | |||||
* | Drop AST constructors in favor of JSON | kpdecker | 2015-08-18 | 1 | -1/+8 |
| | | | | | These were little more than object literal statements that were less clear due to their use of index-based arguments. Fixes #1077 | ||||
* | Pass undefined fields to helpers in strict mode | kpdecker | 2015-08-03 | 1 | -3/+7 |
| | | | | | This allows for `{{helper foo}}` to still operate under strict mode when `foo` is not defined on the context. This allows helpers to perform whatever existence checks they please so patterns like `{{#if foo}}{{foo}}{{/if}}` can be used to protect against missing values. Fixes #1063 | ||||
* | Handle this references properly in track id mode | kpdecker | 2015-08-03 | 1 | -2/+3 |
| | |||||
* | Increase code coverage | kpdecker | 2015-08-01 | 1 | -0/+1 |
| | |||||
* | Update for let and optional parameters | kpdecker | 2015-04-20 | 1 | -50/+50 |
| | |||||
* | Add full support for es6 | kpdecker | 2015-04-16 | 1 | -24/+30 |
| | | | | | | | | 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 | ||||
* | Add undefined and null literal support | kpdecker | 2015-04-07 | 1 | -0/+8 |
| | | | | | This adds the UndefinedLiteral and NullLiteral to AST. Fixes #990 | ||||
* | Fix typo | kpdecker | 2015-02-10 | 1 | -1/+1 |
| | |||||
* | Handle all potential literal values | kpdecker | 2015-02-09 | 1 | -5/+9 |
| | | | Adds support for literal helper names in a few missing cases such as block expressions and subexpressions. | ||||
* | Transform literals to path expressions in mustache nodes | Marcio Junior | 2015-02-08 | 1 | -5/+9 |
| | |||||
* | Test compilation of literal values in mustaches | Marcio Junior | 2015-02-08 | 1 | -1/+5 |
| | |||||
* | Avoid direct references to sexpr in statements | kpdecker | 2015-01-18 | 1 | -18/+12 |
| | | | | | This allows us to avoid creating unnecessary AST nodes and avoids things like isHelper. Side effect of these changes is that @data functions can now have data parameters passed to them. | ||||
* | Add support for dynamic partial names | kpdecker | 2015-01-18 | 1 | -2/+8 |
| | | | | | | | | | Uses the subexpression syntax to allow for dynamic partial lookups. Ex: ``` {{> (helper) }} ``` Fixes #933 | ||||
* | Fix block param evaluation under older IE | kpdecker | 2014-12-27 | 1 | -2/+2 |
| | |||||
* | Implement block parameters | kpdecker | 2014-12-26 | 1 | -16/+49 |
| | | | Fixes #907 | ||||
* | Expose AST helpers in public API | kpdecker | 2014-12-21 | 1 | -21/+5 |
| | |||||
* | Avoid unnecessary this. reference | kpdecker | 2014-12-16 | 1 | -3/+3 |
| | |||||
* | Fix remaining depth arg | kpdecker | 2014-12-16 | 1 | -1/+0 |
| | |||||
* | Remove unused vars and add jshint checking | kpdecker | 2014-12-16 | 1 | -3/+1 |
| | |||||
* | Remove Compiler.depths parameter | kpdecker | 2014-12-16 | 1 | -15/+5 |
| | | | | This is no longer necessary with the depths array tracking and adds compiler overhead. | ||||
* | Move compileProgram out of visitor methods | kpdecker | 2014-11-29 | 1 | -18/+18 |
| | |||||
* | Track source node via accept call rather vs opcode | kpdecker | 2014-11-29 | 1 | -41/+46 |
| | |||||
* | s/Subexpression/SubExpression/ | kpdecker | 2014-11-29 | 1 | -1/+1 |
| | |||||
* | Treat partial exec in a manner closer to helpers | kpdecker | 2014-11-27 | 1 | -17/+8 |
| | | | This helps unify the code handling and will also be needed to support string/id tracking on partials. | ||||
* | Update subexpression and hash AST constructs | kpdecker | 2014-11-27 | 1 | -64/+54 |
| | |||||
* | Simplify Path and Sexpr calculated flags | kpdecker | 2014-11-27 | 1 | -4/+36 |
| | |||||
* | Replace DataNode and IdNode with PathNode | kpdecker | 2014-11-26 | 1 | -15/+24 |
| | | | 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. | ||||
* | Update literal ast nodes for new spec | kpdecker | 2014-11-26 | 1 | -7/+7 |
| | |||||
* | Update statement node ASTs | kpdecker | 2014-11-26 | 1 | -49/+50 |
| | |||||
* | Update MustacheNode for new AST structure | kpdecker | 2014-11-26 | 1 | -1/+1 |
| | |||||
* | Update ProgramNode to better match SpiderMonkey | kpdecker | 2014-11-26 | 1 | -7/+7 |
| | |||||
* | Update AST location info to match SpiderMonkey | kpdecker | 2014-11-26 | 1 | -7/+3 |
| | | | Part of #889 | ||||
* | Merge branch 'remove-block-mustache' of github.com:mmun/handlebars.js into ↵ | kpdecker | 2014-11-08 | 1 | -2/+1 |
|\ | | | | | | | | | | | | | | | mmun-remove-block-mustache Conflicts: lib/handlebars/compiler/helpers.js spec/parser.js | ||||
| * | Simplify BlockNode by removing intermediate MustacheNode | Martin Muñoz | 2014-11-02 | 1 | -2/+1 |
| | | |||||
* | | Include location information in all opcodes | kpdecker | 2014-11-08 | 1 | -45/+49 |
|/ | |||||
* | Add preventIndent option for partials | kpdecker | 2014-11-02 | 1 | -1/+6 |
| | | | | | This disables the standalone partial indent behavior required by the Mustache spec and allows for users to utilize partials in the same manner as under 1.x. Fixes #858 | ||||
* | Prune unused code | kpdecker | 2014-08-25 | 1 | -1/+1 |
| | |||||
* | Allow passing depths to _child | kpdecker | 2014-08-25 | 1 | -2/+2 |
| | |||||
* | Optimize compiler opcode call | kpdecker | 2014-08-24 | 1 | -1/+3 |
| | |||||
* | Move strip processing into AST helper logic | kpdecker | 2014-08-23 | 1 | -13/+1 |
| | | | | | We already have to track these behaviors for the standalone parsing and rather than having two whitespace pruning implementations this moves all of the behavior into one place. Fixes #852 | ||||
* | Replace string value rather than add omit flag | kpdecker | 2014-08-23 | 1 | -1/+1 |
| | |||||
* | Fix compiler program de-duping | kpdecker | 2014-08-14 | 1 | -9/+19 |
| | |||||
* | Drop unused Compiler.disassemble method | kpdecker | 2014-08-14 | 1 | -24/+0 |
| | |||||
* | Drop unused DECLARE opcode | kpdecker | 2014-08-14 | 1 | -4/+0 |
| | |||||
* | Implement recursive field lookup in compat mode | kpdecker | 2014-08-13 | 1 | -1/+7 |
| | | | | | | Provides the mustache behavior of recursive lookup without the use of depthed paths. Note that this does incur a fairly dramatic performance penalty for depthed queries. | ||||
* | Create contextName helper for context lookup | kpdecker | 2014-08-13 | 1 | -1/+2 |
| | |||||
* | Render indent for standalone partials | kpdecker | 2014-08-12 | 1 | -1/+1 |
| | |||||
* | Drop omitted content tags from generated output | kpdecker | 2014-08-12 | 1 | -1/+3 |
| | |||||
* | Do not lookup pathed helpers on the helper stack | kpdecker | 2014-07-12 | 1 | -1/+1 |
| | | | | Fixes #764 | ||||
* | Use ID lookup for ambiguous helper evaluation | kpdecker | 2014-07-07 | 1 | -0/+2 |
| | | | Final change for #731 | ||||
* | Rework lookup null protector logic | kpdecker | 2014-07-06 | 1 | -10/+5 |
| | | | | | | | - Move the lookup null protection out of `nameLookup` and into that contexts that are aware of the needs for falsy vs. not displayed values. - Optimize lookup for nested path operations Fixes #731 | ||||
* | Expose setup wrappers for compiled templates | kpdecker | 2014-05-19 | 1 | -2/+8 |
| | |||||
* | Pass full id to helperMissing | Tom Dale | 2014-05-13 | 1 | -1/+1 |
| | |||||
* | Fix evaluation of paths and subexprs | kpdecker | 2014-03-05 | 1 | -3/+1 |
| | | | Fixes #743 | ||||
* | properly handle multiple subexpressions in the same hash, fixes #748 | Jon Jensen | 2014-02-20 | 1 | -6/+6 |
| | | | | | push all hash params before popping any so as to avoid the last stackN var stomping previous ones | ||||
* | Add child accessor API | kpdecker | 2014-02-09 | 1 | -1/+8 |
| | |||||
* | Add support for depthed resolution of data fields | kpdecker | 2014-02-09 | 1 | -5/+1 |
| | |||||
* | Implement lookup helper | kpdecker | 2014-02-09 | 1 | -1/+2 |
| | |||||
* | Add trackIds compiler flag | kpdecker | 2014-01-17 | 1 | -0/+4 |
| | | | | Allows helpers that care about where a particular field came from derive this data while maintaining backward compatibility with existing helpers. | ||||
* | Fix missing parameters for pathed mustaches | kpdecker | 2014-01-17 | 1 | -1/+3 |
| | | | Fixes #658 | ||||
* | Allow decimal number values | kpdecker | 2014-01-17 | 1 | -2/+2 |
| | | | Fixes #472 | ||||
* | Implement partial hash evaluation | kpdecker | 2014-01-17 | 1 | -2/+8 |
| | |||||
* | Include name option for all helper calls | kpdecker | 2014-01-06 | 1 | -1/+1 |
| | | | | | | | | All helper calls will have access to `options.name` which is the first id value of the mustache operation. As part of this the helperMissing call has been simplified to remove the indexed name in order to optimize the call. This is a breaking change. Fixes #634 | ||||
* | Refactor out pushParams method | kpdecker | 2014-01-06 | 1 | -34/+19 |
| | | | Simplifies hash and param push logic | ||||
* | Track stringParams mode in local state vars | kpdecker | 2014-01-06 | 1 | -2/+3 |
| | |||||
* | Simplify ambiguous code | kpdecker | 2014-01-04 | 1 | -0/+1 |
| | | | | Remove if conditional in favor of boolean failover. | ||||
* | Include line info in compiler thrown exceptions | kpdecker | 2014-01-01 | 1 | -3/+2 |
| | | | Fixes #636 | ||||
* | Remove duplication from generated subexpressions | kpdecker | 2014-01-01 | 1 | -1/+1 |
| | |||||
* | Added support for subexpressions | machty | 2013-12-30 | 1 | -44/+46 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | Make the environment reusable. | Blake Embrey | 2013-12-28 | 1 | -12/+9 |
| | |||||
* | Export AST as an object rather than module | kpdecker | 2013-12-01 | 1 | -1/+1 |
| | | | The parser expects the AST object to be mutable, which modules are not. | ||||
* | Wrap AST nodes in strip opcodes if defined | kpdecker | 2013-10-14 | 1 | -2/+14 |
| | |||||
* | Use accept for all compiler traversal | kpdecker | 2013-10-14 | 1 | -4/+3 |
| | |||||
* | Use template env and compile methods | kpdecker | 2013-10-09 | 1 | -3/+2 |
| | |||||
* | Use proper default vs. module import semantics | kpdecker | 2013-10-01 | 1 | -7/+5 |
| | |||||
* | Break exception class out into a standalone module | kpdecker | 2013-10-01 | 1 | -1/+1 |
| | |||||
* | Make the Handlebars environment into an object | Yehuda Katz | 2013-07-26 | 1 | -3/+3 |
| | | | | | | | | The idea is that the environment wraps up the mutable stuff in Handlebars (like the helpers) and that you could theoretically create a new one at any time and pass it in to Handlebars.template. Every test makes a new environment and uses it in template compilation. | ||||
* | Further progress towards modularization. | Yehuda Katz | 2013-07-24 | 1 | -6/+8 |
| | | | | | At this point, I have only 2 fails in the Node build, but I'm doing a bunch of manual stuff locally and still have a bunch of hacks. | ||||
* | Building an AMD file | Yehuda Katz | 2013-07-16 | 1 | -2/+1 |
| | |||||
* | Initial work on ES6 modules | Yehuda Katz | 2013-07-01 | 1 | -25/+21 |
| | |||||
* | Break JavascriptCompiler into standalone file | kpdecker | 2013-06-03 | 1 | -844/+2 |
| | |||||
* | Merge global and passed helpers and partials | kpdecker | 2013-05-31 | 1 | -2/+3 |
| | |||||
* | Allow execution of helpers on the context | kpdecker | 2013-05-30 | 1 | -1/+2 |
| | | | Fixes #285 | ||||
* | Protect from object prototype modifications | kpdecker | 2013-05-28 | 1 | -1/+3 |
| | | | | Fixes #534 | ||||
* | Add support for complex ids in @data references | kpdecker | 2013-05-27 | 1 | -2/+10 |
| | |||||
* | Merge pull request #454 from leshill/fix_string_mode_contexts | Kevin Decker | 2013-04-07 | 1 | -2/+13 |
|\ | | | | | Add contexts for string mode hash values | ||||
| * | Add contexts for string mode hash values | Les Hill | 2013-03-19 | 1 | -2/+13 |
| | | | | | | | | Allows for evaluating hash parameters such as ../city in string mode. | ||||
* | | Merge branch 'program-metadata' | kpdecker | 2013-04-07 | 1 | -6/+1 |
|\ \ | |||||
| * | | Add program metadata | kpdecker | 2013-02-17 | 1 | -6/+1 |
| |/ | | | | | | | | | | | Include program id and depth on the generated wrapper objects. This allows helpers who are passed these objects to differentiate between helpers for cases where they may want to cache the generated DOM structure. | ||||
* | | Restore knownHelpersOnly throw | kpdecker | 2013-04-06 | 1 | -1/+1 |
| | | | | | | Fixes #302 | ||||
* | | Allow compilation of empty string | kpdecker | 2013-04-06 | 1 | -2/+2 |
| | | | | | | Fixes #461 | ||||
* | | Escape unicode newlines in string literals | kpdecker | 2013-04-06 | 1 | -1/+3 |
|/ | | | Fixes #375 | ||||
* | Fix #428 nested if else rendering | kpdecker | 2013-02-16 | 1 | -0/+11 |
| | | | | The program equality checker was not taking children into account when determining equality, causing breakages under similar cases. |