Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use objects for hash value tracking | kpdecker | 2016-03-11 | 1 | -1/+1 |
| | | | | | | The use of arrays was incorrect for the data type and causing problems when hash keys conflicted with array behaviors. Fixes #1194 | ||||
* | Ensure that existing blockParams and depths are respected on dupe programs | Charles O'Farrell | 2016-03-08 | 1 | -8/+10 |
| | | | | Fixes #1186 | ||||
* | 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 | 2 | -150/+2 |
| | | | | Closes #1145 | ||||
* | Fix lint errors under latest eslint | kpdecker | 2015-10-31 | 1 | -1/+1 |
| | |||||
* | Fix iteration over undefined values | kpdecker | 2015-09-23 | 1 | -2/+3 |
| | | | | | Allow for iteration on undefined values, but special case undefined and null to prevent rendering errors when not running in strict mode. Fixes #1093 | ||||
* | Fix failure when using decorators in partials | kpdecker | 2015-09-02 | 1 | -0/+1 |
| | |||||
* | Update to latest eslint | kpdecker | 2015-09-01 | 3 | -5/+5 |
| | |||||
* | Add explicitPartialContext compiler flag | kpdecker | 2015-09-01 | 1 | -1/+5 |
| | | | Fixes #1032 | ||||
* | Implement block decorators | kpdecker | 2015-08-22 | 3 | -4/+83 |
| | | | | 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. | ||||
* | Add decorator parsing | kpdecker | 2015-08-22 | 4 | -4/+19 |
| | |||||
* | Add whitespace control to partial block statements | kpdecker | 2015-08-22 | 1 | -1/+3 |
| | |||||
* | Create validateClose helper method | kpdecker | 2015-08-22 | 1 | -20/+19 |
| | | | | Avoid duplicating the logic needed to check for close block mismatches. | ||||
* | Implement partial blocks | kpdecker | 2015-08-22 | 4 | -23/+71 |
| | | | | | | 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 | 2 | -2/+13 |
| | |||||
* | Drop AST constructors in favor of JSON | kpdecker | 2015-08-18 | 5 | -148/+65 |
| | | | | | These were little more than object literal statements that were less clear due to their use of index-based arguments. Fixes #1077 | ||||
* | Pass container rather than exec as context | kpdecker | 2015-08-18 | 1 | -10/+10 |
| | | | There is no real need for us to do `.call(container` other than for backwards compatibility with legacy versions. Using the 4.x release as a chance to optimize this behavior. | ||||
* | Remove unused parameters | kpdecker | 2015-08-18 | 1 | -2/+2 |
| | |||||
* | Add ignoreStandalone compiler option | kpdecker | 2015-08-13 | 2 | -6/+10 |
| | | | Fixes #1072 | ||||
* | Bulletproof AST.helpers.helperExpression | kpdecker | 2015-08-03 | 1 | -1/+3 |
| | | | | | Avoid undefined values and potential false positives from other type values such as partials. Fixes #1055 | ||||
* | Use += in printer | kpdecker | 2015-08-03 | 1 | -9/+9 |
| | |||||
* | Enforce 100% code coverage | kpdecker | 2015-08-03 | 2 | -14/+16 |
| | |||||
* | Pass undefined fields to helpers in strict mode | kpdecker | 2015-08-03 | 2 | -9/+13 |
| | | | | | 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 |
| | |||||
* | Fix escaping of non-javascript identifiers | kpdecker | 2015-08-01 | 1 | -1/+1 |
| | | | | The ‘ character would cause invalid javascript to be generated as it was not properly escaped. Switching to JSON.stringify safely handles all potential unescaped cases. | ||||
* | #1056 Fixed grammar for nested raw blocks | Eric Nielsen | 2015-07-15 | 1 | -2/+2 |
| | |||||
* | Fix location information for programs | kpdecker | 2015-06-26 | 1 | -0/+25 |
| | | | | | | | | There appears to be a bug in our use of jison causing the parent location information to be reported to programs. I wasn’t able to work through what might be causing this so instead using the location information of the statements collection to generate the proper location information. This is a bit of a hack but we are very far behind on the Jison release train and upgrading will likely be a less than pleasant task that doesn’t provide us much benefit. Fixes #1024 | ||||
* | Remove jshint completely | kpdecker | 2015-04-27 | 2 | -6/+0 |
| | |||||
* | Update for let and optional parameters | kpdecker | 2015-04-20 | 9 | -177/+174 |
| | |||||
* | Add full support for es6 | kpdecker | 2015-04-16 | 9 | -114/+123 |
| | | | | | | | | 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 | ||||
* | Allow this references in literal statements | kpdecker | 2015-04-14 | 1 | -2/+13 |
| | | | Fixes #967 | ||||
* | Ignore branches tested without coverage monitoring | kpdecker | 2015-04-07 | 1 | -1/+2 |
| | |||||
* | Remove vestigial code | kpdecker | 2015-04-07 | 1 | -5/+0 |
| | |||||
* | Add undefined and null literal support | kpdecker | 2015-04-07 | 4 | -0/+30 |
| | | | | | This adds the UndefinedLiteral and NullLiteral to AST. Fixes #990 | ||||
* | Avoid source-map import under AMD | kpdecker | 2015-04-07 | 1 | -2/+12 |
| | | | Fixes #989 | ||||
* | 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 | 5 | -58/+58 |
| | | | | | 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 | 5 | -5/+34 |
| | | | | | | | | | Uses the subexpression syntax to allow for dynamic partial lookups. Ex: ``` {{> (helper) }} ``` Fixes #933 | ||||
* | Add missing reserved words so compiler knows to use array syntax: | Matthew Flaschen | 2015-01-17 | 1 | -1/+2 |
| | | | | | | | | | | | | | | | | * await * null * true * false IE 8 was failing to compile Handlebars-generated source code because it had helpers.null. I came up with this list by diffing https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords against the ones Handlebars already had. I added two corresponding tests for nameLookup. | ||||
* | Merge pull request #932 from wycats/strict | Kevin Decker | 2014-12-31 | 1 | -7/+42 |
|\ | | | | | Implement strict and assumeObject modes | ||||
| * | Implement strict and assumeObject modes | kpdecker | 2014-12-27 | 1 | -7/+42 |
| | | | | | | | | | | | | | | | | Causes templates to throw when lookup fields are not defined within the context. Strict mode will throw when any field is omitted. assumeObjects mode maintains the existing behavior of outputting an empty response when fields are not defined but allows for performance/size optimizations by not doing safety checks for intermediate objects in the lookup chain. Strict mode effectively disables the helperMissing and inverse handling for blockHelperMissing as templates will throw rather than call those features for missing data fields. Fixes #651 Fixes #805 | ||||
* | | Merge branch 'master' into visitor-update | kpdecker | 2014-12-27 | 2 | -4/+4 |
|\ \ | |/ | |||||
| * | Fix block param evaluation under older IE | kpdecker | 2014-12-27 | 1 | -2/+2 |
| | | |||||
| * | Strip unnecessary whitespace in template output | kpdecker | 2014-12-27 | 1 | -1/+1 |
| | | |||||
| * | Fix duplicate return statement on simple templates | kpdecker | 2014-12-27 | 1 | -1/+1 |
| | | |||||
* | | Fix case-insensitive file system compile issue | kpdecker | 2014-12-26 | 1 | -1/+1 |
| | | |||||
* | | Add parent tracking and mutation to AST visitors | kpdecker | 2014-12-26 | 1 | -35/+78 |
|/ | | | Fixes #916 | ||||
* | Bump code coverage | kpdecker | 2014-12-26 | 2 | -2/+3 |
| | |||||
* | Implement block parameters | kpdecker | 2014-12-26 | 2 | -41/+106 |
| | | | Fixes #907 | ||||
* | Expose AST helpers in public API | kpdecker | 2014-12-21 | 2 | -21/+26 |
| | |||||
* | Update fix for #926 for 3.0 codeline | kpdecker | 2014-12-17 | 1 | -1/+1 |
| | |||||
* | Track depths on deduped children | kpdecker | 2014-12-16 | 1 | -0/+2 |
| | | | | | Fixes a very specific error case where deduped children won’t receive the depths object due to it being omitted by the caller when optimizing. Fixes #926 | ||||
* | 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 | 5 | -7/+3 |
| | |||||
* | Remove Compiler.depths parameter | kpdecker | 2014-12-16 | 2 | -19/+7 |
| | | | | This is no longer necessary with the depths array tracking and adds compiler overhead. | ||||
* | Add instructions for 'spec/mustache' to CONTRIBUTING.md, fix a few typos ↵ | Or Neeman | 2014-12-07 | 2 | -2/+2 |
| | | | | elsewere | ||||
* | Add basic docs for JavaScriptCompiler override API | kpdecker | 2014-11-29 | 1 | -9/+9 |
| | |||||
* | Drop unused JavaScriptCompiler.namespace param | kpdecker | 2014-11-29 | 1 | -2/+0 |
| | |||||
* | 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 |
| | |||||
* | Rework strip flags to make clearer at in AST level | kpdecker | 2014-11-28 | 4 | -188/+239 |
| | | | Rather than keeping state in the AST, which requires some gymnastics, we create a separate visitor flow which does the top down iteration necessary to calculate all of the state needed for proper whitespace control evaluation. | ||||
* | Move Jison parsing out of AST into helpers | kpdecker | 2014-11-28 | 2 | -38/+46 |
| | |||||
* | Add original to BooleanLiteral | kpdecker | 2014-11-28 | 1 | -1/+2 |
| | |||||
* | Rename AST objects to match type names | kpdecker | 2014-11-28 | 2 | -16/+16 |
| | |||||
* | Treat partial exec in a manner closer to helpers | kpdecker | 2014-11-27 | 3 | -34/+37 |
| | | | 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 | 6 | -105/+104 |
| | |||||
* | Simplify Path and Sexpr calculated flags | kpdecker | 2014-11-27 | 2 | -25/+38 |
| | |||||
* | Replace DataNode and IdNode with PathNode | kpdecker | 2014-11-26 | 5 | -55/+42 |
| | | | 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 | 5 | -26/+23 |
| | |||||
* | Update statement node ASTs | kpdecker | 2014-11-26 | 5 | -147/+133 |
| | |||||
* | Update MustacheNode for new AST structure | kpdecker | 2014-11-26 | 4 | -25/+14 |
| | |||||
* | Update ProgramNode to better match SpiderMonkey | kpdecker | 2014-11-26 | 6 | -61/+62 |
| | |||||
* | Update AST location info to match SpiderMonkey | kpdecker | 2014-11-26 | 6 | -43/+42 |
| | | | Part of #889 | ||||
* | Optimize variable declaration | kpdecker | 2014-11-25 | 1 | -2/+1 |
| | |||||
* | Add parser support for block params | Martin Muñoz | 2014-11-11 | 3 | -2/+14 |
| | |||||
* | Propagate options for client compiled partials | kpdecker | 2014-11-08 | 1 | -0/+2 |
| | | | Fixes #901 | ||||
* | Merge branch 'remove-block-mustache' of github.com:mmun/handlebars.js into ↵ | kpdecker | 2014-11-08 | 4 | -26/+31 |
|\ | | | | | | | | | | | | | | | mmun-remove-block-mustache Conflicts: lib/handlebars/compiler/helpers.js spec/parser.js | ||||
| * | Remove RawBlockNode in favor of prepareRawBlock helper | Martin Muñoz | 2014-11-05 | 2 | -9/+3 |
| | | |||||
| * | Simplify BlockNode by removing intermediate MustacheNode | Martin Muñoz | 2014-11-02 | 4 | -20/+31 |
| | | |||||
* | | Only provide aliases for multiple use calls | kpdecker | 2014-11-08 | 1 | -26/+39 |
| | | | | | | Fixes #903 | ||||
* | | Provide default mapping for boilerplate code | kpdecker | 2014-11-08 | 1 | -1/+5 |
| | | |||||
* | | Generate source maps | kpdecker | 2014-11-08 | 2 | -100/+275 |
| | | | | | | | | | | | | Allow the precompiler to generate source maps when the srcFile parameter is passed. This refactors large chunks of the code generation pipeline, allowing metadata to be associated with code chunks as well as breaking out much of the code generation logic into a separate helper. | ||||
* | | Include location information in all opcodes | kpdecker | 2014-11-08 | 2 | -45/+50 |
| | | |||||
* | | Merge pull request #892 from wycats/else-if | Kevin Decker | 2014-11-08 | 1 | -7/+26 |
|\ \ | | | | | | | Implement parser for else chaining of helpers | ||||
| * | | Implement parser for else chaining of helpers | kpdecker | 2014-10-27 | 1 | -7/+26 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows users to chain multiple helpers together using their inverse callbacks. I.e. ``` {{#if foo}} {{else if bar}} {{else}} {{/if}} ``` The control flow here effectively causes the helpers to be nested. The above is actually syntactic sugar for this: ``` {{#if foo}} {{else}} {{#if bar}} {{else}} {{/if}} {{/if}} ``` Any helper may be used in this manner, the only requirement is they support normal calls and inverse calls. Introduces a breaking change in that `{{else foo}}` may no longer be used as a root level operator. Instead `{{^foo}}` must be used. Fixes #72. | ||||
* | | | Simplify program generation logic | kpdecker | 2014-11-08 | 1 | -10/+2 |
| | | | |||||
* | | | Bump test coverage | kpdecker | 2014-11-08 | 2 | -3/+4 |
| | | | |||||
* | | | Ignore unused code paths | kpdecker | 2014-11-08 | 1 | -0/+2 |
| | | | | | | | | | | | | We don’t want to remove these as the generic code may need it in the future, but these code paths are not triggered through the existing language constructs. | ||||
* | | | Merge setupParams and setupOptions | kpdecker | 2014-11-06 | 1 | -9/+2 |
| | | | |||||
* | | | Simplify flushInline implementation | kpdecker | 2014-11-05 | 1 | -19/+10 |
| | | | |||||
* | | | Use terinary operator for inline appends | kpdecker | 2014-11-05 | 1 | -7/+12 |
| | | | | | | | | | | | | Allows for append operations to avoid breaking inline chain. | ||||
* | | | Provide stubbed visitor implementation | kpdecker | 2014-11-05 | 1 | -2/+58 |
| |/ |/| | | | Part of #889 | ||||
* | | 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 |